Re:Funding Django is not an act of charity, it's an investment
by Scarblac on Tuesday February 09, 2016 @10:30AM
(#11065894)
I'm not sure if this is in fact what you're saying, but the closing the database connection each time is only the default (historical reasons), changing it is a matter of changing one setting: https://docs.djangoproject.com/en/1.9/ref/databases/#connect...
Re:Funding Django is not an act of charity, it's an investment
by bluetech on Tuesday February 09, 2016 @12:57PM
(#11067216)
This is still a similar problem for the memcached cache backend (which django recommends): https://code.djangoproject.com/ticket/11331
Re:Funding Django is not an act of charity, it's an investment
by brianwawok on Tuesday February 09, 2016 @01:30PM
(#11067504)
Oh interesting.
I did not mess with memcached, just django + gunicorn + nginx... was pretty nice performance for simple webappy stuff.
Re:Funding Django is not an act of charity, it's an investment
by piquadrat on Tuesday February 09, 2016 @10:29AM
(#11065891)
Just for reference, Django has had support for persistent connections for quite a while now. It's disabled by default due to backwards compatibility considerations.
https://docs.djangoproject.com/en/1.9/ref/databases/#persist...
Re:Funding Django is not an act of charity, it's an investment
by brianwawok on Tuesday February 09, 2016 @10:39AM
(#11065958)
Oh I know, I was talking about sane "defaults".. i.e. if you don't touch the config, the default seems silly. Makes sense to close it in dev, but in default prod? Not sane.
Re:Funding Django is not an act of charity, it's an investment
by piquadrat on Tuesday February 09, 2016 @10:42AM
(#11065979)
I figured you were aware of the feature itself. I just wanted to clarify for people unfamiliar with Django that it does support persistent connections, even if they are disabled by default :)
Re:Funding Django is not an act of charity, it's an investment
by neokya on Tuesday February 09, 2016 @10:28AM
(#11065885)
No, that's fixed since 1.6 release. You can keep database connection persistent, just change the default setting https://docs.djangoproject.com/en/dev/ref/settings/#conn-max...
By default, it uses historical behavior.
Re:Funding Django is not an act of charity, it's an investment
by wahnfrieden on Tuesday February 09, 2016 @10:28AM
(#11065880)
Not sure what you saw - look into Django connection pooling.
Still fighting the internal battle that I know I like better compile time checking (ala Scala), but having changes happen so fast in dev is pretty freakin nice...