Openshift Online 2.0.32
psycopg2 errors: psycopg2:OperationalError: FATAL: sorry, too many clients already
Looking at the postgresql.conf file on the Postgres gear, we could see that the max connections were set to only 10, shared buffer set to only 2MB, and effective_cache_size set to only 32.
Reading through the Postgres documentation, we could see that the default for max_connections is typically around 100, for shared_buffer it's typically 32MB, and effective_cache_size tis typically 128MB.
Change connection limits per database:
ALTER DATABASE <name> WITH CONNECTION LIMIT 100
Postgress gears are not really tuned for production. We will try to improve this in a future version.
Created a bugzilla ticket to get it improved
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.