PolarDB Serverless scalability

更新时间:
复制 MD 格式

PolarDB Serverless is the commercial product of the mature technology proposed in the SIGMOD 2021 paper. This article uses the Sysbench tool to test the scalability of PolarDB Serverless. You can follow the method described in this article to perform your own tests and quickly understand the scalability of Serverless.

Test configuration

  • The ECS instance and the PolarDB for PostgreSQL cluster must be in the same region and VPC.

  • The PolarDB for PostgreSQL cluster is configured as follows:

    • Number of clusters: 1

    • Billing method: Serverless

    • Database engine:

    • Edition: Standard Edition

    • Storage type and capacity: ESSD AutoPL cloud disk (Provisioned IOPS: 0), 100 GB

    Note

    When you create a Serverless cluster, you can keep the default settings for Maximum/Minimum Read-only Nodes and Maximum/Minimum Resources for Single Node.

  • The ECS instance is configured as follows:

    • Number of instances: 1

    • Instance specification: ecs.g7.4xlarge (16 vCPU 64 GiB)

    • Image: Alibaba Cloud Linux 3.2104 LTS 64-bit

    • System disk: ESSD cloud disk, PL0, 100 GB

Test tool

Sysbench is an open-source, cross-platform performance benchmark tool used to evaluate the performance of databases such as PostgreSQL. The tool supports multi-threaded testing and provides flexible configuration options.

Preparations

Provision the environment

Provision an ECS instance and a PolarDB for PostgreSQL Serverless cluster according to the Test configuration.

Install Sysbench

Log in to the ECS instance as the root user and install Sysbench.

sudo yum -y install sysbench
Note

This example uses Alibaba Cloud Linux. If you use a different operating system, adjust the installation command based on the official Sysbench documentation.

Configure cluster information

Go to the PolarDB console to create a database account, create a database, and view the connection endpoint.

Note
  • Because the ECS instance and the PolarDB for PostgreSQL cluster are in the same VPC, add the private IP address of the ECS instance to a new IP whitelist or add the security group that contains the ECS instance to the cluster's IP whitelist.

  • Use the Cluster Endpoint, not the Primary address.

Single-node vertical scaling (scale-up)

This test uses Sysbench to verify that the primary node's resources automatically scale based on the workload.

Prepare data

Use Sysbench to prepare 32 tables in the PolarDB for PostgreSQL cluster, with each table containing 100,000 rows. This preparation process might cause the Serverless cluster to scale up automatically. After the data is prepared, wait 3 to 5 minutes for the primary node to scale back down to 1 PCU. Run the following command and adjust the parameters based on your actual configuration:

sysbench /usr/share/sysbench/oltp_read_write.lua --pgsql-host=<host> --pgsql-port=<port> --pgsql-user=<user> --pgsql-password=<password> --pgsql-db=<database> --tables=32 --table-size=100000 --report-interval=1 --range_selects=1 --db-ps-mode=disable --rand-type=uniform --threads=32 --db-driver=pgsql --time=12000 prepare
  • Serverless cluster parameters:

    • <host>: The Cluster Endpoint.

    • <port>: The port number that corresponds to the Cluster Endpoint. The default value is 5432.

    • <user>: The database account.

    • <password>: The password for the database account.

    • <database>: The database name.

  • Other parameters:

    • --db-ps-mode: Set to disable to disable prepared statements and ensure that all transactional SQL is executed as raw SQL statements.

    • --threads: The number of threads. You can use different values to create different load levels. This example uses 32 threads for data preparation, with an expected duration of 5 minutes.

Adjust Serverless configuration

To isolate the vertical scaling test, you must ensure that no read-only nodes are added during the load test. Go to the PolarDB console. On the cluster details page, in the Database Nodes section, adjust the Serverless configuration. Set Maximum Resources for Single Node to 32, Minimum Resources for Single Node to 1, and Maximum and Minimum Read-only Nodes to 0.

Initial validation: Low load (16 threads)

First, run a simple test to evaluate the results with 16 threads and gain an initial understanding of Serverless scalability.

  1. Run the following load test command. Set the --threads parameter to 16 and adjust the other parameters based on your configuration.

    sysbench /usr/share/sysbench/oltp_read_write.lua --pgsql-host=<host> --pgsql-port=<port> --pgsql-user=<user> --pgsql-password=<password> --pgsql-db=<database> --tables=32 --table-size=100000 --report-interval=1 --range_selects=1 --db-ps-mode=disable --rand-type=uniform --threads=16 --db-driver=pgsql --time=12000 run
  2. The results show that under a fixed load with 16 concurrent threads, throughput (TPS) gradually increases over time while latency decreases. Both metrics eventually stabilize. This indicates that system performance significantly improves after Serverless auto scaling is triggered.

    [   1s ] thds: 16 tps: 201.31 qps: 3221.01 (r/w/o: 2013.13/805.25/402.63) lat (ms,95%): 267.57 err/s: 0.00 reconn/s: 0.00
    [   2s ] thds: 16 tps: 218.42 qps: 3494.74 (r/w/o: 2184.21/873.68/436.84) lat (ms,95%): 261.18 err/s: 0.00 reconn/s: 0.00
    [   3s ] thds: 16 tps: 250.76 qps: 4012.10 (r/w/o: 2507.56/1003.02/501.51) lat (ms,95%): 255.63 err/s: 0.00 reconn/s: 0.00
    [   4s ] thds: 16 tps: 283.90 qps: 4542.42 (r/w/o: 2839.01/1135.60/567.80) lat (ms,95%): 237.87 err/s: 0.00 reconn/s: 0.00
    [   5s ] thds: 16 tps: 310.31 qps: 4965.02 (r/w/o: 3103.14/1241.25/620.63) lat (ms,95%): 223.91 err/s: 0.00 reconn/s: 0.00
    [   6s ] thds: 16 tps: 344.22 qps: 5507.49 (r/w/o: 3442.18/1376.87/688.44) lat (ms,95%): 213.01 err/s: 0.00 reconn/s: 0.00
    [   7s ] thds: 16 tps: 380.65 qps: 6090.34 (r/w/o: 3806.46/1522.58/761.29) lat (ms,95%): 194.05 err/s: 0.00 reconn/s: 0.00
    [   8s ] thds: 16 tps: 439.63 qps: 7034.11 (r/w/o: 4396.32/1758.53/879.26) lat (ms,95%): 179.27 err/s: 0.00 reconn/s: 0.00
    [   9s ] thds: 16 tps: 472.62 qps: 7561.95 (r/w/o: 4726.22/1890.49/945.24) lat (ms,95%): 161.66 err/s: 0.00 reconn/s: 0.00
    [  10s ] thds: 16 tps: 535.06 qps: 8560.97 (r/w/o: 5350.61/2140.24/1070.12) lat (ms,95%): 140.52 err/s: 0.00 reconn/s: 0.00
    [  11s ] thds: 16 tps: 578.67 qps: 9258.73 (r/w/o: 5786.71/2314.68/1157.34) lat (ms,95%): 127.29 err/s: 0.00 reconn/s: 0.00
    [  12s ] thds: 16 tps: 602.52 qps: 9640.30 (r/w/o: 6025.19/2410.07/1205.04) lat (ms,95%): 108.84 err/s: 0.00 reconn/s: 0.00
    [  13s ] thds: 16 tps: 662.48 qps: 10599.62 (r/w/o: 6624.76/2649.90/1324.95) lat (ms,95%): 95.25 err/s: 0.00 reconn/s: 0.00
    [  14s ] thds: 16 tps: 660.53 qps: 10568.41 (r/w/o: 6605.26/2642.10/1321.05) lat (ms,95%): 81.71 err/s: 0.00 reconn/s: 0.00
    [  15s ] thds: 16 tps: 719.74 qps: 11515.81 (r/w/o: 7197.38/2878.95/1439.48) lat (ms,95%): 72.24 err/s: 0.00 reconn/s: 0.00
    [  16s ] thds: 16 tps: 742.23 qps: 11875.72 (r/w/o: 7422.32/2968.93/1484.46) lat (ms,95%): 63.07 err/s: 0.00 reconn/s: 0.00
    [  17s ] thds: 16 tps: 750.29 qps: 12004.67 (r/w/o: 7502.92/3001.17/1500.58) lat (ms,95%): 55.64 err/s: 0.00 reconn/s: 0.00
    [  18s ] thds: 16 tps: 759.46 qps: 12151.38 (r/w/o: 7594.61/3037.84/1518.92) lat (ms,95%): 48.20 err/s: 0.00 reconn/s: 0.00
    [  19s ] thds: 16 tps: 793.76 qps: 12700.22 (r/w/o: 7937.64/3175.06/1587.53) lat (ms,95%): 43.00 err/s: 0.00 reconn/s: 0.00
    [  20s ] thds: 16 tps: 806.28 qps: 12900.48 (r/w/o: 8062.80/3225.12/1612.56) lat (ms,95%): 38.63 err/s: 0.00 reconn/s: 0.00
    [  21s ] thds: 16 tps: 807.58 qps: 12921.27 (r/w/o: 8075.79/3230.32/1615.16) lat (ms,95%): 34.45 err/s: 0.00 reconn/s: 0.00
    [  22s ] thds: 16 tps: 791.53 qps: 12664.44 (r/w/o: 7915.27/3166.11/1583.05) lat (ms,95%): 32.08 err/s: 0.00 reconn/s: 0.00
    [  23s ] thds: 16 tps: 789.69 qps: 12635.06 (r/w/o: 7896.91/3158.76/1579.38) lat (ms,95%): 29.86 err/s: 0.00 reconn/s: 0.00
    [  24s ] thds: 16 tps: 794.92 qps: 12718.79 (r/w/o: 7949.24/3179.70/1589.85) lat (ms,95%): 28.22 err/s: 0.00 reconn/s: 0.00
    [  25s ] thds: 16 tps: 824.47 qps: 13191.51 (r/w/o: 8244.69/3297.88/1648.94) lat (ms,95%): 26.98 err/s: 0.00 reconn/s: 0.00
  3. Return to the PolarDB console and view the Serverless Monitoring Metrics on the Performance Monitoring page. Set the time range to the last 5 minutes. You can see the following monitoring information:

    The number of PCUs scales up from 1 to 4 and then stabilizes. During this process, CPU utilization gradually decreases as more resources are provisioned. The memory utilization curve shows a pulse-like pattern at each scaling event. This occurs because when PCUs are added, the memory capacity expands, causing a momentary drop in memory utilization. The database then uses the expanded memory (for example, shared buffers) to improve its computing capabilities, causing memory utilization to gradually increase until it reaches a stable state.

    image.png

  4. Stop the load test command and wait for 5 minutes. Then, change the time range to the last 10 minutes to view the following monitoring information:

    After the load stops, the number of PCUs gradually scales down from 4 to 1. Because the read/write mixed test includes UPDATE requests, PolarDB continues to perform vacuum operations, which consumes a small amount of CPU resources before the node returns to its idle state.

    image.png

In-depth validation: High load (128 threads)

Next, set the number of threads (the --threads parameter) to 128 to observe how long it takes for the PolarDB Serverless cluster to scale up to its maximum specification of 32 PCU. Run the load test long enough for the cluster to stabilize, and then stop it to observe the scale-down process.

  1. Run the following load test command. Set the --threads parameter to 128 and adjust the other parameters based on your configuration. For more information, see the parameter descriptions.

    sysbench /usr/share/sysbench/oltp_read_write.lua --pgsql-host=<host> --pgsql-port=<port> --pgsql-user=<user> --pgsql-password=<password> --pgsql-db=<database> --tables=32 --table-size=100000 --report-interval=1 --range_selects=1 --db-ps-mode=disable --rand-type=uniform --threads=128 --db-driver=pgsql --time=12000 run
  2. The results show a clear trend: as the cluster scales, throughput (TPS) increases while latency decreases.

    [   1s ] thds: 128 tps: 499.33 qps: 7989.27 (r/w/o: 4993.30/1997.32/998.66) lat (ms,95%): 299.20 err/s: 0.00 reconn/s: 0.00
    [   2s ] thds: 128 tps: 506.53 qps: 8104.48 (r/w/o: 5065.30/2026.12/1013.06) lat (ms,95%): 307.36 err/s: 0.00 reconn/s: 0.00
    [   3s ] thds: 128 tps: 529.89 qps: 8478.18 (r/w/o: 5298.86/2119.54/1059.77) lat (ms,95%): 302.71 err/s: 0.00 reconn/s: 0.00
    [   4s ] thds: 128 tps: 527.26 qps: 8436.16 (r/w/o: 5272.60/2109.04/1054.52) lat (ms,95%): 303.39 err/s: 0.00 reconn/s: 0.00
    [   5s ] thds: 128 tps: 540.63 qps: 8650.11 (r/w/o: 5406.32/2162.53/1081.26) lat (ms,95%): 298.35 err/s: 0.00 reconn/s: 0.00
    [   6s ] thds: 128 tps: 583.70 qps: 9339.16 (r/w/o: 5836.97/2334.79/1167.39) lat (ms,95%): 300.56 err/s: 0.00 reconn/s: 0.00
    [   7s ] thds: 128 tps: 585.79 qps: 9372.66 (r/w/o: 5857.92/2343.17/1171.58) lat (ms,95%): 300.08 err/s: 0.00 reconn/s: 0.00
    [   8s ] thds: 128 tps: 614.56 qps: 9832.92 (r/w/o: 6145.58/2458.23/1229.12) lat (ms,95%): 300.05 err/s: 0.00 reconn/s: 0.00
    [   9s ] thds: 128 tps: 612.19 qps: 9795.00 (r/w/o: 6121.88/2448.75/1224.38) lat (ms,95%): 290.03 err/s: 0.00 reconn/s: 0.00
    [  10s ] thds: 128 tps: 637.21 qps: 10195.42 (r/w/o: 6372.14/2548.86/1274.43) lat (ms,95%): 291.50 err/s: 0.00 reconn/s: 0.00
    [  11s ] thds: 128 tps: 656.87 qps: 10509.92 (r/w/o: 6568.70/2627.48/1313.74) lat (ms,95%): 297.98 err/s: 0.00 reconn/s: 0.00
    [  12s ] thds: 128 tps: 710.50 qps: 11368.01 (r/w/o: 7105.01/2842.00/1421.00) lat (ms,95%): 289.05 err/s: 0.00 reconn/s: 0.00
    [  13s ] thds: 128 tps: 730.32 qps: 11685.11 (r/w/o: 7303.19/2921.28/1460.64) lat (ms,95%): 288.27 err/s: 0.00 reconn/s: 0.00
    [  14s ] thds: 128 tps: 773.70 qps: 12379.23 (r/w/o: 7737.02/3094.81/1547.40) lat (ms,95%): 287.12 err/s: 0.00 reconn/s: 0.00
    [  15s ] thds: 128 tps: 777.93 qps: 12446.87 (r/w/o: 7779.30/3111.72/1555.86) lat (ms,95%): 282.65 err/s: 0.00 reconn/s: 0.00
    [  16s ] thds: 128 tps: 829.21 qps: 13267.43 (r/w/o: 8292.15/3316.86/1658.43) lat (ms,95%): 280.62 err/s: 0.00 reconn/s: 0.00
    [  17s ] thds: 128 tps: 870.85 qps: 13933.65 (r/w/o: 8708.53/3483.41/1741.71) lat (ms,95%): 285.36 err/s: 0.00 reconn/s: 0.00
    [  18s ] thds: 128 tps: 904.61 qps: 14473.81 (r/w/o: 9046.13/3618.45/1809.23) lat (ms,95%): 275.14 err/s: 0.00 reconn/s: 0.00
    [  19s ] thds: 128 tps: 985.90 qps: 15774.36 (r/w/o: 9858.98/3943.59/1971.80) lat (ms,95%): 275.53 err/s: 0.00 reconn/s: 0.00
    [  20s ] thds: 128 tps: 983.53 qps: 15736.55 (r/w/o: 9835.35/3934.14/1967.07) lat (ms,95%): 267.43 err/s: 0.00 reconn/s: 0.00
    [  21s ] thds: 128 tps: 1038.28 qps: 16612.42 (r/w/o: 10382.76/4153.11/2076.55) lat (ms,95%): 270.44 err/s: 0.00 reconn/s: 0.00
    [  22s ] thds: 128 tps: 1141.83 qps: 18269.33 (r/w/o: 11418.33/4567.33/2283.67) lat (ms,95%): 264.70 err/s: 0.00 reconn/s: 0.00
    [  23s ] thds: 128 tps: 1154.36 qps: 18469.71 (r/w/o: 11543.57/4617.43/2308.71) lat (ms,95%): 260.48 err/s: 0.00 reconn/s: 0.00
    [  24s ] thds: 128 tps: 1290.30 qps: 20644.80 (r/w/o: 12903.00/5161.20/2580.60) lat (ms,95%): 257.96 err/s: 0.00 reconn/s: 0.00
    [  25s ] thds: 128 tps: 1362.52 qps: 21800.29 (r/w/o: 13625.18/5450.07/2725.04) lat (ms,95%): 256.99 err/s: 0.00 reconn/s: 0.00
    [  26s ] thds: 128 tps: 1360.57 qps: 21769.10 (r/w/o: 13605.69/5442.28/2721.14) lat (ms,95%): 250.92 err/s: 0.00 reconn/s: 0.00
    [  27s ] thds: 128 tps: 1498.95 qps: 23983.21 (r/w/o: 14989.51/5995.80/2997.90) lat (ms,95%): 244.21 err/s: 0.00 reconn/s: 0.00
    [  28s ] thds: 128 tps: 1546.49 qps: 24743.87 (r/w/o: 15464.92/6185.97/3092.98) lat (ms,95%): 240.05 err/s: 0.00 reconn/s: 0.00
    [  29s ] thds: 128 tps: 1619.87 qps: 25917.98 (r/w/o: 16198.74/6479.50/3239.75) lat (ms,95%): 232.68 err/s: 0.00 reconn/s: 0.00
    [  30s ] thds: 128 tps: 1748.07 qps: 27969.11 (r/w/o: 17480.70/6992.28/3496.14) lat (ms,95%): 231.75 err/s: 0.00 reconn/s: 0.00
    [  31s ] thds: 128 tps: 1893.22 qps: 30291.57 (r/w/o: 18932.23/7572.89/3786.45) lat (ms,95%): 219.60 err/s: 0.00 reconn/s: 0.00
    [  32s ] thds: 128 tps: 1953.95 qps: 31263.22 (r/w/o: 19539.51/7815.81/3907.90) lat (ms,95%): 212.77 err/s: 0.00 reconn/s: 0.00
    [  33s ] thds: 128 tps: 2110.86 qps: 33773.82 (r/w/o: 21108.64/8443.45/4221.73) lat (ms,95%): 212.28 err/s: 0.00 reconn/s: 0.00
    [  34s ] thds: 128 tps: 2142.82 qps: 34285.18 (r/w/o: 21428.24/8571.29/4285.65) lat (ms,95%): 203.74 err/s: 0.00 reconn/s: 0.00
    [  35s ] thds: 128 tps: 2295.94 qps: 36735.05 (r/w/o: 22959.41/9183.76/4591.88) lat (ms,95%): 193.17 err/s: 0.00 reconn/s: 0.00
    [  36s ] thds: 128 tps: 2433.04 qps: 38928.63 (r/w/o: 24330.39/9732.16/4866.08) lat (ms,95%): 189.32 err/s: 0.00 reconn/s: 0.00
    [  37s ] thds: 128 tps: 2553.38 qps: 40854.06 (r/w/o: 25533.79/10213.51/5106.76) lat (ms,95%): 182.26 err/s: 0.00 reconn/s: 0.00
    [  38s ] thds: 128 tps: 2549.95 qps: 40799.26 (r/w/o: 25499.54/10199.82/5099.91) lat (ms,95%): 173.76 err/s: 0.00 reconn/s: 0.00
    [  39s ] thds: 128 tps: 2667.54 qps: 42680.64 (r/w/o: 26675.40/10670.16/5335.08) lat (ms,95%): 170.78 err/s: 0.00 reconn/s: 0.00
    [  40s ] thds: 128 tps: 2929.93 qps: 46878.81 (r/w/o: 29299.25/11719.70/5859.85) lat (ms,95%): 162.94 err/s: 0.00 reconn/s: 0.00
    [  41s ] thds: 128 tps: 2947.98 qps: 47167.64 (r/w/o: 29479.77/11791.91/5895.95) lat (ms,95%): 151.02 err/s: 0.00 reconn/s: 0.00
    [  42s ] thds: 128 tps: 3169.22 qps: 50707.58 (r/w/o: 31692.24/12676.89/6338.45) lat (ms,95%): 149.36 err/s: 0.00 reconn/s: 0.00
    [  43s ] thds: 128 tps: 3133.92 qps: 50142.71 (r/w/o: 31339.20/12535.68/6267.84) lat (ms,95%): 139.75 err/s: 0.00 reconn/s: 0.00
    [  44s ] thds: 128 tps: 3240.55 qps: 51848.86 (r/w/o: 32405.54/12962.21/6481.11) lat (ms,95%): 134.45 err/s: 0.00 reconn/s: 0.00
    [  45s ] thds: 128 tps: 3491.42 qps: 55862.72 (r/w/o: 34914.20/13965.68/6982.84) lat (ms,95%): 124.56 err/s: 0.00 reconn/s: 0.00
    [  46s ] thds: 128 tps: 3538.34 qps: 56613.38 (r/w/o: 35383.36/14153.35/7076.67) lat (ms,95%): 120.25 err/s: 0.00 reconn/s: 0.00
    [  47s ] thds: 128 tps: 3595.70 qps: 57531.17 (r/w/o: 35956.98/14382.79/7191.40) lat (ms,95%): 115.49 err/s: 0.00 reconn/s: 0.00
    [  48s ] thds: 128 tps: 3729.56 qps: 59672.91 (r/w/o: 37295.57/14918.23/7459.11) lat (ms,95%): 106.56 err/s: 0.00 reconn/s: 0.00
    [  49s ] thds: 128 tps: 3851.56 qps: 61625.02 (r/w/o: 38515.64/15406.26/7703.13) lat (ms,95%): 102.99 err/s: 0.00 reconn/s: 0.00
    [  50s ] thds: 128 tps: 3863.37 qps: 61813.92 (r/w/o: 38633.70/15453.48/7726.74) lat (ms,95%): 95.83 err/s: 0.00 reconn/s: 0.00
    [  51s ] thds: 128 tps: 4140.36 qps: 66245.75 (r/w/o: 41403.59/16561.44/8280.72) lat (ms,95%): 91.88 err/s: 0.00 reconn/s: 0.00
    [  52s ] thds: 128 tps: 4088.15 qps: 65410.47 (r/w/o: 40881.54/16352.62/8176.31) lat (ms,95%): 86.44 err/s: 0.00 reconn/s: 0.00
    [  53s ] thds: 128 tps: 4086.26 qps: 65380.19 (r/w/o: 40862.62/16345.05/8172.52) lat (ms,95%): 80.79 err/s: 0.00 reconn/s: 0.00
    [  54s ] thds: 128 tps: 4213.43 qps: 67414.83 (r/w/o: 42134.27/16853.71/8426.85) lat (ms,95%): 77.55 err/s: 0.00 reconn/s: 0.00
    [  55s ] thds: 128 tps: 4253.68 qps: 68058.86 (r/w/o: 42536.78/17014.71/8507.36) lat (ms,95%): 72.32 err/s: 0.00 reconn/s: 0.00
    [  56s ] thds: 128 tps: 4275.27 qps: 68404.32 (r/w/o: 42752.70/17101.08/8550.54) lat (ms,95%): 69.62 err/s: 0.00 reconn/s: 0.00
    [  57s ] thds: 128 tps: 4376.13 qps: 70018.00 (r/w/o: 43761.25/17504.50/8752.25) lat (ms,95%): 66.70 err/s: 0.00 reconn/s: 0.00
    [  58s ] thds: 128 tps: 4601.78 qps: 73628.47 (r/w/o: 46017.79/18407.12/9203.56) lat (ms,95%): 61.20 err/s: 0.00 reconn/s: 0.00
    [  59s ] thds: 128 tps: 4485.07 qps: 71761.18 (r/w/o: 44850.73/17940.29/8970.15) lat (ms,95%): 59.53 err/s: 0.00 reconn/s: 0.00
    [  60s ] thds: 128 tps: 4526.07 qps: 72417.05 (r/w/o: 45260.66/18104.26/9052.13) lat (ms,95%): 55.40 err/s: 0.00 reconn/s: 0.00
    [  61s ] thds: 128 tps: 4771.22 qps: 76339.57 (r/w/o: 47712.23/19084.89/9542.45) lat (ms,95%): 53.70 err/s: 0.00 reconn/s: 0.00
    [  62s ] thds: 128 tps: 4683.30 qps: 74932.84 (r/w/o: 46833.02/18733.21/9366.60) lat (ms,95%): 51.65 err/s: 0.00 reconn/s: 0.00
    [  63s ] thds: 128 tps: 4816.29 qps: 77060.59 (r/w/o: 48162.87/19265.15/9632.57) lat (ms,95%): 48.17 err/s: 0.00 reconn/s: 0.00
    [  64s ] thds: 128 tps: 4648.83 qps: 74381.29 (r/w/o: 46488.31/18595.32/9297.66) lat (ms,95%): 46.55 err/s: 0.00 reconn/s: 0.00
    [  65s ] thds: 128 tps: 4774.22 qps: 76387.55 (r/w/o: 47742.22/19096.89/9548.44) lat (ms,95%): 44.68 err/s: 0.00 reconn/s: 0.00
    [  66s ] thds: 128 tps: 4892.06 qps: 78272.96 (r/w/o: 48920.60/19568.24/9784.12) lat (ms,95%): 43.27 err/s: 0.00 reconn/s: 0.00
    [  67s ] thds: 128 tps: 4993.76 qps: 79900.15 (r/w/o: 49937.59/19975.04/9987.52) lat (ms,95%): 40.68 err/s: 0.00 reconn/s: 0.00
    [  68s ] thds: 128 tps: 4849.05 qps: 77584.86 (r/w/o: 48490.54/19396.22/9698.11) lat (ms,95%): 39.60 err/s: 0.00 reconn/s: 0.00
    [  69s ] thds: 128 tps: 5006.54 qps: 80104.57 (r/w/o: 50065.36/20026.14/10013.07) lat (ms,95%): 38.11 err/s: 0.00 reconn/s: 0.00
    [  70s ] thds: 128 tps: 4829.42 qps: 77270.78 (r/w/o: 48294.24/19317.70/9658.85) lat (ms,95%): 37.17 err/s: 0.00 reconn/s: 0.00
    [  71s ] thds: 128 tps: 4916.62 qps: 78665.99 (r/w/o: 49166.24/19666.50/9833.25) lat (ms,95%): 35.79 err/s: 0.00 reconn/s: 0.00
    [  72s ] thds: 128 tps: 4882.59 qps: 78121.45 (r/w/o: 48825.91/19530.36/9765.18) lat (ms,95%): 35.67 err/s: 0.00 reconn/s: 0.00
    [  73s ] thds: 128 tps: 4955.74 qps: 79291.77 (r/w/o: 49557.35/19822.94/9911.47) lat (ms,95%): 34.63 err/s: 0.00 reconn/s: 0.00
    [  74s ] thds: 128 tps: 5002.06 qps: 80032.97 (r/w/o: 50020.61/20008.24/10004.12) lat (ms,95%): 32.68 err/s: 0.00 reconn/s: 0.00
    [  75s ] thds: 128 tps: 5149.80 qps: 82396.85 (r/w/o: 51498.03/20599.21/10299.61) lat (ms,95%): 32.93 err/s: 0.00 reconn/s: 0.00
    [  76s ] thds: 128 tps: 5152.89 qps: 82446.27 (r/w/o: 51528.92/20611.57/10305.78) lat (ms,95%): 32.33 err/s: 0.00 reconn/s: 0.00
    [  77s ] thds: 128 tps: 5127.71 qps: 82043.33 (r/w/o: 51277.08/20510.83/10255.42) lat (ms,95%): 30.72 err/s: 0.00 reconn/s: 0.00
    [  78s ] thds: 128 tps: 5028.08 qps: 80449.22 (r/w/o: 50280.76/20112.30/10056.15) lat (ms,95%): 30.20 err/s: 0.00 reconn/s: 0.00
    [  79s ] thds: 128 tps: 5011.37 qps: 80181.90 (r/w/o: 50113.69/20045.47/10022.74) lat (ms,95%): 29.48 err/s: 0.00 reconn/s: 0.00
    [  80s ] thds: 128 tps: 5012.71 qps: 80203.34 (r/w/o: 50127.09/20050.84/10025.42) lat (ms,95%): 30.10 err/s: 0.00 reconn/s: 0.00
    [  81s ] thds: 128 tps: 4985.47 qps: 79767.47 (r/w/o: 49854.67/19941.87/9970.93) lat (ms,95%): 29.42 err/s: 0.00 reconn/s: 0.00
    [  82s ] thds: 128 tps: 5049.69 qps: 80795.02 (r/w/o: 50496.89/20198.75/10099.38) lat (ms,95%): 28.60 err/s: 0.00 reconn/s: 0.00
    [  83s ] thds: 128 tps: 5208.49 qps: 83335.87 (r/w/o: 52084.92/20833.97/10416.98) lat (ms,95%): 28.89 err/s: 0.00 reconn/s: 0.00
    [  84s ] thds: 128 tps: 5091.85 qps: 81469.57 (r/w/o: 50918.48/20367.39/10183.70) lat (ms,95%): 28.24 err/s: 0.00 reconn/s: 0.00
    [  85s ] thds: 128 tps: 4974.62 qps: 79593.88 (r/w/o: 49746.17/19898.47/9949.23) lat (ms,95%): 27.47 err/s: 0.00 reconn/s: 0.00
    [  86s ] thds: 128 tps: 5227.32 qps: 83637.08 (r/w/o: 52273.18/20909.27/10454.64) lat (ms,95%): 27.52 err/s: 0.00 reconn/s: 0.00
    [  87s ] thds: 128 tps: 5101.30 qps: 81620.74 (r/w/o: 51012.96/20405.18/10202.59) lat (ms,95%): 27.45 err/s: 0.00 reconn/s: 0.00
  3. Go to the PolarDB console and view the Serverless Monitoring Metrics on the Performance Monitoring page. Adjust the time range to match the test duration. You can see the following monitoring information:

    Scaling up from 1 PCU to 32 PCU takes approximately 87 seconds. Scale-down is more gradual than scale-up, taking approximately 231 seconds.

    image

Multi-node horizontal scaling (scale-out)

This test uses Sysbench to verify that the cluster automatically scales out by adding read-only nodes based on the workload.

Adjust Serverless configuration

To verify multi-node scaling, you must ensure that read-only nodes can be automatically provisioned during the load test. Go to the PolarDB console. On the cluster details page, in the Database Nodes section, adjust the Serverless configuration. Set Maximum Resources for Single Node to 32, Minimum Resources for Single Node to 1, Maximum Read-only Nodes to 7, and Minimum Read-only Nodes to 0.

Validation

Run a test with 160 threads to understand the horizontal scalability of Serverless.

  1. Run the following load test command. Set the --threads parameter to 160 and adjust the other parameters based on your configuration. For more information, see the parameter descriptions.

    sysbench /usr/share/sysbench/oltp_read_write.lua --pgsql-host=<host> --pgsql-port=<port> --pgsql-user=<user> --pgsql-password=<password> --pgsql-db=<database> --tables=32 --table-size=100000 --report-interval=1 --range_selects=1 --db-ps-mode=disable --rand-type=uniform --threads=160 --db-driver=pgsql --time=12000 run
  2. After a short time, the system begins to scale out by adding new read-only nodes.

    In the Database Nodes section, the new read-only nodes appear with a status of Running and a specification of 1 to 32 PCU.

  3. After the system reaches a stable state, the test results are as follows. Compared to the single-node test, which stabilized at approximately 255,000 QPS, the multi-node cluster achieves a higher throughput of approximately 270,000 QPS. This QPS performance exceeds the maximum throughput achieved in the single-node vertical scaling test.

    [ 131s ] thds: 128 tps: 16823.87 qps: 269181.86 (r/w/o: 168238.66/67295.46/33647.73) lat (ms,95%): 13.51 err/s: 0.00 reconn/s: 0.00
    [ 132s ] thds: 128 tps: 17002.14 qps: 272034.24 (r/w/o: 170021.40/68008.56/34004.28) lat (ms,95%): 13.67 err/s: 0.00 reconn/s: 0.00
    [ 133s ] thds: 128 tps: 16863.97 qps: 269823.57 (r/w/o: 168639.73/67455.89/33727.95) lat (ms,95%): 13.74 err/s: 0.00 reconn/s: 0.00
    [ 134s ] thds: 128 tps: 16833.04 qps: 269328.71 (r/w/o: 168330.45/67332.18/33666.09) lat (ms,95%): 13.27 err/s: 0.00 reconn/s: 0.00
    [ 135s ] thds: 128 tps: 17039.01 qps: 272624.22 (r/w/o: 170390.14/68156.06/34078.03) lat (ms,95%): 13.57 err/s: 0.00 reconn/s: 0.00
    [ 136s ] thds: 128 tps: 16895.08 qps: 270321.30 (r/w/o: 168950.82/67580.33/33790.16) lat (ms,95%): 13.23 err/s: 0.00 reconn/s: 0.00
    [ 137s ] thds: 128 tps: 17157.11 qps: 274513.84 (r/w/o: 171571.15/68628.46/34314.23) lat (ms,95%): 13.31 err/s: 0.00 reconn/s: 0.00
    [ 138s ] thds: 128 tps: 17038.81 qps: 272620.92 (r/w/o: 170388.08/68155.23/34077.62) lat (ms,95%): 13.53 err/s: 0.00 reconn/s: 0.00
    [ 139s ] thds: 128 tps: 16968.69 qps: 271499.04 (r/w/o: 169686.90/67874.76/33937.38) lat (ms,95%): 13.51 err/s: 0.00 reconn/s: 0.00
    [ 140s ] thds: 128 tps: 17010.11 qps: 272161.81 (r/w/o: 170101.13/68040.45/34020.23) lat (ms,95%): 13.72 err/s: 0.00 reconn/s: 0.00

    Horizontal scaling baseline (single node):

    [   1s ] thds: 160 tps: 737.10 qps: 11793.66 (r/w/o: 7371.04/2948.42/1474.21) lat (ms,95%): 824.40 err/s: 0.00 reconn/s: 0.00
    [   2s ] thds: 160 tps: 772.67 qps: 12362.70 (r/w/o: 7726.69/3090.68/1545.34) lat (ms,95%): 812.11 err/s: 0.00 reconn/s: 0.00
    [   3s ] thds: 160 tps: 831.46 qps: 13303.43 (r/w/o: 8314.64/3325.86/1662.93) lat (ms,95%): 807.01 err/s: 0.00 reconn/s: 0.00
    [   4s ] thds: 160 tps: 855.24 qps: 13683.77 (r/w/o: 8552.36/3420.94/1710.47) lat (ms,95%): 819.49 err/s: 0.00 reconn/s: 0.00
    [   5s ] thds: 160 tps: 887.33 qps: 14197.31 (r/w/o: 8873.32/3549.33/1774.66) lat (ms,95%): 807.55 err/s: 0.00 reconn/s: 0.00
    [   6s ] thds: 160 tps: 989.86 qps: 15837.68 (r/w/o: 9898.55/3959.42/1979.71) lat (ms,95%): 822.25 err/s: 0.00 reconn/s: 0.00
    [   7s ] thds: 160 tps: 990.42 qps: 15846.73 (r/w/o: 9904.21/3961.68/1980.84) lat (ms,95%): 794.12 err/s: 0.00 reconn/s: 0.00
    [   8s ] thds: 160 tps: 1061.96 qps: 16991.28 (r/w/o: 10619.55/4247.82/2123.91) lat (ms,95%): 814.02 err/s: 0.00 reconn/s: 0.00
    [   9s ] thds: 160 tps: 1169.76 qps: 18716.18 (r/w/o: 11697.61/4679.04/2339.52) lat (ms,95%): 808.74 err/s: 0.00 reconn/s: 0.00
    [  10s ] thds: 160 tps: 1206.91 qps: 19310.56 (r/w/o: 12069.10/4827.64/2413.82) lat (ms,95%): 781.97 err/s: 0.00 reconn/s: 0.00
    [  11s ] thds: 160 tps: 1322.03 qps: 21152.40 (r/w/o: 13220.25/5288.10/2644.05) lat (ms,95%): 795.06 err/s: 0.00 reconn/s: 0.00
    [  12s ] thds: 160 tps: 1392.36 qps: 22277.81 (r/w/o: 13923.63/5569.45/2784.73) lat (ms,95%): 799.34 err/s: 0.00 reconn/s: 0.00
    [  13s ] thds: 160 tps: 1491.74 qps: 23867.81 (r/w/o: 14917.38/5966.95/2983.48) lat (ms,95%): 763.73 err/s: 0.00 reconn/s: 0.00
    [  14s ] thds: 160 tps: 1611.73 qps: 25787.67 (r/w/o: 16117.29/6446.92/3223.46) lat (ms,95%): 767.41 err/s: 0.00 reconn/s: 0.00
    [  15s ] thds: 160 tps: 1710.99 qps: 27375.84 (r/w/o: 17109.90/6843.96/3421.98) lat (ms,95%): 781.17 err/s: 0.00 reconn/s: 0.00
    [  16s ] thds: 160 tps: 1777.08 qps: 28433.29 (r/w/o: 17770.81/7108.32/3554.16) lat (ms,95%): 749.54 err/s: 0.00 reconn/s: 0.00
    [  17s ] thds: 160 tps: 1904.02 qps: 30464.26 (r/w/o: 19040.16/7616.07/3808.03) lat (ms,95%): 755.86 err/s: 0.00 reconn/s: 0.00
    [  18s ] thds: 160 tps: 2065.56 qps: 33048.90 (r/w/o: 20655.56/8262.22/4131.11) lat (ms,95%): 749.80 err/s: 0.00 reconn/s: 0.00
    [  19s ] thds: 160 tps: 2279.47 qps: 36471.54 (r/w/o: 22794.71/9117.88/4558.94) lat (ms,95%): 729.72 err/s: 0.00 reconn/s: 0.00
    [  20s ] thds: 160 tps: 2437.89 qps: 39006.25 (r/w/o: 24378.91/9751.56/4875.78) lat (ms,95%): 722.73 err/s: 0.00 reconn/s: 0.00
    [  21s ] thds: 160 tps: 2597.92 qps: 41566.77 (r/w/o: 25979.23/10391.69/5195.85) lat (ms,95%): 731.76 err/s: 0.00 reconn/s: 0.00
    [  22s ] thds: 160 tps: 2852.57 qps: 45641.16 (r/w/o: 28525.72/11410.29/5705.14) lat (ms,95%): 698.27 err/s: 0.00 reconn/s: 0.00
    [  23s ] thds: 160 tps: 2989.61 qps: 47833.79 (r/w/o: 29896.12/11958.45/5979.22) lat (ms,95%): 692.62 err/s: 0.00 reconn/s: 0.00
    [  24s ] thds: 160 tps: 3130.54 qps: 50088.63 (r/w/o: 31305.39/12522.16/6261.08) lat (ms,95%): 694.57 err/s: 0.00 reconn/s: 0.00
    [  25s ] thds: 160 tps: 3493.16 qps: 55890.61 (r/w/o: 34931.63/13972.65/6986.33) lat (ms,95%): 668.18 err/s: 0.00 reconn/s: 0.00
    [  26s ] thds: 160 tps: 3771.42 qps: 60342.65 (r/w/o: 37714.16/15085.66/7542.83) lat (ms,95%): 662.67 err/s: 0.00 reconn/s: 0.00
    [  27s ] thds: 160 tps: 3968.27 qps: 63492.33 (r/w/o: 39682.71/15873.08/7936.54) lat (ms,95%): 634.52 err/s: 0.00 reconn/s: 0.00
    [  28s ] thds: 160 tps: 4159.66 qps: 66554.57 (r/w/o: 41596.61/16638.64/8319.32) lat (ms,95%): 642.03 err/s: 0.00 reconn/s: 0.00
    [  29s ] thds: 160 tps: 4676.66 qps: 74826.57 (r/w/o: 46766.61/18706.64/9353.32) lat (ms,95%): 617.81 err/s: 0.00 reconn/s: 0.00
    [  30s ] thds: 160 tps: 4975.73 qps: 79611.67 (r/w/o: 49757.30/19902.92/9951.46) lat (ms,95%): 602.27 err/s: 0.00 reconn/s: 0.00
    [  31s ] thds: 160 tps: 5093.37 qps: 81493.95 (r/w/o: 50933.72/20373.49/10186.74) lat (ms,95%): 574.49 err/s: 0.00 reconn/s: 0.00
    [  32s ] thds: 160 tps: 5477.72 qps: 87643.58 (r/w/o: 54777.24/21910.89/10955.45) lat (ms,95%): 574.42 err/s: 0.00 reconn/s: 0.00
    [  33s ] thds: 160 tps: 5996.19 qps: 95938.99 (r/w/o: 59961.87/23984.75/11992.37) lat (ms,95%): 554.88 err/s: 0.00 reconn/s: 0.00
    [  34s ] thds: 160 tps: 6401.78 qps: 102428.46 (r/w/o: 64017.79/25607.12/12803.56) lat (ms,95%): 521.90 err/s: 0.00 reconn/s: 0.00
    [  35s ] thds: 160 tps: 6522.43 qps: 104358.88 (r/w/o: 65224.30/26089.72/13044.86) lat (ms,95%): 500.50 err/s: 0.00 reconn/s: 0.00
    [  36s ] thds: 160 tps: 7117.04 qps: 113872.59 (r/w/o: 71170.37/28468.15/14234.07) lat (ms,95%): 496.24 err/s: 0.00 reconn/s: 0.00
    [  37s ] thds: 160 tps: 7341.32 qps: 117461.05 (r/w/o: 73413.16/29365.26/14682.63) lat (ms,95%): 470.83 err/s: 0.00 reconn/s: 0.00
    [  38s ] thds: 160 tps: 7609.25 qps: 121747.97 (r/w/o: 76092.48/30436.99/15218.50) lat (ms,95%): 455.90 err/s: 0.00 reconn/s: 0.00
    [  39s ] thds: 160 tps: 8338.56 qps: 133416.92 (r/w/o: 83385.57/33354.23/16677.11) lat (ms,95%): 435.84 err/s: 0.00 reconn/s: 0.00
    [  40s ] thds: 160 tps: 8709.51 qps: 139352.15 (r/w/o: 87095.09/34838.04/17419.02) lat (ms,95%): 413.40 err/s: 0.00 reconn/s: 0.00
    [  41s ] thds: 160 tps: 8683.61 qps: 138937.69 (r/w/o: 86836.06/34734.42/17367.21) lat (ms,95%): 390.42 err/s: 0.00 reconn/s: 0.00
    [  42s ] thds: 160 tps: 9229.41 qps: 147670.61 (r/w/o: 92294.13/36917.65/18458.83) lat (ms,95%): 372.85 err/s: 0.00 reconn/s: 0.00
    [  43s ] thds: 160 tps: 9878.66 qps: 158058.49 (r/w/o: 98786.55/39514.62/19757.31) lat (ms,95%): 351.62 err/s: 0.00 reconn/s: 0.00
    [  44s ] thds: 160 tps: 10262.83 qps: 164205.27 (r/w/o: 102628.30/41051.32/20525.66) lat (ms,95%): 323.95 err/s: 0.00 reconn/s: 0.00
    [  45s ] thds: 160 tps: 10618.50 qps: 169896.01 (r/w/o: 106185.01/42474.00/21237.00) lat (ms,95%): 303.06 err/s: 0.00 reconn/s: 0.00
    [  46s ] thds: 160 tps: 11032.84 qps: 176525.49 (r/w/o: 110328.43/44131.37/22065.69) lat (ms,95%): 293.45 err/s: 0.00 reconn/s: 0.00
    [  47s ] thds: 160 tps: 10948.33 qps: 175173.35 (r/w/o: 109483.34/43793.34/21896.67) lat (ms,95%): 274.76 err/s: 0.00 reconn/s: 0.00
    [  48s ] thds: 160 tps: 11435.82 qps: 182973.14 (r/w/o: 114358.21/45743.28/22871.64) lat (ms,95%): 252.03 err/s: 0.00 reconn/s: 0.00
    [  49s ] thds: 160 tps: 11987.82 qps: 191805.18 (r/w/o: 119878.24/47951.30/23975.65) lat (ms,95%): 234.80 err/s: 0.00 reconn/s: 0.00
    [  50s ] thds: 160 tps: 11735.70 qps: 187771.18 (r/w/o: 117356.99/46942.79/23471.40) lat (ms,95%): 218.80 err/s: 0.00 reconn/s: 0.00
    [  51s ] thds: 160 tps: 12240.85 qps: 195853.53 (r/w/o: 122408.46/48963.38/24481.69) lat (ms,95%): 209.42 err/s: 0.00 reconn/s: 0.00
    [  52s ] thds: 160 tps: 12994.85 qps: 207917.60 (r/w/o: 129948.50/51979.40/25989.70) lat (ms,95%): 190.38 err/s: 0.00 reconn/s: 0.00
    [  53s ] thds: 160 tps: 13007.68 qps: 208122.90 (r/w/o: 130076.82/52030.73/26015.36) lat (ms,95%): 177.83 err/s: 0.00 reconn/s: 0.00
    [  54s ] thds: 160 tps: 13520.02 qps: 216320.35 (r/w/o: 135200.22/54080.09/27040.04) lat (ms,95%): 166.03 err/s: 0.00 reconn/s: 0.00
    [  55s ] thds: 160 tps: 13720.64 qps: 219530.22 (r/w/o: 137206.38/54882.55/27441.28) lat (ms,95%): 151.46 err/s: 0.00 reconn/s: 0.00
    [  56s ] thds: 160 tps: 13964.78 qps: 223436.51 (r/w/o: 139647.82/55859.13/27929.56) lat (ms,95%): 140.78 err/s: 0.00 reconn/s: 0.00
    [  57s ] thds: 160 tps: 14162.88 qps: 226606.06 (r/w/o: 141628.79/56651.52/28325.76) lat (ms,95%): 130.91 err/s: 0.00 reconn/s: 0.00
    [  58s ] thds: 160 tps: 13637.61 qps: 218201.76 (r/w/o: 136376.10/54550.44/27275.22) lat (ms,95%): 122.09 err/s: 0.00 reconn/s: 0.00
    [  59s ] thds: 160 tps: 14331.77 qps: 229308.30 (r/w/o: 143317.69/57327.08/28663.54) lat (ms,95%): 112.51 err/s: 0.00 reconn/s: 0.00
    [  60s ] thds: 160 tps: 14388.60 qps: 230217.53 (r/w/o: 143885.95/57554.38/28777.19) lat (ms,95%): 105.01 err/s: 0.00 reconn/s: 0.00
    [  61s ] thds: 160 tps: 14345.61 qps: 229529.79 (r/w/o: 143456.12/57382.45/28691.22) lat (ms,95%): 97.50 err/s: 0.00 reconn/s: 0.00
    [  62s ] thds: 160 tps: 14366.84 qps: 229869.40 (r/w/o: 143668.37/57467.35/28733.67) lat (ms,95%): 90.78 err/s: 0.00 reconn/s: 0.00
    [  63s ] thds: 160 tps: 14267.35 qps: 228277.62 (r/w/o: 142673.51/57069.40/28534.70) lat (ms,95%): 84.84 err/s: 0.00 reconn/s: 0.00
    [  64s ] thds: 160 tps: 14856.89 qps: 237710.27 (r/w/o: 148568.92/59427.57/29713.78) lat (ms,95%): 78.02 err/s: 0.00 reconn/s: 0.00
    [  65s ] thds: 160 tps: 15145.66 qps: 242330.59 (r/w/o: 151456.62/60582.65/30291.32) lat (ms,95%): 72.25 err/s: 0.00 reconn/s: 0.00
    [  66s ] thds: 160 tps: 14904.02 qps: 238464.25 (r/w/o: 149040.16/59616.06/29808.03) lat (ms,95%): 65.48 err/s: 0.00 reconn/s: 0.00
    [  67s ] thds: 160 tps: 15264.74 qps: 244235.80 (r/w/o: 152647.37/61058.95/30529.47) lat (ms,95%): 61.51 err/s: 0.00 reconn/s: 0.00
    [  68s ] thds: 160 tps: 15027.90 qps: 240446.33 (r/w/o: 150278.96/60111.58/30055.79) lat (ms,95%): 58.43 err/s: 0.00 reconn/s: 0.00
    [  69s ] thds: 160 tps: 15473.75 qps: 247579.95 (r/w/o: 154737.47/61894.99/30947.49) lat (ms,95%): 53.27 err/s: 0.00 reconn/s: 0.00
    [  70s ] thds: 160 tps: 15165.17 qps: 242642.74 (r/w/o: 151651.71/60660.68/30330.34) lat (ms,95%): 49.92 err/s: 0.00 reconn/s: 0.00
    [  71s ] thds: 160 tps: 15312.89 qps: 245006.26 (r/w/o: 153128.91/61251.56/30625.78) lat (ms,95%): 46.44 err/s: 0.00 reconn/s: 0.00
    [  72s ] thds: 160 tps: 15114.26 qps: 241828.10 (r/w/o: 151142.56/60457.02/30228.51) lat (ms,95%): 43.69 err/s: 0.00 reconn/s: 0.00
    [  73s ] thds: 160 tps: 15921.69 qps: 254746.98 (r/w/o: 159216.86/63686.75/31843.37) lat (ms,95%): 41.40 err/s: 0.00 reconn/s: 0.00
    [  74s ] thds: 160 tps: 15935.10 qps: 254961.58 (r/w/o: 159350.99/63740.39/31870.20) lat (ms,95%): 38.80 err/s: 0.00 reconn/s: 0.00
    [  75s ] thds: 160 tps: 15415.71 qps: 246651.43 (r/w/o: 154157.14/61662.86/30831.43) lat (ms,95%): 36.43 err/s: 0.00 reconn/s: 0.00
    [  76s ] thds: 160 tps: 15172.30 qps: 242756.86 (r/w/o: 151723.04/60689.21/30344.61) lat (ms,95%): 34.01 err/s: 0.00 reconn/s: 0.00
    [  77s ] thds: 160 tps: 15610.77 qps: 249772.32 (r/w/o: 156107.70/62443.08/31221.54) lat (ms,95%): 32.54 err/s: 0.00 reconn/s: 0.00
    [  78s ] thds: 160 tps: 15854.85 qps: 253677.66 (r/w/o: 158548.53/63419.41/31709.71) lat (ms,95%): 30.69 err/s: 0.00 reconn/s: 0.00
    [  79s ] thds: 160 tps: 15683.78 qps: 250940.48 (r/w/o: 156837.80/62735.12/31367.56) lat (ms,95%): 28.86 err/s: 0.00 reconn/s: 0.00
    [  80s ] thds: 160 tps: 15739.70 qps: 251835.21 (r/w/o: 157397.01/62958.80/31479.40) lat (ms,95%): 28.24 err/s: 0.00 reconn/s: 0.00
    [  81s ] thds: 160 tps: 16069.71 qps: 257115.41 (r/w/o: 160697.13/64278.85/32139.43) lat (ms,95%): 26.17 err/s: 0.00 reconn/s: 0.00
    [  82s ] thds: 160 tps: 15417.35 qps: 246677.57 (r/w/o: 154173.48/61669.39/30834.70) lat (ms,95%): 25.38 err/s: 0.00 reconn/s: 0.00
    [  83s ] thds: 160 tps: 15957.45 qps: 255319.23 (r/w/o: 159574.52/63829.81/31914.90) lat (ms,95%): 24.15 err/s: 0.00 reconn/s: 0.00
    [  84s ] thds: 160 tps: 16152.06 qps: 258433.01 (r/w/o: 161520.63/64608.25/32304.13) lat (ms,95%): 23.60 err/s: 0.00 reconn/s: 0.00
    [  85s ] thds: 160 tps: 16030.14 qps: 256482.31 (r/w/o: 160301.45/64120.58/32060.29) lat (ms,95%): 22.25 err/s: 0.00 reconn/s: 0.00
    [  86s ] thds: 160 tps: 15593.84 qps: 249501.47 (r/w/o: 155938.42/62375.37/31187.68) lat (ms,95%): 21.31 err/s: 0.00 reconn/s: 0.00
    [  87s ] thds: 160 tps: 15650.67 qps: 250410.70 (r/w/o: 156506.69/62602.67/31301.34) lat (ms,95%): 20.99 err/s: 0.00 reconn/s: 0.00
  4. Go to the PolarDB console and view the Serverless Monitoring Metrics on the Performance Monitoring page. Adjust the time range to match the test duration. You can see the following monitoring information:

    In the Serverless monitoring metrics, you can observe the load curves for the newly added read-only nodes. After a read-only node is provisioned, the load on the existing nodes gradually decreases until the cluster reaches a roughly balanced state.

    d9cf74e5f83e7010f6d74cc94c57d541

  5. After running for a period, stop the load test. Adjust the time range based on your test window to see the following monitoring information:

    The cluster's compute resources first scale down automatically, typically dropping to 1 PCU within 2 to 3 minutes. When the load stops, the CPU utilization of the read-only nodes drops immediately. However, the primary node still needs to perform vacuum operations, so its CPU consumption remains elevated for a short period before returning to 1 PCU.

    After some time, newly added read-only nodes are gradually reclaimed within 15 to 20 minutes. To avoid frequent scaling fluctuations, Serverless does not immediately reclaim read-only nodes with no load.

    image.png