This topic describes how to experience the ultimate elasticity of the PolarDB for PostgreSQL serverless feature for free.
Background
The cloud-native database PolarDB for PostgreSQL Serverless provides dynamic resource scaling. It uses a multi-node architecture to ensure high availability (HA) for clusters. It supports a wide auto-scaling range and second-level rapid scaling. This allows it to handle sudden spikes in business load without affecting your services.
The following figure shows the resource usage and specification changes for standard clusters and serverless clusters in a scenario with fluctuating business loads.

As shown in the preceding figure, in a scenario with fluctuating business loads:
Standard clusters: In off-peak periods, many resources are wasted. During peak periods, resources are insufficient, which leads to service degradation.
Serverless clusters:
Because their specifications adjust to business demands in real time, very few resources are wasted. This improves resource utilization and reduces resource consumption.
They can also fully meet business demands during peak periods. This ensures service continuity and improves system stability.
They break the fixed-resource payment model, enabling a true pay-as-you-go model where resources dynamically match the load. This saves significant costs.
They eliminate the need for manual scaling. This improves operations and maintenance (O&M) efficiency and the experience for operations management and development staff.
They are optimized for high-throughput write scenarios and high-concurrency business scenarios. Their elastic scaling capabilities also make them suitable for scenarios with large data volumes and typical peaks and troughs in business traffic.
Alibaba Cloud provides a performance and cost-effectiveness experience center for database solutions. This center simulates a scenario where a client sends write requests to PolarDB, allowing you to experience the intelligent elasticity of the primary node's serverless feature. In this simulation, a Sysbench script runs stress tests by accessing the cluster endpoint. The specifications of the PolarDB primary node automatically scale based on the load, demonstrating its serverless capabilities.
You can experience the ultimate elasticity of the PolarDB for PostgreSQL serverless feature online without purchasing any resources.
Impact
This performance and cost-effectiveness trial does not involve deployment in a production environment. Therefore, it will not affect your business.
Fees
The resources used in this trial are not associated with your account, so no fees are incurred. You can proceed with the trial without any cost.
Experience content
Experience environment
In this free trial, Alibaba Cloud provides a pre-configured environment for you to use. The details of the pre-configured environment are as follows:
A PolarDB for PostgreSQL serverless cluster is provided. The details are as follows:
Kernel version: 2.0.14.18.0
Single-node scaling range: 1 PCU to 10 PCU
Storage class: AutoPL
A stress testing machine with the Sysbench stress testing tool installed is provided. This machine runs stress testing tasks on the PolarDB for PostgreSQL serverless cluster. The stress test details are as follows:
Test modes:
oltp_read_write,oltp_read_only,oltp_write_only,oltp_delete,oltp_update_index, andoltp_update_non_index.Test mode
Description
oltp_read_writeTests the read and write performance of the primary node.
oltp_read_onlyTests the read-only performance of the primary node.
oltp_write_onlyTests the write performance of the primary node.
oltp_deleteTests the delete performance of the primary node.
oltp_update_indexTests the performance of updating indexed fields on the primary node.
oltp_update_non_indexTests the performance of updating non-indexed fields on the primary node.
NoteThis topic uses the
oltp_write_onlymode as an example.Stress test data table size: 16 tables, with 500,000 data records in each table
Stress test pace: The test starts with 4 concurrent threads. The number of threads increases by 4 every 30 seconds until it reaches 32. After reaching 32 threads, the number decreases by 4 every 30 seconds until it returns to 4. The test then continues with 4 threads until it ends.
Stress test duration: 10 minutes in total
Metrics to observe
TPS (Transactions Per Second): The number of transactions that the database executes per second, based on the number of successful COMMIT operations. This metric can be used to observe cluster performance.
Number of PCUs: The compute nodes of a PolarDB serverless cluster are measured in PolarDB Capacity Units (PCUs). One PCU is approximately equal to 1 vCPU and 2 GB of memory. 0.5 PCU is approximately equal to 0.5 vCPU and 1 GB of memory.
Procedure
Go to the Yaochi Solutions Center.
Click Performance & Cost-Effectiveness Experience Center, and then click the Free Trial button for Serverless Elasticity & Cost-Effectiveness Observation. The following page appears:
In the stress testing options, set Stress Test Product to PolarDB PostgreSQL and Stress Test Tool to Sysbench.
Click the Create Free Trial Task button at the bottom of the page.
Select a Test Mode, and then click OK in the dialog box that appears to create the Sysbench stress testing task.
NoteThe following steps use the
oltp_write_onlymode as an example.Wait a moment, and then click
to refresh the task list. You can see that the stress testing task you created has started.NoteThe stress testing task lasts for ten minutes. Complete the following steps before the Estimated End Time.
Click View Details to go to the real-time stress test status page.
As the stress test progresses, the Overall Cluster Performance (measured in TPS) and the Number of PCUs for the Primary Node change.
As the number of concurrent threads in the stress test increases, the CPU utilization of the primary node rises, which triggers an increase in the primary node's PCUs. The number of PCUs scales up in seconds and gradually increases to 8 PCU as the load grows.
The cluster's TPS also increases as the number of PCUs grows. This shows that the processing power of PolarDB is enhanced by the elasticity of the serverless feature.
When the number of concurrent threads starts to decrease, the cluster load drops. The number of PCUs for the primary node remains stable for a brief observation period and then automatically scales down in increments of 0.5 PCU.

(Optional) To view trial results, go to the Serverless Elasticity & Cost-Effectiveness Observation page and click Trial Records. In the panel that appears, click All Tasks or My Tasks to view the details.