0

I have a django application every api hit in django creating one db connection to handle that request and basically this is an overhead as this is creating several connections if there are multiple requests to handle so I want to have db connection pooling or persistent connection for efficient handling.

I have gone through the django doc for this as there is CONN_MAX_AGE parameter but that doesn't solve the problem as that won't be using older connection to handle new request so what should be the best way to manage open db connections.

ankitkhandelwal185
  • 1,023
  • 1
  • 15
  • 24
  • 1
    "won't be using older connection to handle new request " What? What do you think it does do, if not that? – jjanes Jul 07 '20 at 15:01
  • it will be creating new connection to handle new request as described in this doc https://docs.djangoproject.com/en/3.0/ref/databases/#persistent-connections, correct me if i am wrong @jjanes although i would like to know your thoughts on this topic – ankitkhandelwal185 Jul 07 '20 at 15:11
  • 1
    It creates new connections if there are no old ones around available use. – jjanes Jul 07 '20 at 15:22

0 Answers0