了解更多Greenplum技术干货,欢迎访问Greenplum中文社区网站
Greenplum 6针对OLTP的使用场景完成了多项优化,极大的改进了多并发情况下简单查询、删除和更新操作的性能。这些改进包括:
- 合并Postgres内核版本至9.4,这些合并在带来一系列新功能的同时,也提升了系统的整体性能。例如,引入fastpath等锁优化,可以减少多并发情况下的锁竞争开销。
- 提供全局死锁检测,从而支持针对同一张HEAP表的并发更新/删除操作。
- 优化全局事务,从而减少开始事务和结束事务时的延迟。
基于这些优化,在我们的测试环境中,Greenplum 6的TPC-B性能相比最新的Greenplum 5提升了60倍,单条更新操作性能提升了70倍,单条插入峰值性能提升到3.6倍,单条查询性能也提升到3.5倍。尤其是对于单条查询的场景,我们在Greenplum 6中消除了大部分锁竞争,使得master的CPU使用率可以超过90%,这样通过提升master硬件性能可以进一步提升查询的TPS性能,在我们的一个单机192核的测试环境中(1个master+18个segment),单条查询TPS可以达到22万。
1 测试环境与方法
1.1 测试环境
我们的测试环境基于谷歌云平台(Google Cloud Platform,简称GCP),为5个虚拟主机的集群,包含一个master主机和四个segment主机,master和segment虚拟主机的配置信息如下:
每一台segment主机运行一个segment节点,整个集群没有配置mirror与standby节点。除此之外还需要一台虚拟主机来运行测试工具pgbench,它的配置不需要很高,在我们的测试中采