I'm trying to setup a Real Time Chat application with Laravel 4 as described here: https://xuri.me/2014/09/08/laravel-4-real-time-chat.html
I have a shared hosting account on Hostmonster with a dedicated IP address. I can SSH into the web server and start the BrainSocket Ratchet WebSocket server with an Artisan command, running it on port 8080. However, Hostmonster has a PHP process timeout of 2 hours.
I can avoid this by running the Artisan command to start the WebSocket Server as a PHP Daemon using Supervisor. Supervisor will also automatically restart the WebSocket server if it stops. My goal is to get the WebSocket Server running with Supervisor using something like this: https://xuri.me/2014/09/09/run-brainsocket-laravel-artisan-command-in-supervisor.html
I successfully installed Python (2.7.8) using this method. I installed Supervisor with Setuptools using the easy_install method. I tested that Supervisor was successfully installed in Python. I created a Supervisor config file (supervisord.conf).
Part of .bashrc file showing Python bindir and pythonpath:
export PYTHONPATH=$HOME/python/lib/python2.7/site-packages:$PYTHONPATH
export PATH=$HOME/python/bin:$PATH
When I enter the "supervisord" command in the Python bindir, Supervisor fails to start and I get the following error:
Traceback (most recent call last):
File "/home3/thecdeor/python/bin/supervisord", line 9, in
load_entry_point('supervisor==3.1.3', 'console_scripts', 'supervisord')()
File "/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py", line 366, in main go(options)
File "/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py", line 376, in go d.main()
File "/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py", line 70, in main rlimit_messages = self.options.set_rlimits()
File "/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/options.py", line 1316, in set_rlimits self.usage(msg % locals())
KeyError: 'min'.
I don't understand what this error means. I've searched the internet trying to figure it out but no one else seems to have this error.
When I enter the "supervisorctl" command in the Python bindir folder, I get the following error:
unix:///home3/thecdeor/python/bin/tmp/supervisor.sock no such file
I'm baffled by these errors. Can anyone help? I would post more links if my current reputation allowed me to do so. Please let me know if you need more server info or any other info. I've never posted on StackOverflow before and I've never had a problem like this so I'm not quite sure what and how much info to post.
I had the same problem and it turned out to be a problem with the maximum number of processes supervisor could create in my system. This number is specified in the parameter minprocs defined within the section supervisord in supervisor.conf.
By default supervisor sets this parameter to 200, which, in my case, represents the hard limit of processes a certain process can create in my system. Because of this, the call to the function: resource.setrlimit(resource, limits)
within the method set_rlimits of the class ServerOptions defined in the Options module (options.py file) raises the exception ValueError.
Solution. The error message isn't very informative and even misleading. Anyways, to solve the issue, I just reduced by half the maximum number of processes supervisor can create within my system.
minprocs=100 ; (min. avail process descriptors;default 200)
For more information you can take a look at the documentation of python's resource module.