3 ms·
By default Django closes PostgreSQL connections after handling each web request. I’m not certain but what we’re probably seeing here in latency is mostly the su
by rbranson 7y ago
By default Django closes PostgreSQL connections after handling each web request. I’m not certain but what we’re probably seeing here in latency is mostly the substantial overhead in setting up a PG connection. Redis will still be faster but I’d guess the gap would be significantly tighter with persistent connections enabled.
- cortesoft 7y agoReally? It doesn't use a connection pool?
- airstrike 7y agoAFAIK you can pick your poison https://docs.djangoproject.com/en/2.2/ref/databases/#transaction-pooling-and-server-side-cursors https://docs.djangoproject.com/en/2.2/ref/databases/#transac...
- jsmeaton 7y agohttps://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-CONN_MAX_AGE https://docs.djangoproject.com/en/2.2/ref/settings/#std:sett... pooling is available, but off by default. I suspect most new projects turn it on, but I have no data to support that.