Postgresql the right tool (queue using advisory_locks + long transactions)

Поиск
Список
Период
Сортировка
От Dorian Hoxha
Тема Postgresql the right tool (queue using advisory_locks + long transactions)
Дата
Msg-id CANsFX049q7C_vJAtn2BSJy_4hQPu0=JNtv-Lyzb=gbZu-be30A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Postgresql the right tool (queue using advisory_locks + long transactions)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Postgresql the right tool (queue using advisory_locks + long transactions)  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
Hi list,

I am trying to use postgresql as a queue for long-jobs (max ~4 hours) using advisory_locks. I can't separate the long-job into sub-jobs.

  1. At ultimate-best-case scenario there will be ~100 workers, so no web-scale performance required.
    Is there a problem with 100 open sessions (behind a connection pooler?) for hours like in my case?
    The session will commit the progress of the job, but will stay opened and hold the advisory_lock till the job is done or it expires (look 2).
  2. Is it possible to set a time limit to auto-close an opened session that hasn't made a query in a while ?
    So if a worker fails,and the session time-outs, postgresql/pgbouncer will close the session and release the lock ?

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

Предыдущее
От: Rafał Pietrak
Дата:
Сообщение: Re: a row not deletes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgresql the right tool (queue using advisory_locks + long transactions)