Re: Persistent connections, take 2

2013-03-18 Thread Shai Berger
On Monday 18 March 2013, Aymeric Augustin wrote: > On 18 mars 2013, at 17:10, Shai Berger wrote: > > If the persistent connections are thread-local, don't you want to close > > them anyway when the thread exits? > > Yes, do you know how this could be achieved? I haven't found how to hook > on thr

Re: Persistent connections, take 2

2013-03-18 Thread Anssi Kääriäinen
On 18 maalis, 19:01, Aymeric Augustin wrote: > On 18 mars 2013, at 17:10, Shai Berger wrote: > > > If the persistent connections are thread-local, don't you want to close them > > anyway when the thread exits? > > Yes, do you know how this could be achieved? I haven't found how to hook > on threa

Re: Persistent connections, take 2

2013-03-18 Thread Aymeric Augustin
On 18 mars 2013, at 17:10, Shai Berger wrote: > If the persistent connections are thread-local, don't you want to close them > anyway when the thread exits? Yes, do you know how this could be achieved? I haven't found how to hook on thread termination. > ... but that fix will kill persistent c

Re: Persistent connections, take 2

2013-03-18 Thread Shai Berger
On Monday 18 March 2013 16:36:53 Aymeric Augustin wrote: > By default, the development server creates a new thread for each request it > handles. Not only does this negate the effect of persistent connections > (they're thread-local), > [...] > 1) Do we want to enable persistent connections in pr

Re: Persistent connections, take 2

2013-03-18 Thread Jeremy Dunck
It sounds like we need a way to tell the worker that we are done sending requests to it so that the worker can do cleanup (of which db conn close is one task). This mirrors the previous request_finished "coupling" to requests_finished. (OS?) Signal? Sentinel queue/socket/named pipe + backgroun

Re: Persistent connections, take 2

2013-03-18 Thread Aymeric Augustin
On 28 févr. 2013, at 00:12, Aymeric Augustin wrote: > I'm just wondering if 10 minutes is a good default value for CONN_MAX_AGE. Since I committed the patch, I discovered that persistent connections don't interact well with runserver. By default, the development server creates a new thread f

Persistent connections, take 2

2013-02-27 Thread Aymeric Augustin
Hello, I've integrated the feedback received on my initial proposal in a new pull request: https://github.com/django/django/pull/733 and I think it's ready for review. I'm just wondering if 10 minutes is a good default value for CONN_MAX_AGE. I chose it randomly. Would "unlimited" be better? Un