0

I am using Django, without MAX_CONN_AGE setting (default = 0), this leads to creation of connection in each request, and connection is not reused in django ORM.

This is causing multiple postgres connect as my api is getting called multiple times, I want to achieve something like connection pooling or singleton connection so that connection is reused.

I am using gunicorn -k gthread --threads 2 --workers 4.

so,

  1. does MAX_CONN_AGE works fine with gthread? connection will be reused and closed properly? Can you explain the working.
  2. And what would be the behaviour of MAX_CONN_AGE with gevent worker class?

0

You must log in to answer this question.

Browse other questions tagged .