greenplum 大表频繁查询,插入,导致IO,CPU过高

错误
What are " VM protect failed to allocate %8024 bytes from system, VM Protect 2012 MB 

参考 https://discuss.pivotal.io/hc/en-us/articles/204997207 

1 添加SWAP


Validate the value of gp_vmem_protect_limit. gp_vmem_protect_limit maximum limit must be calculated based on the calculation as provided in Greenplum Documentation.

Example:

(SWAP + (RAM * vm.overcommit_ratio)) .9 / primary number_segments_per_server

发现原来aws的默认没有SWAP,添加SWAP后正常,报的错误理解

What are " VM protect failed to allocate %802400000000 bytes from system, VM Protect 100 MB 


2 设置参数 gp_vmem_protect_limit
  每个segment需要单独去设置,重启
  
  
3 添加一张临时表,将数据时时导入临时表,频繁查询使用临时表,数据量小,不会造成IO,CPU过高


4 对大表执行ANALYZE TABLE



总结:经过优化后,IO、CPU正常,greenplum并不适合对大表进行频繁查询,聚合,后台运算效果不错,数据量过大考虑使用表分区,频繁查询的数据考虑使用mongodb
支持更大并发,单表数据量不宜过大,还是得分表,由于考虑到成本,公司未做分片



备注:查看linux 可分配的内存

grep -i commit /proc/meminfo
看到CommitLimit和Committed_As参数。
CommitLimit是一个内存分配上限,CommitLimit = 物理内存 * overcommit_ratio(默认50,即50%) + swap大小

猜你喜欢

转载自blog.csdn.net/changyuan101/article/details/79408393