0

I'm facing an interesting issue related to RAM usage, ReadThroughput, and Freeable Memory metrics with my PostgreSQL database on an RDS instance, and I'm hoping to get some insights here.

Two months ago, I experienced a significant increase in the ReadThroughput metric, leading to a instance crash. I understand that a spike in ReadThroughput often suggests memory insufficiency. However, during this period, the Freeable Memory remained stable at around 12GB.

In response, I upgraded to a more powerful instance type, which currently offers about 47GB of Freeable Memory. Following the upgrade, I've noticed a dramatic decrease in ReadThroughput, which is positive as it minimizes disk reads.

However, despite the database size growing by approximately 5% over the past week, the Freeable Memory remains unchanged and ReadThroughput has slightly increased. Does this imply the RAM allocation remains constant despite the database growth? If so, why might this be the case?

Additionally, I'm curious as to why a sudden increase in disk usage (reflected in the ReadThroughput) was observed two months ago while the Freeable Memory stayed steady.

Any insights or advice from the community would be greatly appreciated.

1 Answer 1

0

Postgres heavily relies on the OS cache. Freeable memory includes memory that is used by the OS for caching purposes (but can be reclaimed by other processes, hence freeable).

So by increasing the total memory of your instance, the OS will have more memory available to cache for instance (parts of) disk. Since there is more data in memory, less reads are needed from disk itself, leading to lower ReadThroughPut/IOPS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.