Ramifications of Lowering dequeue_timeout
#359
|
I'll start by saying I'm a big fan of pgqueuer, keep up the good work! I have a question on the ramifications of lowering the Does lowering the |
Replies: 1 comment 1 reply
|
Thanks for the kind words—and for digging into this! Under the hood, the QueueManager uses two mechanisms to decide when to pull jobs:
Why we need that periodic pollPostgres’s Why
|
Thanks for the kind words—and for digging into this!
Under the hood, the QueueManager uses two mechanisms to decide when to pull jobs:
NOTIFYthe channel after enqueueing.dequeue_timeoutto look for work that’s become ready (i.e. jobs whoseexecute_aftertimestamp has just passed).Why we need that periodic poll
Postgres’s
LISTEN/NOTIFYis a best-effort broadcast, not a guaranteed message queue. Missing notifications can occur if the listener temporarily disconnects (for example, during a network hiccup or failover). Thedequeue_timeoutsafety-net ensures that, even if a notification is dropped or delayed, the manage…