> For the complete documentation index, see [llms.txt](https://shoppinpal.gitbook.io/docs-shoppinpal-com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoppinpal.gitbook.io/docs-shoppinpal-com/9.-queues-and-workers/php-workers-in-aws-ebs.md).

# PHP workers in AWS EBS

## PHP

![](https://299721776-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBPk9Ii0WH-txgubgY2%2F-LBPkEsjuKBT4BqsRiAN%2F-LBPkSSVMpmpseDqTWRb%2FWorker%20architecture.png?generation=1525162302700805\&alt=media)

1. `messages` are sent to SQS.
2. A static amount (configurable) of PHP `workers` are kept alive by the `Supervisor`.
   * Given the nature of PHP, we optimize `workers` to stop and restart every X minutes.
3. While workers are running, they attempt to fetch messages from SQS.
   * If a `worker` gets a `message` then it starts working on that job and takes it to completion.
   * If a `worker` crashes while processing then the `Supervisor` will bring it back up.
     * What will happen to the message that was pulled off the queue by that "crashed" `worker`?
     * Will the resurrected worker start work on the same exact `message` again?

![](https://299721776-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBPk9Ii0WH-txgubgY2%2F-LBPkEsjuKBT4BqsRiAN%2F-LBPkSWhkIfCtp8MQWQ_%2FWorker%20timeline.png?generation=1525162302752821\&alt=media)
