PolarDB PostgreSQL cluster performance test

更新时间:
复制 MD 格式

This page shows TPS (Transactions Per Second) results comparing the cluster endpoint against the primary node endpoint for PolarDB for PostgreSQL, using a read-only OLTP workload.

For test steps, see Performance testing method (OLTP).

How it works

The cluster endpoint improves read throughput in two ways:

  • Read/write splitting: Write requests go to the primary node. Read requests are distributed across the primary and read-only nodes based on each node's current load, measured by the number of active (unfinished) requests.

  • Transaction splitting: Read requests inside a transaction are routed to read-only nodes while maintaining read-write consistency. For details, see Transaction splitting.

Prerequisites

Before you begin, ensure that you have:

  • A PolarDB PostgreSQL cluster with one primary node and at least one read-only node

  • The cluster endpoint (not the primary node endpoint)

  • Transaction splitting enabled on the cluster endpoint

Test environment

This test uses PolarDB PostgreSQL 16. All settings are identical across both endpoint types except the connection endpoint.

SettingValue
vCPUs + memory8 vCPUs, 64 GB
PostgreSQL version16.10
Disk performance levelPSL5
Nodes1 primary node + 1 read-only node
Connection endpointCluster endpoint / Primary node endpoint
Transaction splittingEnabled
Consistency levelSession consistency

Test workload

  • Tool: Sysbench

  • Scenario: oltp_read_only

  • Setup: Change the Sysbench connection host to the cluster endpoint. All other parameters follow the Performance testing method (OLTP).

The oltp_read_only scenario isolates read performance, which makes it suitable for measuring throughput gains from read/write splitting and transaction splitting.

Metric

TPS (Transactions Per Second): The number of transactions the database completes per second, counted as successful COMMIT operations.

Test data volume

ParameterValue
Number of tables8
Number of rows64,000,000
Total data volume128 GB

Performance results

Read the scenario
ConcurrencyCluster endpoint (TPS)Primary node endpoint (TPS)
12811,040.77,978.27
25614,751.398,653.15

At 128 concurrent connections, the cluster endpoint delivers approximately 38% higher TPS than the primary node endpoint. At 256 concurrent connections, the gain increases to approximately 70%.

What's next