Postgresql 极光数据库 freeable_memory

Postgresql Aurora DB freeable_memory

我对 AWS Aurora Postgres 的可用内存有疑问。

我们最近想在我们的一个数据库上创建一个索引,但数据库死了,并对从服务器进行了故障转移,一切正常。看起来可用内存减少了 maintenance_work_mem 配置的 500mb,然后变成了大约 800mb 的内存——紧接着 32gig 实例就死了。

1) 我想知道可释放的内存是否是整个系统内存,这里的低内存是否可以调用 AWS Aurora 实例上的系统 oom killer?因此,我们可能希望为操作任务和 运行 的 autovacuum 作业留出更多空间,以免再次遇到此问题?

2) 据我所知,创建索引的实际工作应该使用了可用的本地存储,所以索引的大小应该无关紧要,对吧?

提前致谢, 克里斯

关于 1)

来自 (https://forums.aws.amazon.com/thread.jspa?threadID=209720)

的可用内存

The freeable memory includes the amount of physical memory left unused by the system plus the total amount of buffer or page cache memory that are free and available.

So it's freeable memory across the entire system. While MySQL is the main consumer of memory on the host we do have internal processes in addition to the OS that use up a small amount of additional memory.

If you see your freeable memory near 0 or also start seeing swap usage then you may need to scale up to a larger instance class or adjust MySQL memory settings. For example decreasing the innodb_buffer_pool_size (by default set to 75% of physical memory) is one way example of adjusting MySQL memory settings.

这也意味着如果内存变低,它可能会以某种形式影响进程。在这个线程中(https://forums.aws.amazon.com/thread.jspa?messageID=881320&#881320)例如有人提到它导致 mysql 服务器重新启动。

关于 2)

这就像文档中描述的那样 (https://aws.amazon.com/premiumsupport/knowledge-center/postgresql-aurora-storage-issue/),所以我猜它是正确的,大小应该无关紧要。

Storage used for temporary data and logs (local storage). All DB temporary files (for example, logs and temporary tables) are stored in the instance local storage. This includes sorting operations, hash tables, and grouping operations that are required by queries.

Each Aurora instance contains a limited amount of local storage that is determined by the instance class. Typically, the amount of local storage is twice the amount of memory on the instance. If you perform a sort or index creation operation that requires more memory than is available on your instance, Aurora uses the local storage to fulfill the operation.