1

I have a database running on Amazons RDS platform and it does not seem to be using the full amount of memory available.

The instance type is db.m4.xlarge, this should give me 16 GiB of memory but when i look at the monitoring page it shows I am reaching the threshold with a current value of 2460 MB.

Screenshot of AWS RDS monitoring page

When I look at the db-parameter-group it shows that the innodb_buffer_pool_size should be the 3/4 of the DBinstanceClassMemory however when i check the actual value set (by logging into the db and running show global variables) is it set as 12465471488 (i assume this is bytes?)

Does anyone know why this is and what options I should set to make the RDS instance take full advantage of the memory that is available?

3
  • I can't find a reference to it at the moment and I don't have an answer to your specific question, however I did want to note that your db operations don't get the full amount of memory that the instance type specifies. If the instance type specifies 16gb of memory, several of those gigs go to the underlying EC2 instance. I don't imagine it would reduce 16gb down to 2.5gb though, so there is likely a different reason for that, but thought I would share that. Commented Jul 18, 2017 at 15:15
  • @Brooks no, not several gigs. Probably closer to the range of 256 - 512 MiB. The instance isn't doing anything other than running the database. Commented Jul 19, 2017 at 0:55
  • I stand corrected - would have been helpful if I had been able to find the documentation...! Thanks for the correction! Commented Jul 19, 2017 at 1:54

1 Answer 1

3

The number shown in the console is free memory -- not used memory. It's arguably counter-intuitive, but that's what's being shown, here. Note that the small bar graph adjacent to the number is mostly full, not mostly empty.

Sign up to request clarification or add additional context in comments.

3 Comments

The monitoring team must be taking a leaf out of the book of the billing team
yes you are correct. Thank you for your help. One way I could confirm this was to restart the instance and then the full memory was available but it then went back down to the value it was previously. Does this basically mean the instance should be bigger or I need to remove some indexes (if possible) to free up memory?
As long as the system is stable over time, 2.5G of free memory should be more than sufficient. Most of the memory used by MySQL (in a correct configuration) is used by the InnoDB Buffer Pool, which, once claimed by loading data from disk, is never freed, by design. It wouldn't make sense to free this memory, since having data in memory (avoiding disk access) is a major optimization. If the total data + indexes exceeds the size of the buffer pool, a least-recently-used algorithm will evict old pages, to make space, if a query calls for data that isn't in the pool w/total memory use unchanged.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.