MySQL RDS' FreebleMemory goes down while taking DB Dump

0

I use MySQL RDS for my node-based API and EC2 for API Deployment. I'm taking DB Dump using the below command inside the EC2 Server. 

mysqldump --set-gtid-purged=OFF -h rds.amazonaws.com -u admin -p db > db.sql

This command causes a weird thing. RDS freebleMemory utilized around 4-8 GB and doesn't restore/release after backup. Sometimes API went down due to this. For example after backup freebleMemory left at 12 GB if it's 16 or 18 GB before backup.

I have used different flags while taking backups like --single-transaction and --quick. I have used different strategies to take backups too, like taking DB dumps using MySQL Workbench. But it causes the same thing, API or FreebleMemory goes down.

Is this the default behaviour of RDS? Any suggestion or workaround on this?

1 Answer
2

FreeableMemory decrease during mysqldump is expected but should recover after the operation completes.

Use --single-transaction and --quick options to minimize memory usage during the dump.

Optimize InnoDB buffer pool settings and monitor swap usage to ensure efficient memory management.

Consider using AWS native backup solutions like automated backups or manual snapshots for less performance impact.

Monitor performance using CloudWatch and Performance Insights to identify and address any bottlenecks or issues.

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
Artem
reviewed 21 days ago
profile picture
EXPERT
reviewed a month ago
  • Thanks, Oleksii, Giovanni!

    Exactly! FreeableMemory should recover back, but it does not! When I take a dump for the 2nd or 3rd time, the application will be crashed. Therefore, I have to regularly restart RDS manually after taking Dump, so memory should be recovered back.

    Can you please suggest how I can optimize InnoDB buffer pool settings?

  • If the buffer pool size is too large, it might not release memory as quickly. Ensure your buffer pool size is appropriately configured for your workload. SET GLOBAL innodb_buffer_pool_size = <appropriate_value>;

  • Ensure that your RDS instance isn't swapping, as this can drastically affect performance.

    SELECT * FROM information_schema.GLOBAL_STATUS WHERE variable_name IN ('Innodb_buffer_pool_pages_data','Innodb_buffer_pool_pages_free','Innodb_buffer_pool_pages_dirty','Innodb_buffer_pool_pages_flushed');