3

My stack set-up consists of the following:

  1. www.main.com - Main Server (Main Application code & supervisord)
  2. www.queue-server.com - Beanstalkd installed here (No code here only beanstalkd)

I'm using Laravel 4.2.

I have setup Supervisord on www.main.com and added the following queue listener:

php artisan queue:work--queue=test --env=test

My app/config/queue.php file settings are as below:

'beanstalkd' => array(
    'driver' => 'beanstalkd',
    'host'   => 'www.queue-server.com',
    'queue'  => 'test',
    'ttr'    => 60,
),

From my understanding, it should push & process jobs on www.queue-server.com server but it shows no cpu spikes there, but www.main.com server shows high cpu usage.

So my questions are:

  1. Is my setup correct? Or I have to change something?
  2. I want to process my job on www.queue-server.com server. How can I achieve that?
Alister Bulman
  • 34,482
  • 9
  • 71
  • 110
Ravikumar Sharma
  • 3,678
  • 5
  • 36
  • 59

1 Answers1

2

The beanstalkd server is just the storage of the queue data itself, it does no processing. Its the php artisan queue:work command that then processes the queue. This is why you are seeing the higher load on your www.main.com server as although your queue is stored on the other server, the main server is the one currently processing the queue.

If you wish for the www.queue-server.com server to process the queue you need to install your application there as well and run the artisan command from there.

Wader
  • 9,427
  • 1
  • 34
  • 38
  • Thanks Wader, ok I will make a copy of code on `www.queue-server.com` but user is going to use www.main.com only, thus `\Queue::push('myqueue',['data'])` code will executed on `www.main.com` only, will it work? – Ravikumar Sharma May 29 '15 at 06:53
  • Yup thats fine. Install your code on your queue server and just run the `queue:work` command there, that'll process your queue on your queue server and leave your main server for the web. – Wader May 29 '15 at 07:47