File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -96,3 +96,27 @@ COMMENT ON TABLE public.oban_jobs IS '10'"
96
96
97
97
Once the comment is in place only the migrations from that version onward will
98
98
run.
99
+
100
+ ## Database Queries from Every Queue Every Second
101
+
102
+ If every queue is polling the database every second, job staging has switched from efficient
103
+ **global mode** to **local mode**. In global mode, only the leader queries for jobs and notifies
104
+ queues via pubsub. In local mode, each queue polls independently.
105
+
106
+ This typically happens when:
107
+
108
+ 1. No node has leadership (common in development after restarts)
109
+ 2. Using PgBouncer with transaction pooling (disables pubsub notifications)
110
+ 3. Running using the `PG` notifier without clustering and functional pubsub
111
+
112
+ Look for these log messages confirming the switch to local mode:
113
+
114
+ ```
115
+ " job staging switched to local mode. local mode polls for jobs for every queue"
116
+ ```
117
+
118
+ ### Solutions
119
+
120
+ - Wait for leadership restablishment after a restart in development
121
+ - Use `Oban.Peers.Global` in development
122
+ - Fix clustering and pubsub notifications in production
You can’t perform that action at this time.
0 commit comments