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大小
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值