使用citus 列式存储压缩数据
实际上是一个实际问题,刚好结合问题说明下问题的一种解决方法
问题
注意是基于容器运行的
- 异常
ERROR: could not resize shared memory segment "/PostgreSQL.1345396376" to 4194304 bytes: No space left on device
CONTEXT: while executing command on localhost:5432
解决方法
列式存储,或者增大shared 内容
基于已经创建的分布式表,可以调整访问模式,基于此我们可以解决此问题,而且压缩比是很不错的,归于归档数据值得使用
参考
SELECT alter_table_set_access_method('github_usersv3', 'columnar');
- shared 调整
shm-size 参数
参考资料
https://stackoverflow.com/questions/56751565/pq-could-not-resize-shared-memory-segment-no-space-left-on-device
https://github.com/moby/moby/issues/29492
https://www.citusdata.com/blog/2021/03/06/citus-10-columnar-compression-for-postgres/