jeffreyvanrossum
5 months ago
321
3
Laravel

Best practice using Queue on shared hosting

Posted 5 months ago by jeffreyvanrossum

Hi everyone,

To start of, I know that shared hosting with limited abilities is not best practice in the first place (:-)), but unfortunatly that is the situation I'm dealing with at the moment.

I'm trying to get the queue-system working (using the database) on a shared hosting, and thought I'd do that by adding a command to the kernel class.

$schedule->command('queue:work --tries=3')
            ->cron('* * * * * *')
            ->withoutOverlapping();

Then I have a cron job running every minute to run artisan schedule:run.

This works, but only for a limited amount of time. It then just adds jobs to the queue but they are no longer processed. I know that removing withoutOverlapping might solve it, but that will probably result in memory issues.

Long story short: does someone here have any experience setting up queues in a shared hosting enviroment, and if so, how did you configure it? Any ideas on setting this up are welcome to of course.

Please sign in or create an account to participate in this conversation.