On Jul 24, 4:39 pm, James Bennett <ubernost...@gmail.com> wrote: > Except this is what it turns into. So suppose a patch is added which > does nothing except keep the database connection open; well, that's > problematic because it means a server process/thread that's not > handling a request at the moment is still tying up a handle to a DB > connection. So somebody will say it'd be much better if Django > maintained a pool of connections independent of request/response > cycles, and just doled them out as needed.
I think you're mixing 2 different things together: persistent connection & connection pooling. There's no reason that you can't have persistent connection without connection pooling. For connection pooling you can make an argument whether it belongs in an ORM or not (although SQLAlchemy supports connection pooling just fine) But on the other hand if all a user wants is simple persistent connection then it would seem logical for the ORM to provide that. Ideally Django should offer choices to users: if a user doesn't mind tearing down and building up a DB connection every time a request is processed, he could use non-persistent connection, but if he wants to save that time & reuse DB connection, he should be able to choose persistent connection. > if you've got enough traffic > through your app that the overhead of DB connections is problematic, > you should be using one of those tools. But this isn't about traffic at all. It's about latency, which has nothing to do with traffic. Amazon has done studies on the effects of response time. They varied the response times of their website and observed the resultant changes in user behavior. What they found is that for every 50ms increase in response time, the rate at which users order an item drops by 10%. Seen under this light, the additional 150ms latency resulting from non- persistent DB connection is huge - it implies almost 30% fewer customer orders. And it has nothing to do with traffic. I could be running a tiny e-commerce site. My traffic could be minimal. And I probably wouldn't have the expertise/time/money to run a pooling system for my tiny site. But I still wouldn't want to lose 30% of my orders just because I can't have persistent DB connections. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---