Available memory

RDSAvailableMemory #

Meaning #

Alert is triggered when an RDS instance has low available memory.

Impact #

  • Performances could be degraded

  • Some processes could be killed

Diagnosis #

  1. Check the number of database connections

    MoreDatabase server creates a process for each client. Each process consumes a small amount of memory on the server.

Mitigation #

  1. Reduce memory usage

    1. Reduce the maximum number of connections

      Update the max_connections RDS parameter to reduce maximum number of clients

    2. Limit database connections per user

      You can also reduce the maximum number of connections per PostgreSQL user using

      ALTER ROLE <user_to_limit> CONNECTION LIMIT <max_connection_limit_for_role>;
      
    3. Reduce the work_mem

  2. Increase server instance type

    Warning: Modifying an AWS instance generates downtime:

    • Multi-AZ enabled: Instance failover will be triggered (< 1 minute downtime)
    • No multi-az: Instance will restarted with new hardware (~15 minutes downtime)

    See AWS documentation

Additional resources #