ワーカー
キューから来たタスクでコードを動かします。ユーザーが待つことはありません。エクスポートが読むデータにリンクさせてください。
このページはまだ日本語に翻訳されていません。
The Worker stands for a background job runner such as Sidekiq: your code, off the request path.
When to place it#
Place a Worker when you place a Queue, because without one tasks have nowhere to go.
Add copies when Queue depth keeps growing.
How it works#
It pulls tasks from a Queue and runs the async part of each kind. It sends read and write queries, object puts, push messages, and calls to customer servers. It runs the same runtimes and frameworks as an App Server, with an instance type and size. Users never wait for it, and its throughput decides whether the Queue drains or grows.
An export runs many read queries in its task, and an upload stores its file, so link the Worker to the data it reads and writes: the Database, a Cache, a Read Replica, and Object Storage. Link it to the Push Provider for notifications.
Options#
| 設定項目 | 設定値 | 表示条件 |
|---|---|---|
| ランタイム | 28 種類のランタイム | 常時 |
| フレームワーク | 30 種類のフレームワーク | 常時 |
| プールサイズ | ワーカー 1 つ以上 | プールありのランタイム |
| プロセスマネージャ | 静的 / 動的 / オンデマンド | PHP-FPM |
| ワーカーの再起動 | オフ / 数時間ごと | 常駐するランタイム |
| 圧縮 | オフ / Gzip | 圧縮の後 |
| サービス | すべてのサービス | サービスが 2 つ以上 |
| プリフェッチ | 1 / 10 / 100 | 常時 |
The Stack controls work as they do on an App Server. A Worker fills its pool with tasks instead of requests, and a task holds a worker for as long as it runs, including every backend call it waits on.
Pool size: how many tasks run at once. More workers drain the Queue faster, hold more memory, and cost more CPU when the tasks compete for it.
Process manager: PHP-FPM's rule for which workers stay running. Static keeps the whole pool resident, Dynamic keeps two spares, and On demand keeps only the busy workers. The trade is the same: idle RAM against a short wait for a fork.
Recycle workers: restarts each process now and then, which caps a leak and costs a cold start. A planned restart hands its prefetched tasks back first.
Prefetch: how many tasks each worker takes from the Queue ahead of time. A higher prefetch spends less time waiting on the broker, and a crash loses more.
How it fails#
Too slow, and the Queue backlog grows until its max length refuses new tasks.
A crash loses the tasks it had prefetched. A planned restart hands them back first.
Instance failure#
Signs: The Worker's card goes grey, its Inspector reads "The host under this VM died. It still bills.", and the requests sent to it are stranded.
Do now: Press Replace in its Inspector and pay the price. It comes back cold.
Prevent: Run a second copy: Load balancing puts the copies behind a Load Balancer, and Health checks skip the dead host. A copy inside a Cluster is rescheduled by itself.
Zone outage#
Signs: Every Node in one zone goes grey at once.
Do now: Nothing brings the zone back sooner. Fail over promotes a Standby, and this Component keeps none, so it ends on its own after at most 120 s.
Prevent: Research Multiple zones, then put copies in different zones with the Zone setting.
Region outage#
Signs: Every Node in one region goes grey at once, and that region's board goes grey with them.
Do now: Press Fail over on the banner. It needs Multiple zones and a second open region, and starts the Node again in the nearest other region, cold, for the price of a replacement. Otherwise it comes back when the incident ends: 180 sim seconds in the catalog, 60 once the error budget counts.
Prevent: Research Multiple regions and GeoDNS, then run a copy of it in a second region.
Poison message#
Signs: The Queue's depth climbs without end while Workers stay busy, and its Inspector reads "A task keeps failing. Workers retry it forever."
Do now: Select the Queue and press Delete message. With a dead-letter queue on, nothing is needed; it ends on its own after at most 120 s.
Prevent: Turn on the Dead-letter queue on the Queue and set max attempts. No Research is needed.
Spot reclaim#
Signs: Its Inspector reads "The provider reclaims this Spot Node in N s. Replace it with on-demand." After 10 s the Node goes grey.
Do now: Press Switch to on-demand before the warning runs out. Otherwise it comes back by itself once the incident ends.
Prevent: Keep Nodes on the request path on On-demand or Reserved pricing, and use Spot only on a fleet that can lose a Node.
Bad deploy#
Signs: The error rate jumps right after a deploy, and a "Bad deploy" banner appears with a Roll back button.
Do now: Press Roll back on the banner. It needs Continuous delivery; without it the incident ends on its own after at most 120 s.
Prevent: Research Continuous delivery and Automated tests. A Canary deploy strategy and Feature Flags cap how much a bad deploy breaks.
Bad config push#
Signs: App Servers and Workers crash together, and a "Bad config push" banner appears with a Roll back button.
Do now: Press Roll back on the banner. They restart on the old config.
Prevent: Research GitOps and stage the rollout, so a push reaches one region first.
Connection exhaustion#
Signs: The Database's card reads "Refusing N queries/s: too many connections."
Do now: Nothing on the App Servers ends it; it ends on its own after at most 40 s. A Connection Pooler between the App Servers and the Database caps the connections it holds.
Prevent: Research Connection pooling and place a Connection Pooler in front of the Database.
Tips#
Link Workers to an Autoscaler to follow the backlog.
Keep prefetch low on Workers that crash often.
ルール#
- 追加のコピーは 1 つ前より 25% 高くなります。
- 売却すると、最後のコピーの価格の 50% が戻ります。
- インスタンス種別がサイズと支出を決めます。サイズを 1 段上げるとリソースと支出が倍になります。
- 新しいコピーはコールドスタートで、温まるまで遅いままです。
一緒に使えるもの#
アプリサーバー、データベース、コネクションプーラー、キャッシュ、リードレプリカ、オブジェクトストレージ、キュー、サーバーレス関数、オートスケーラー、プッシュプロバイダ
次に取るリサーチ#
バックグラウンドジョブを手に入れると、次のリサーチがそれを土台に進みます。
セキュリティ#
これらの脆弱性がこのコンポーネントを狙います。猶予期間が終わる前にパッチを当てます。
- CVE-2026-0042, CVSS 5.3
- CVE-2026-1024, CVSS 9.9