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

本文涉及的产品
云原生数据库 PolarDB PostgreSQL 版,标准版 2核4GB 50GB
云原生数据库 PolarDB MySQL 版,通用型 2核8GB 50GB
简介:

今天生产中遇到了内存不足的错误: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'
相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
9月前
|
人工智能 关系型数据库 数据库
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
|
存储 缓存 固态存储
Managing Non-Volatile Memory in Database Systems
Managing Non-Volatile Memory in Database Systems
131 0
|
Oracle 关系型数据库 数据库
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist的原因分析
        今天突然接到同事电话,说oracle数据库连接不上了,我远程过去用pl/sql developer登录,提示ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist.意思是oracle无法使用,共享内存领域不存在。
2501 0
|
SQL 存储 Oracle
《Oracle Database In-Memory: A Dual Format In-Memory Database》
Oracle IMC是第一个商用的dual-format数据库。
《Oracle Database In-Memory: A Dual Format In-Memory Database》
|
SQL 算法 Java
《Speedy Transactions in Multicore In-Memory Databases》
Speedy Transactions in Multicore In-Memory Databases
《Speedy Transactions in Multicore In-Memory Databases》
|
SQL 索引 存储
Troubleshooting SQL Server RESOURCE_SEMAPHORE Waittype Memory Issues
原文:Troubleshooting SQL Server RESOURCE_SEMAPHORE Waittype Memory Issues    前言: 本文是对博客https://www.mssqltips.com/sqlservertip/2827/troubleshooting-sql-server-resourcesemaphore-waittype-memory-issues/的翻译,本文基本直译,部分地方读起来有点不自然。
1130 0
|
SQL 机器学习/深度学习 关系型数据库
RDS SQL Server– Best Practices of Execution Plan Cache for Missing Indexes
Execution plan cache is a significant part of SQL Server memory management. It can reveal to you how the execution of a query will occur, or how query execution took place.
2752 0
|
关系型数据库 MySQL 数据库