Running beanstalkd worker on a remote server

My stack setup consists of the following files: Machine1 - Main server (Launch laravel)
Machine2 - MySql server for larvel
codebase Machine3 - Beanstalkd worker

I have a Supervisord setup on Machine1 and added the following queue listener

[program:queue1]
command=php artisan queue:listen --queue=queue1 --tries=2
...

      

My laravel queue config file (app / config / queue.php) reads the following

'beanstalkd' => array(
    'driver' => 'beanstalkd',
    'host'   => '--- Machine3 IP ---',
    'queue'  => 'queue1',
    'ttr'    => 60,
),

      

And I have installed beanstalkd on Machine3 along with the Beanstalk console and see my tasks get queued and run successfully. However, I'm not sure if Machine3 actually does them, and the reason for my suspicion is the high CPU usage on the main server compared to the no spikes in CPU usage on Machine3 >

I shutdown my beanstalkd server completely to check if the queue is still processing and the result was an error message reported by laravel indicating that it cannot connect to the beanstalkd server.

I read somewhere that you need to have your larvel database on beanstalkd server ( Machine3 ) too, was that really the case?

+3


source to share


1 answer


Depending on which machine you run queue:listen

on on, this is the machine that does the actual queue processing.

At the moment, all you are doing is storing queues on machine3 , but processing them on machine1 .



So you need machine3 to run the command queue:listen

if you want it to handle the queue.

+2


source







All Articles