This topic describes how enabling or disabling transparent data encryption (TDE) affects database performance in OceanBase Database, helping you evaluate whether to use TDE.
Test conclusions
After enabling TDE, tests were conducted on OLTP scenarios with 128/256 concurrent connections. There was no performance impact in update scenarios, but slight performance degradation was observed in other scenarios.
- In point select scenarios, performance dropped by about 3%. In read-only scenarios, the decrease was around 1%.
- In read-write scenarios, performance dropped by about 2%. In write-only scenarios, the decrease was around 1%. In insert scenarios, the decrease was also around 1%.
Overall, the most noticeable performance impact was seen in point select and read-write scenarios, but in all cases, the decrease was less than 3%.
Test environment
Cluster configuration
Item Configuration details Cluster version OceanBase V4.2.1.8 Cluster specification 2F1A, primary zone = zone1, 8 CPU cores, 16 GB memory Cluster machine - CPU: 8 cores
- Operating system: CentOS Linux release 5.10.134 (Core)
- Memory: 61 GB
Client configuration
Item Configuration details Operating system CentOS Linux release 5.10.134 (Core) Sysbench version sysbench 1.0.20 CPU specification 8 cores Memory 30 GB
Test tools
Sysbench is a cross-platform, multi-threaded, modular open-source benchmarking tool used to evaluate system performance under high-load database operations.
Test metrics
Transactions per second (TPS): The number of transactions executed by the database per second, measured by the number of successful COMMIT operations.
Average transaction latency: The average time taken by the database to execute a single transaction, measured in milliseconds (ms).
Test procedure
This test uses 128 tables, each with 1 million rows of data, and an execution time of 60 seconds as an example.
Install the sysbench tool
The sysbench tool can be installed either with the yum install command or manually.
To install with the
yum installcommand:On the client machine, run the following command to install sysbench:
sudo yum install sysbenchTo install manually:
Download sysbench.
For sysbench download instructions, see Download sysbench.
Unzip the sysbench package.
unzip ./1.0.20.zipCompile sysbench.
Enter the unzipped sysbench directory and run the following commands to compile sysbench:
[wieck@localhost ~]# cd sysbench-1.0.20 [wieck@localhost sysbench-1.0.20]# ./autogen.sh [wieck@localhost sysbench-1.0.20]# ./configure --prefix=/usr/sysbench/ --with-mysql-includes=/usr/include/mysql/ --with-mysql-libs=/usr/lib64/mysql/ --with-mysql [wieck@localhost sysbench-1.0.20]# make [wieck@localhost sysbench-1.0.20]# make installParameters:
Parameter Description --prefix Specifies the installation directory for sysbench. --with-mysql-includes Specifies the includes directory for MySQL. --with-mysql-libs Specifies the lib directory for MySQL. --with-mysql sysbench supports MySQL by default. Run the following command to verify that sysbench was installed successfully:
[wieck@localhost sysbench-1.0.20] $./src/sysbench --helpIf you see the following output, sysbench was installed successfully:
Usage: sysbench [options]... [testname] [command] Commands implemented by most tests: prepare run cleanup help
Run the test
Note
- The process for testing with other thread counts and scripts is the same as described below.
- The following example uses a MySQL-compatible tenant, 128 threads, 128 tables each with 1 million rows, an execution time of 60 seconds, and the read write test script.
Log in to the test tenant.
obclient -h$host -P$port -u$user_name -p******Purge obsolete data to free up disk space.
obclient> PURGE RECYCLEBIN;Set the query timeout.
obclient > set global ob_query_timeout=36000000000;Set the transparent encryption method.
The transparent encryption method is controlled by the tenant-level parameter
tde_method. For more information about tde_method, see tde_method.For more information on configuring transparent encryption, see Database transparent encryption.
Notice
Once the
tde_methodparameter is set, it cannot be changed.obclient > ALTER SYSTEM SET tde_method='internal';Exit the database and use sysbench to load the test data.
[wieck@localhost src]# ./sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=128 --time=60 oltp_read_write prepareRun the custom test script.
[wieck@localhost src]# ./sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=128 --time=60 oltp_read_write runClean up the test data.
[wieck@localhost src]# ./sysbench --db-driver=mysql --mysql-host=[database server host] --mysql-port=[database server port] --mysql-user=[database user name] --mysql-password=[database user password] --mysql-db=testdb --table_size=1000000 --tables=128 --threads=128 --time=60 oltp_read_write cleanup
Test results
| Test script/Threads | TDE enabled? | 128 (tps/rt avg) | 256 (tps/rt avg) | Rate |
|---|---|---|---|---|
| point select | No | 161720.04/0.79 | 172429.16/1.48 | \ |
| point select | Yes | 161113.90/0.79 | 167284.47/1.53 | -2.98% |
| read only | No | 6571.77/19.47 | 6877.75/37.19 | \ |
| read only | Yes | 6558.48/15.51 | 6813.74/37.54 | -0.93% |
| read write | No | 3483.70/36.10 | 3575.20/71.50 | \ |
| read write | Yes | 3391.10/37.72 | 3572.78/71.55 | -2.61% |
| insert | No | 37806.09/3.38 | 54585.23/4.69 | \ |
| insert | Yes | 37121.78/3.45 | 54353.98/4.71 | -0.42% |
| update | No | 29743.67/4.30 | 38743.35/6.61 | \ |
| update | Yes | 29866.70/4.28 | 38905.09/6.58 | No impact |
| update non index | No | 38892.58/3.29 | 55662.11/4.60 | \ |
| update non index | Yes | 39250.25/3.26 | 56661.89/4.52 | No impact |
| write_only | No | 11583.12/11.05 | 12395.72/20.64 | \ |
| write_only | Yes | 11450.32/11.17 | 12259.25/20.87 | -1.10% |
Note
In the table above, a - in the 'rate' column indicates a decrease in performance. For example, for 'point select', enabling TDE results in a 2.98% performance drop.