mysqlamazon-web-servicesamazon-rds

How to view/identify which process taking how much memory?


We have an RDS db.t3.micro running. Its shows memory usage of 90% eventhough we are not running.

Freeable memory always shows only ~100MB (we are not running anything since it occupies ~900MB of RAM).

Tried below ways to make more freeable memory (custom parameter group),

  1. restarted RDS
  2. Innodb_buffer_pool_size reduced to 52428800 from 268435456
  3. Max_connections set to 20 from {DBInstanceClassMemory/12582880}
  4. Tmp_table_size to 1048576 from 134217728
  5. max_heap_table_size to 1048576 from 134217728
  6. Table_open_cache to 10 from empty
  7. Log_bin_trust_function_creators to 0 from empty
  8. Log_bin_use_v1_row_events to 0 from empty
  9. Event_scheduler to OFF from empty

All the above failed to make more freeable memory.

how to make more freeable memory?

Is there a way to identify what is using how much memory, so that we can adjust according to our need?


Solution

  • According to https://repost.aws/knowledge-center/low-freeable-memory-rds-mysql-mariadb, the allocation of memory is

    Maximum MySQL Memory Usage = innodb_buffer_pool_size + key_buffer_size + ((read_buffer_size + read_rnd_buffer_size + sort_buffer_size + join_buffer_size) X max_connections)

    You have provided Innodb_buffer_pool_size in your question, but you need to check these other parameters as well.

    However, note that the article also mentions that 80% to 90% memory usage is actually expected.

    To optimize performance, RDS for MySQL allocates 80% to 90% of the available memory on an instance to the default parameters.

    So unless you have a need to enable certain parameters that consume more memories, your current usage is probable fine.