我正面临着Postgresql的一个奇怪的瓶颈。早些时候,DB运行在具有12 DB的单核计算机上。我们将其迁移到一个8核64 GB内存。在这一迁移之后,很多时候它会创建巨大的临时文件~40 as,因为pg_size_pretty(pg_database_size('DB_name'));仅为1.9GB。
在postgresql.conf中
working_mem = 5GB
shared_buffer = 16 GB (25% of total RAM)
max_wal_size = 2GB
autovaccum = on尽管有上面的配置,我还是得到了下面的msg:
'53100-could not write to file "pg_tblspc/226475/PG_11_201809051/pgsql_tmp/pgsql_tmp13308.47":
No space left on devicecould not write to file
"pg_tblspc/226475/PG_11_201809051/pgsql_tmp/pgsql_tmp13308.47实际上,我已经使用下面一组来自pg_tablespace的查询将pg_default更改为一个自定义位置。
CREATE TABLESPACE LOCATION OWNER postgres;
ALTER DATABASE SET temp_tablespaces = tblspc_name;
GRANT ALL ON tblspc_name to postgres;我不知道这里缺少了什么。解决这个性能问题的方法应该是什么。
发布于 2021-11-11 17:06:31
默认表空间中的空间不足,因为查询必须编写这么多临时文件。也许您忘记了一个或两个连接条件,或者某个地方有无限递归。
https://dba.stackexchange.com/questions/302473
复制相似问题