Choose your queue
The Worker page starts with the queue your app uses:
Both run the same way: the worker starts when jobs arrive and sleeps when the queue is empty.
Advanced is closed by default and shows only what the chosen queue needs:
- BullMQ: the key prefix (
bullby default) and the queue names. Leave the names empty to watch every queue under the prefix. - pg-boss: the schema (
pgbossby default) and the queue names. Leave the names empty to watch every queue.
Queues written with Bull (versions 3 and 4, the library BullMQ replaced) use the same Redis keys and work too. Choose BullMQ and list the queue names under Advanced: Bull queues cannot be found automatically.
BullMQ
pg-boss
Create it
- Open Hosting → Add-ons and select the Worker card. It opens the Worker page.
- Choose the queue.
- Enter the start command, as you would run it in a terminal, for example
npm run worker. - Choose a tier (see Hours and tiers) and select Create worker.
REDIS_URL and DATABASE_URL included), started with your command.
How it runs
- Waking. Meridian checks your queue about every 30 seconds. When jobs are waiting, the worker starts, usually within a minute. A delayed job wakes it when it is due.
- Sleeping. Once the queue is empty and no job is running, the worker goes to sleep. Jobs in progress finish first.
- pg-boss schedules. pg-boss only turns a schedule (a cron) into a job from a running process. Meridian reads your schedules and has the worker awake a few minutes before each one is due, so they fire on time. A schedule that runs every few minutes keeps the worker awake, and uses hours, around the clock.
Pause and resume
Pause on the Worker page stops the worker from waking. A job that is running finishes first, then the worker sleeps. Jobs added meanwhile wait in the queue. Resume lets it wake again.Settings
Hours and tiers
The Worker is sold by the hours it runs in a month. Hours count only while the worker is awake, across the app’s environments.
Every tier runs the worker on 1 vCPU. The worker’s memory comes from its tier, not from your app’s hosting size, so a small web app can run a 2 GB worker.
The Worker page shows the hours used this month:
- At 80% the page warns you and the organization’s owners get an email.
- At 100% the worker stops waking until the next billing period. The page says the hours are used up, and jobs wait in the queue. Move to a higher tier to start it again at once.
- The 730 hour tier covers the whole month, so it never runs out.