Performance testing overview

更新时间:
复制 MD 格式

This document presents benchmark results for online transactional processing (OLTP) workloads after column encryption is enabled in Data Security Center (DSC). Use these results to estimate the performance impact on your database before enabling column encryption in production.

The benchmarks cover the following databases, workloads, and concurrency levels:

  • Databases: RDS for MySQL 8.0, RDS for MySQL 5.7, PolarDB for MySQL 8.0.1 (Standard and Cluster Editions)

  • Workloads: read-only (oltp_read_only) and read/write (oltp_read_write) — PolarDB uses read-only

  • Concurrency: 64, 128, and 256 threads

  • Metrics: queries per second (QPS) and response time (RT) in milliseconds

Each result compares two scenarios:

  • Plaintext query: no encryption rules are set

  • Ciphertext query: all columns in the database are encrypted

Note

Column encryption has no impact on the write performance of the database.

Test environment

All tests use the industry-standard SysBench tool to simulate database load at varying concurrency levels. The test dataset is identical across all database versions:

  • Data volume per table: 25,000 rows

  • Number of tables: 250

The instance configurations differ by database version and are described in each section below.

RDS for MySQL 8.0 High-availability Edition

Instance configuration

ParameterValue
Instance typemysql.n2.xlarge.2c
Instance familyGeneral-purpose
Instance seriesHigh-availability series
Storage classPL1 ESSD
VersionRDS for MySQL 8.0 20240229

Read-only results

image.png
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6420,957.0120,451.6948.8550.06
12840,395.0040,523.2650.6850.52
25667,328.3153,119.0360.8077.07

Read/write results

image.png
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6420,201.5519,942.4263.3564.17
12840,133.3640,343.3363.7663.43
25662,039.7746,675.2682.46109.59

RDS for MySQL 5.7 High-availability Edition

Instance configuration

ParameterValue
Instance typemysql.n2.xlarge.2c
Instance familyGeneral-purpose
Instance seriesHigh-availability series
Storage classPL1 ESSD
VersionRDS for MySQL 5.7 20240229

Read-only results

image.png
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6414,332.5814,021.9471.4373.01
12828,712.2728,097.9571.3272.87
25651,173.1843,663.6780.0293.79

Read/write results

image
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6414,349.4614,073.5289.1890.93
12828,745.7328,480.9689.0389.86
25652,388.1747,524.6997.69107.69

PolarDB for MySQL 8.0.1 Standard and Cluster Editions

Column encryption on PolarDB performs data encryption operations on the proxy. This increases CPU load on the proxy during read operations. If you use the column encryption feature, scale out the proxy as soon as possible.

Note

The proxy is free of charge. The test used the maximum proxy specification supported by the Standard Edition instance (16 cores). For the best read performance after enabling column encryption, scale out the proxy to the maximum specification for your edition.

Standard Edition

Instance configuration

ParameterValue
Kernel instance typepolar.mysql.g2.xlarge.c
Storage classPL1 ESSD
Database nodes1 primary node, 1 read-only node (8 cores, 16 GB)
Kernel version8.0.1.1.41
Proxy version2.8.38
Proxy configuration16 cores

Read-only results

image.png
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6426,997.9825,852.5837.9239.60
12853,991.6550,477.3737.9240.56
256108,128.3193,823.2337.8643.63

Cluster Edition

Instance configuration

ParameterValue
Storage classPSL5
Database nodes1 primary node, 1 read-only node (1–16 PolarDB Capacity Units (PCUs))
Kernel version8.0.1.1.41
Proxy version2.8.38
Proxy configuration0.5–32 PCUs

Read-only results

image.png
ThreadsPlaintext QPSCiphertext QPSPlaintext RT (ms)Ciphertext RT (ms)
6414,830.7914,615.2668.9670.02
12829,628.5728,518.6769.0571.77
25659,483.8450,984.7368.7380.27

Performance impact summary

At low to moderate concurrency (64–128 threads), ciphertext QPS and RT are within 2–4% of plaintext across all tested databases, which is acceptable for most OLTP workloads. At high concurrency (256 threads), the gap widens — QPS drops by up to 25% on RDS and up to 13% on PolarDB Standard Edition — primarily because the decryption overhead on the proxy or database layer becomes the bottleneck.

Key takeaways:

  • Low and moderate concurrency: The performance difference between plaintext and ciphertext queries is negligible for most production workloads.

  • High concurrency on RDS: Plan for a QPS reduction of up to 25% and an RT increase of up to 33% at 256 threads.

  • PolarDB: Scale out the proxy to the maximum supported specification before enabling column encryption. The proxy is free of charge.