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

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
云原生数据库 PolarDB PostgreSQL 版,标准版 2核4GB 50GB
云原生数据库 PolarDB MySQL 版,通用型 2核4GB 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数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
3月前
|
人工智能 关系型数据库 数据库
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
|
3月前
|
SQL 关系型数据库 MySQL
MySQL SQL error: #1271 - Illegal mix of collations for operation ‘UNION‘
MySQL SQL error: #1271 - Illegal mix of collations for operation ‘UNION‘
PowerDesigner在生成SQL时报错Generation aborted due to errors detected during the verification of the mod
PowerDesigner在生成SQL时报错Generation aborted due to errors detected during the verification of the mod
517 0
PowerDesigner在生成SQL时报错Generation aborted due to errors detected during the verification of the mod
|
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 存储 负载均衡
《Parallel SQL Execution in Oracle 10g》 论文解读
《Parallel SQL Execution in Oracle 10g》 论文解读
《Parallel SQL Execution in Oracle 10g》 论文解读
|
SQL 负载均衡 并行计算
Parallel SQL Execution in Oracle 10g 论文解读
这篇简短的paper从非常high level的角度描述了下Oracle 10g对于parallel query所做的重新设计和其中的一些优化,由于Oracle RAC特殊的share-disk架构,使其在并行计算上与普通的MPP数据库有一些不同,例如对于worker的调度和分配方式以及对于资源/数据的动态调整。
245 0
Parallel SQL Execution in Oracle 10g 论文解读
|
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/的翻译,本文基本直译,部分地方读起来有点不自然。
1101 0
|
SQL 数据库
SQL logic error or missing database no such table: xxx
原文:SQL logic error or missing database no such table: xxx System.
3306 0