閱讀285 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Greenplum/Deepgreen ERROR: insufficient memory reserved for statement (memquota.c:228)

今天生產中遇到了內存不足的錯誤:insufficient memory reserved for statement (memquota.c:228),這裏記錄一下問題原因及解決辦法。


解決方法:

將statement_mem默認的125MB的配置提高,建議在500MB左右或者更高一些。


操作步驟:

1.查看statement_mem默認設置:

dgadmin@flash:~$ gpconfig -s statement_mem
Values on all segments are consistent
GUC          : statement_mem
Master  value: 125MB
Segment value: 125MB

2.在Master節點修改配置文件postgresql.conf,最後一行添加statement_mem:

chris@flash:~$ su - dgadmin
Password:
dgadmin@flash:~$ cd $MASTER_DATA_DIRECTORY
dgadmin@flash:/dgdata/master/dg-1$ ls
base     gpperfmon          pg_distributedlog     pg_ident.conf  pg_stat_tmp  pg_twophase            pg_xlog              postmaster.opts
global   pg_changetracking  pg_distributedxidmap  pg_log         pg_subtrans  pg_utilitymodedtmredo  postgresql.conf      postmaster.pid
gp_dbid  pg_clog            pg_hba.conf           pg_multixact   pg_tblspc    PG_VERSION             postgresql.conf.bak
dgadmin@flash:/dgdata/master/dg-1$

dgadmin@flash:/dgdata/master/dg-1$ vim postgresql.conf
dgadmin@flash:/dgdata/master/dg-1$ gpstop -u
20170611:10:40:34:003556 gpstop:flash:dgadmin-[INFO]:-Starting gpstop with args: -u
20170611: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 information
20170611: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_mem
Values on all segments are consistent
GUC          : statement_mem
Master  value: 500MB
Segment value: 500MB


備注:需要注意的是,新版本的配置文件中,參數gp_resqueue_memory_policy通常會設置為:'eager_free'。如果要對statement_mem進行修改並讓其發揮作用,參數應該配置為:

gp_resqueue_memory_policy = 'auto'

最後更新:2017-06-11 14:33:05

  上一篇:go  Deepgreen(Greenplum) DBA常用運維SQL
  下一篇:go  Deepgreen(Greenplum) 模板數據庫template0和template1 探討