As you know, Django  <https://www.djangoproject.com/>uses new database
connection for each request. This works well initially. However as the load
on the server increases, creating/destroying connections to database starts
taking significant amount of time.  You will find many questions about
using some kind of connection pooling for Django on sites like
StackOverflow   <http://stackoverflow.com/>For example, Django persistent
database connection.
<http://stackoverflow.com/questions/1125504/django-persistent-database-connection>

At BootStrapToday <http://bootstraptoday.com/> we use
sqlalchemy<http://www.sqlalchemy.org/>‘s
connection pooling mechanism with Django for pooling the database
connections. We use variation of approach by Igor
Katson<http://stackoverflow.com/users/37511/igor-katson> described
in http://dumpz.org/67550/.  Igor’s approach requires patching Django which
we wanted to avoid. Hence we created a small function that we import in one
of __init__.py (or models.py) (i.e. some file which gets imported early in
the application startup).

Here is more detail on how we do it at
BootStrapToday<http://blog.bootstraptoday.com/2012/07/11/django-connection-pooling-using-sqlalchemy-connection-pool/>


Regards
Anand
http://bootstraptoday.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to