1

I'm running the free instance of amazon RDS connection to a t2.medium ec2 instace. We are running a wordpress website with 20 active plugins and about 800 pages. I can see that I am low in memory (freeable memory) down to 52MB. There is only 1 database connection active and the google analytics real time report show only 1 visitor which is me.

mysql show process list returns

+-----+-------+-------------+-------+---------+------+-------+------------------+
| Id  | User  | Host        | db    | Command | Time | State | Info             |
+-----+-------+-------------+-------+---------+------+-------+------------------+
| ****| ***** | l****:46109 | mysql | Sleep   | 4    |       | NULL             |
| ****| ****  | ****:33918  | NULL  | Query   | 0    |  init | show processlist |
+-----+-------+-------------+-------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

what is consuming my memory?

  • SHOW VARIABLES LIKE '%buffer%'; – Rick James Oct 22 '16 at 17:08
1

The memory will be consumed by a number of things, including the MySQL innodb buffer pool, table and definition caches, etc.

RDS will default the innodb_buffer_pool_size to {DBInstanceClassMemory*3/4}, which is a good starting point, but does only leave a 1/4 of the RAM available for other parts of the system.

One thing that really hits the small RDS instances is the performance_schema - this can consume 500Mb RAM as soon as the server starts up, and never releases it.

If you are not using the performance_schema regularly, if at all, turn it off by setting the appropriate parameter within your RDS parameter group.

You will need to reboot the RDS instance if this is the case.

At the end of the day, a t2.medium instance only has 4Gb of RAM available to you (see http://www.ec2instances.info/rds/), and 52Mb is probably more than enough free for your system to continue to work without issue. Most of your data content will be in the buffer pool, so MySQL will respond directly from memory for most of your queries, and feel pretty responsive, even on such a small system.

  • My memory metric is above threshold value and is now red at 52mb is that still okay? – Andrei Oct 19 '16 at 21:14
  • my t2.medium(4gb) ram is the ec2 instance while the RDS instance is db.t2.micro (1gb ram) – Andrei Oct 19 '16 at 21:16
  • 1
    If your RDS instance is a t2.micro, then you will struggle - MySQL will take 750mb of that immediately, plus any additional caching. Just keep monitoring it and see how it changes over time, you may find that it is ok to run with that for the time being, especially if you are just testing it. – Dave Rix Oct 19 '16 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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