本文介绍了PolarDB PostgreSQL版 16与同类PostgreSQL 16云原生数据库的OLTP负载性能测试结果。
简介
相对于同类PostgreSQL云原生数据库,PolarDB PostgreSQL版在以下几方面进行了优化,提升了整体性能:
采用了领先硬件技术,包括使用3DXpoint存储介质的Optane存储卡、NVMeSSD和RoCE RDMA网络等。
基于新的硬件,实现了一整套在用户态运行的IO和网络协议栈,获得了更高的性能、更低的延迟。
通过Polar CSN(Commit Sequence Number)技术,将原生PostgreSQL xid事务替换为单调递增的64位整型来提升高并发下OLTP性能。
借助预读、预扩展、rel_size_cache技术,可以有效减少IO读写次数,提升性能。
具体测试步骤,请参见性能测试方法(OLTP)。
测试环境与规格
PolarDB for PostgreSQL 16和同类PostgreSQL 16云原生数据库的环境和规格如下表所示:
说明 | PolarDB PostgreSQL版 | 同类PostgreSQL云原生数据库 |
核数+内存 | 8核 64 GB | 8核 64 GB |
并发数 | 256 | 256 |
PostgreSQL版本 | 16.10 | 16.10 |
磁盘性能等级 | PSL5 | 默认配置 |
关于内核参数,PolarDB PostgreSQL版 16和同类PostgreSQL 16云原生数据库的参数均采用默认参数。
测试Workload说明
在Sysbench中,有七类场景,包括oltp_insert、oltp_point_select、oltp_read_only、oltp_read_write、oltp_update_index、oltp_update_non_index、oltp_write_only。各种场景的测试内容说明如下:
参数 | 场景 | 测试内容 |
写场景 | oltp_insert | 插入表。 |
oltp_update_index | 更新带索引的表。 | |
oltp_update_non_index | 更新不带索引的表。 | |
oltp_write_only | 插入、更新、删除表混合测试。 | |
读场景 | oltp_point_select | 点查询。 |
oltp_read_only | 点查询+范围查询。 | |
读写混合 | oltp_read_write | oltp_write_only+oltp_read_only混合测试。 |
衡量指标
TPS(Transactions Per Second):即数据库每秒执行的事务数,以COMMIT成功次数为准。
测试数据量
本次实验测试数据量如下表所示:
参数 | 说明 |
表数目 | 8 |
行数 | 64,000,000 |
总数据量 | 128 GB |
性能结果
写场景

压测场景
PolarDB PostgreSQL版 16
同类PostgreSQL 16云数据库
oltp_insert
111618.70
15064.65
oltp_update_index
77647.89
13310.46
oltp_update_non_index
78112.42
13297.03
oltp_write_only
24602.97
4932.72
读场景


压测场景
PolarDB PostgreSQL版 16
同类PostgreSQL 16云数据库
oltp_point_select
220782.88
36460.18
oltp_read_only
8653.15
1628.1
读写混合场景

压测场景
PolarDB PostgreSQL版 16
同类PostgreSQL 16云数据库
oltp_read_write
5073.52
911.26