django persistant connection

Hi,

While using persistant connection using conn_max_age=500 and with django 5.0 version when I am
doing 100 requests to server with concurrency as 1 (ab -c 1 -n 100 http://127.0.0.1:8000/emp/) then i am seeing new sessions are being created in the range (8-12). Since conn_max_age is 500 seconds why in just 2-3 seconds sessions are being destroyed and new sessions are being created.
Also why it is creating multiple sessions. If one connection is being created for 500 seconds it should be reused to serve all the request.

How are you running your project? What web server are you using? How is your web server configured to use your project?

I am using django development server. Starting the server using the command python manage.py runserver.

See the caveats in the Persistent Connection docs referencing runserver.

In development server is it like for every request a new thread is created and after the request is completed the thread gets destroyed and so the connection even if its persistant it gets destroyed because of thread.