My Django application is exceeding the maximum number of simultaneous database
connections (100) to the Postgres database when running through Gunicorn with
async eventlet workers. When the limit it exceeded it starts returning
500-errors until new connections can be established.
Setting `CONN_MAX_AGE` to 0, 60, 600, or None does not appear to solve this issue.
This is my database configuration:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'django',
'USER': 'django',
'HOST': 'postgres',
'PORT': 5432,
'CONN_MAX_AGE': 60,
}
}
This is my Gunicorn configuration:gunicorn --bind 0.0.0.0:8080 --worker-class eventlet --workers 5 myapp.wsgi:application
These are the installed packages:- djano v1.7
- gunicorn v19.3
- eventlet v0.17
- psycopg2 v2.6
Any hints or tips on where to go from here? Is Django's ORM supposed to offer
connection pooling/reuse, or is this something I have to get else where?