How can the 'max_connections' parameter in Postgres be increased for CloudForms?

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL)
  • postgres
  • CloudForms

Issue

  • We are seeing the following error on our Postgres server logs:
psql: FATAL: sorry, too many clients already
  • The same error is being received on the application side when trying to connect to the database.
  • How can this condition be averted?

Resolution

  • First, please make sure that connections are being properly closed when not used anymore by the application(s). If connections are indeed being closed properly, the max_connections parameter can be modified from the postgresql.conf file that is present in your PostgreSQL instance directory.
max_connections = 500

Please be aware that increasing the number of available connections will likely impact the memory footprint of your DB. Consider tuning the memory-related configuration options too when increasing max_connections.

Root Cause

The max_connections parameter defaults to 100 and can easily be reached with a certain number of clients and/or not properly closing connections.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments