Source: www.digitalsurgeons.com

Running Laravel Queue Workers with systemd

Category: Laravel, PHP

The official Laravel documentation for Queues suggests that you ensure your worker process remains alive using "a process monitor such as Supervisor". However, modern linux distributions provide a tool built in that will allow you to do just that, as well as collect the logs, control resource usage, and send off alerts when things go wrong.

However, it is also possible for that daemon to spawn per-user copies of itself that run as the user and have purview over processes that should only run for that user with that users permissions.

Searching the web for how to do this is not super productive, as there are a lot of manual ways to go about it, so I'm going to save you the hassle and show you how to create it in the right place in a single command.

I won't explain targets here as it is a bit of an esoteric concept, but suffice it to say that the target you select may be different if you are installing for root or in a non-standard configuration.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners