Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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:


psycopg by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group