我们一直在 RDS 中使用 MariaDB,我们注意到交换空间越来越高而没有被回收。然而,可用内存似乎没问题。请检查附件。
实例类型:db.t2.micro
可用内存:125Mb
交换空间:每 24 小时增加 5Mb
IOPS:已禁用
存储:10Gb(SSD)
很快 RDS 将吃掉所有交换空间,这将给应用程序带来很多问题。 有人有类似的问题吗? 最大交换空间是多少? (在文档中没有找到任何内容)
请帮忙!
最佳答案
有人遇到类似问题吗?
我在不同的实例类型上遇到了类似的问题。即使您切换到具有更多内存的更高实例类型,交换的趋势仍然存在。
您可以找到 AWS 的解释 here
Amazon RDS DB instances need to have pages in the RAM only when the pages are being accessed currently, for example, when executing queries. Other pages that are brought into the RAM by previously executed queries can be flushed to swap space if they haven't been used recently. It's a best practice to let the operating system (OS) swap older pages instead of forcing the OS to keep pages in memory. This helps make sure that there is enough free RAM available for upcoming queries.
分辨率:
Check both the FreeableMemory and the SwapUsage Amazon CloudWatch metrics to understand the overall memory usage pattern of your DB instance. Check these metrics for a decrease in the FreeableMemory metric that occurs at the same time as an increase in the SwapUsage metric. This can indicate that there is pressure on the memory of the DB instance.
最大交换空间是多少?
通过启用增强监控,您应该能够看到操作系统指标,例如可用交换内存量(以千字节为单位)。
查看详情here
关于amazon-web-services - RDS 吃掉所有交换空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37393813/