Re: psycopg2 hang with multithread frequent queries

Поиск
Список
Период
Сортировка
От David Roid
Тема Re: psycopg2 hang with multithread frequent queries
Дата
Msg-id CAKN1bq4hJQXykyoQjFe2Ee3H9_CdVJ-1g6pXA7-qRc4yhwPJkA@mail.gmail.com
обсуждение исходный текст
Ответ на psycopg2 hang with multithread frequent queries  (David Roid <dataroid@gmail.com>)
Ответы Re: psycopg2 hang with multithread frequent queries  (Federico Di Gregorio <fog@dndg.it>)
Re: psycopg2 hang with multithread frequent queries  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
Sorry I didn't finish it..

And there are two kind of symptons after the process running for a couple of minutes:
(0. At first it seems ok, each thread does its job, the quick one with more logs of course)
1. The quick one keeps running, the other two get no chance being called any more
2. When one of the slow ones get called, the whole python process hang, with the postgresql process in 'idle in transaction'; note i'm very alert with psycopg2's all-in-transaction style, i'm very sure there is a commit/rollback to end the trac, the python process just stucks!

I'm doing this test/investigate with freeload, so CPU/code conditions should not be a cause, i'm starting to suspect psycopg2 or postgresql, any hint?

Thanks and Regards
-David

2012/9/15 David Roid <dataroid@gmail.com>
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.

В списке psycopg по дате отправления:

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: psycopg2 hang with multithread frequent queries
Следующее
От: David Roid
Дата:
Сообщение: Re: psycopg2 hang with multithread frequent queries