On Aug 27, 2010, at 1:17 PM, jai_python wrote: > Hi friends, > My django application runs in red hat server with apache & > mod_wsgi. We have several request which interacts with > database(postgresql), so database interaction is huge. i found that > every time django application establishing a new connection to > interact with DB. So my server hanging often due to large number of DB > connection (approximately some 200-250 connection/minute, it may > increase gradually) > Its very urgent. Hope I will get support here.... > Thanks for looking my thread. > > > Thanks & Regards, > Jayapal D
Hi Jayapal, What you want is a connection pool for Postgres. Happily, such exists in the form of pgpool-2: http://pgpool.projects.postgresql.org/ The way it works is pgpool-2 runs as a separate daemon and spawns a configurable number of database connections. You configure pgpool-2 to listen for incoming database connections on whatever port you prefer, 5433 for example, and you tell it to talk to your database on e.g. port 5432. In your Django settings, you use the standard "postgresql_psycopg2" driver and tell it to connect to the database via port 5433. Django then uses the pooled connections, and you don't have to worry about the overhead of setting up new connections or tearing down old ones. Hope that helps, ---Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.