views:

558

answers:

2

Hi folks,

I'm trying to implement persistent database connection pool with django. One of the options is to use built in psycopg2.pool code which provide different types of pools (PersistentConnectionPool, ThreadedConnectionPool etc ), but there is no psycopg2 documentation on that topic.

So, do anyone done any work in this direction or have some working code? I just don't want to reinvent the wheel.

Thanks.

+2  A: 

Django has no support for connection pooling. Technically you could probably write a django db backend that used psycopg2, but I think you'd be much better off using an external process for connection pooling. Take a look at pgpool for this.

Alex Gaynor
Using pgpool won't eliminate this overhead because python still needs to connect to database same way on each request.
HardQuestions
A: 

BTW you can check this question, it may help.

NilColor
Thanks, but that was also my question where I'm answered myself :)
HardQuestions