本文共 1966 字,大约阅读时间需要 6 分钟。
今天生产中遇到了内存不足的错误:insufficient memory reserved for statement (memquota.c:228),这里记录一下问题原因及解决办法。
解决方法:
将statement_mem默认的125MB的配置提高,建议在500MB左右或者更高一些。
操作步骤:
1.查看statement_mem默认设置:
dgadmin@flash:~$ gpconfig -s statement_memValues on all segments are consistentGUC : statement_memMaster value: 125MBSegment value: 125MB2.在Master节点修改配置文件postgresql.conf,最后一行添加statement_mem:
chris@flash:~$ su - dgadminPassword:dgadmin@flash:~$ cd $MASTER_DATA_DIRECTORYdgadmin@flash:/dgdata/master/dg-1$ lsbase gpperfmon pg_distributedlog pg_ident.conf pg_stat_tmp pg_twophase pg_xlog postmaster.optsglobal pg_changetracking pg_distributedxidmap pg_log pg_subtrans pg_utilitymodedtmredo postgresql.conf postmaster.pidgp_dbid pg_clog pg_hba.conf pg_multixact pg_tblspc PG_VERSION postgresql.conf.bakdgadmin@flash:/dgdata/master/dg-1$
dgadmin@flash:/dgdata/master/dg-1$ vim postgresql.confdgadmin@flash:/dgdata/master/dg-1$ gpstop -u20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Starting gpstop with args: -u20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Gathering information and validating the environment...20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Obtaining Greenplum Master catalog information20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Obtaining Segment details from master...20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.99.00 build Deepgreen DB'20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Signalling all postmaster processes to reload................3.使修改生效:
dgadmin@flash:/dgdata/master/dg-1$ gpconfig -s statement_memValues on all segments are consistentGUC : statement_memMaster value: 500MBSegment value: 500MB备注:需要注意的是,新版本的配置文件中,参数gp_resqueue_memory_policy通常会设置为:'eager_free'。如果要对statement_mem进行修改并让其发挥作用,参数应该配置为:
gp_resqueue_memory_policy = 'auto'
转载地址:http://ibzoa.baihongyu.com/