On 18 févr. 2013, at 19:51, Michael <newmani...@gmail.com> wrote:

> I was just alerted to this by the reopening of ticket #18135.

My initial analysis is incomplete. I'll comment on the ticket in a few minutes.

> I will argue, however, that the AWS use case is a reason we need this to be 
> an OPTION, not automatic.

Like Jacob said, persistent connections can be disabled entirely by settings 
CONN_MAX_AGE = 0.

> So here is my point, requiring that an application has a consistant 
> connection to the database is really good for small applications, but as the 
> number of front facing web servers increase, the number of database 
> connections also increase, consuming the most expensive resource of the web 
> application, the database. Leaving open, "sleeping", I would argue "stale", 
> connections doesn't scale cost linearly with usership, instead it increases 
> exponentially.

If the majority of your views do not hit a given database, I expect that you'll 
set a low CONN_MAX_AGE for this database.

> For the small percentage of people who are noticing the SQL connection time 
> issues (which I would recommend they reach out to a AWS support person 
> about), a persistant connection makes sense.

Most Django sites suffer from the database connection establishment delay — 
actually, all except those that use a connection pooler. AWS is the most 
egregious example, but it isn't the primary motivation for this patch.

On a random server running both Django and PostgreSQL locally, I measured an 
overhead of 7ms. If PostgreSQL was running on another machine, the overhead 
would be more important. If one is aiming for 200ms response times, connection 
establishment can easily eat 5 to 10% of the processing time.

-- 
Aymeric.



-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to