Any supervisord experts here?

61 views
Skip to first unread message

Jason Judge

unread,
Oct 16, 2015, 1:23:07 PM10/16/15
to PHPNE
I'm assuming supervisor is what I need, but if there are better alternatives, then I'd be happy to look at those.

I have a CentOS 6.6 server running Plesk 12, PHP5.6 and an application in Laravel 5.1.

We have a number of queues, and would like to keep the Laravel queue listener up and running, listening on those queues. That's it. There will be batches of stuff to process at regular intervals, but nothing that any kind of optimisation is needed for at this time (e.g. not using Laravel daemon mode for the listeners, and are happy with the slower throughput).

The problem I've had, is that no instructions for installing and setting up supervisor are complete. All the articles I can find are a summary of one person's environment, with steps that work for them, but not for me. So is there anybody here who has set this up, knows what the issues are, and can interpret the subsequent Linux errors/dependencies/missing libraries etc. and know how to handle them? Once one listener is up and running, I should be able to set up further listeners (each queue has its different retry and delay conditions).

I should be at PHPNE on Tuesday, so can catch you then if you are there. Thanks.

-- Jason

se...@kinocreative.co.uk

unread,
Oct 16, 2015, 1:23:13 PM10/16/15
to php-nor...@googlegroups.com
I'm out of the office until 20th October. Please contact si...@kinocreative.co.uk - 0191 298 6195 if you have any questions.

Thanks,

Seth



oli wood

unread,
Oct 16, 2015, 1:28:17 PM10/16/15
to php-nor...@googlegroups.com

I've done quite a bit with supervisor over the years. The version bundled in distros is often old and sometimes missing init scripts etc. It is however an ace tool.

I'll fire up a centos box and try and post a gist up.

--
You received this message because you are subscribed to the Google Groups "PHPNE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-north-eas...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

oli wood

unread,
Oct 17, 2015, 9:43:58 AM10/17/15
to php-nor...@googlegroups.com
https://gist.github.com/coldclimate/b9a47aa86fb5dcc79ea1

I didn't create an actual job but supervisord comes up cleanly.

Hope this helps,
Oli
--
@coldclimate | http://www.coldclimate.co.uk

Q: Why is this email three sentences or less?
A: http://three.sentenc.es

se...@kinocreative.co.uk

unread,
Oct 17, 2015, 9:44:02 AM10/17/15
to php-nor...@googlegroups.com

Jason Judge

unread,
Oct 17, 2015, 12:16:34 PM10/17/15
to PHPNE
On Saturday, 17 October 2015 14:43:58 UTC+1, oli wood wrote:
https://gist.github.com/coldclimate/b9a47aa86fb5dcc79ea1

I didn't create an actual job but supervisord comes up cleanly.

It certainly does :-)

So I would put the details for each process to supervise into /etc/supervisord/conf.d/*.ini and add supervisord to the appropriate run state, and the job's a good 'un. The last instructions I followed involved running /usr/bin/supervisord from the command line to confirm it was set up correctly before creating the init.d script. I never got past that step without errors.
 
Hope this helps,

This was more than I was expecting - much appreciated and consider there to be a bunch of beer tokens with your name on next time we meet up.
 

James Thomson

unread,
Oct 17, 2015, 12:58:20 PM10/17/15
to PHPNE
Hi Jason,

I use supervisord at work to control almost all server processes including httpd and fpm - it's certainly rock solid.

Can't add much to the above, but the -n flag on supervisorctl is pretty useful - can start supervisord in the foreground and watch what it's doing. Most of the errors I had whilst setting it up involved instructing supervisor to stop a process only to find it's still running.

So had to tweak the signal via the "stopsignal" directive. 


Once configured it really can be left alone. As you can see from the example at the URL above, it can manage it's own logs per process too.

Feel free to shout on here if you have any specific issue, chances are I've had to battle around it.

(See also http://laravel.com/docs/master/queues#supervisor-configuration - might help structure the command)

Cheers,

James

oli wood

unread,
Oct 18, 2015, 4:30:20 PM10/18/15
to php-nor...@googlegroups.com
>So I would put the details for each process to supervise into /etc/supervisord/conf.d/*.ini 
Yup.

se...@kinocreative.co.uk

unread,
Oct 18, 2015, 4:30:24 PM10/18/15
to php-nor...@googlegroups.com

oli wood

unread,
Oct 18, 2015, 4:30:47 PM10/18/15
to php-nor...@googlegroups.com
I think Seth might be out of the office

--
You received this message because you are subscribed to the Google Groups "PHPNE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-north-eas...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Judge

unread,
Oct 19, 2015, 6:11:03 AM10/19/15
to PHPNE
On Saturday, 17 October 2015 17:58:20 UTC+1, James Thomson wrote:
Hi Jason,

I use supervisord at work to control almost all server processes including httpd and fpm - it's certainly rock solid.

Can't add much to the above, but the -n flag on supervisorctl is pretty useful - can start supervisord in the foreground and watch what it's doing. Most of the errors I had whilst setting it up involved instructing supervisor to stop a process only to find it's still running.

So had to tweak the signal via the "stopsignal" directive. 


Once configured it really can be left alone. As you can see from the example at the URL above, it can manage it's own logs per process too.

That was certainly the hope. We have queues processing transactions, creating files and transferring files, and the people who are interested in that data at each stage are keeping their eye on it, so I'll be the first to know if anything stops working, even without monitoring supervisor.
 

Feel free to shout on here if you have any specific issue, chances are I've had to battle around it.

(See also http://laravel.com/docs/master/queues#supervisor-configuration - might help structure the command)

I think this needs a bit of expansion - it just kind of says "use this, whatever, now go away" and the result is often that cron is used and recommended to handle queue workers instead (which I had to do for a couple of days while sorting out supervisor, and I feel dirty now).

So thanks (all) for your help. It's all running like clockwork now. And Seth - you back in the office, or what?
 

se...@kinocreative.co.uk

unread,
Oct 19, 2015, 6:11:09 AM10/19/15
to php-nor...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages