DEV Community

Cover image for Setting up Laravel Queue worker on Heroku
PostSrc
PostSrc

Posted on • Edited on

4 1

Setting up Laravel Queue worker on Heroku

Setting up Laravel Queue worker on Heroku is quite straightforward. All you have to do is define the queue configuration on the Procfile that’s located on the root level of the project directory as well as spin up a new Herokku dyno instance.

To define the queue, you have to name the queue first (which can be anything that you want) sqs: php artisan queue:work --timeout=1800 and then continue with the php artisan queue:work command to ensure it’s running.

You can also pass any of the flags that’s provided by the queue:work command depending on your needs. The next steps that you have to do is to deploy the Laravel application to Heroku so that your online application gets updated.

Next, you have to run heroku ps:scale web=1 sqs=1 --app your-heroku-app from your command line and this will ensure that your Laravel application has another dyno called sqs. Once you have done that, Heroku will be able to process your Laravel queues.

Article Originally written on: PostSrc (My personal Website)

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

Collapse
 
azazqadir profile image
Muhammad Azaz Qadir

Have you used Cloudways. It is also a PaaS, like Heroku, but it can do more. Users can host Laravel apps on top of cloud infrastructure providers using this managed platform.

Collapse
 
martin_52 profile image
Martingray

Yes, I used Cloudways, but the platform doesn't provide customization; it's like a take it or leave kind of deal mean while Devrims provide Managed Laravel Hosting with full customization options in clicks with advanced feature.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay