psycopg2 hang with multithread frequent queries

From: David Roid <dataroid(at)gmail(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: psycopg2 hang with multithread frequent queries
Date: 2012-09-14 16:45:04
Message-ID: CAKN1bq7fLb_V2nQCa0-DSsAyAghtUPG-BgODuyPOCVAR9M6Y4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Greetings list,

I'm using psycopg2, python2.7.3 threading along with pgsql 9.1.5. I noticed
that if I have my python process query against the database kind of
frequently, say more than 1 query per second, it's almost 100% sure to hit
some problem, but first some backgroud:

1. There are three threads, each with many SELECT/UPDATE, a little bit
INSERT, only one explicit 'LOCK TABLE'
2. One of threads queries the db every second (easier to reproduce this way)
3. The other two do their queries like every 10~30 seconds
4. It doesn't matter whether the threads share one connection or with
separate connection,

And there are two kind of symptons:
1.

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2012-09-14 16:53:12 Re: psycopg2 hang with multithread frequent queries
Previous Message Oliver Beattie 2012-09-07 10:05:24 Re: Tracebacks with gevent and set_wait_callback go "missing"