I'm wondering what's preferred (how does friendfeed) way of
controlling tornado-based service.
In production there are several common tasks to perform with any
service:
- start
- stop
- reload/restart (in case of config change)
- query status (is service running?)
I'm especially interested in "stop" and "status" actions.
At the moment I've implemented this actions as special url-handlers.
I.e. starting of server means starting several processes by the number
of cores on individual ports (8000-8003 for example). Then "stop"
means something like "curl localhost:$port/stop/" for $port in
8000-8003.
I do not really like this approach, but I cannot think of anything
more elegant.
So what is your way of managing tornado-based services?
I haven't tried supervisord (http://supervisord.org/), but it looks
interesting. It's written in Python, so it must be good, right?
On Jan 11, 11:29 pm, Bret Taylor <btay...@gmail.com> wrote:
> We use standard Unix methodology to start/stop/restart/etc (PID files, etc).
> We ping by curl'ing a known URL.
>
The only thing I don't really like that it introduces another way of
managing processes alongside with /etc/init.d/$service approach.
On Jan 12, 12:02 am, Deepankar Sharma <deepankar.sha...@gmail.com>
wrote:
> I am setup a supervisord + tornado machine some time back following
> that tutorial and everything works fine and dandy. if you run into any
> issues just ping me and I will try to help.
>
>
>
> On Mon, Jan 11, 2010 at 3:58 PM, Matthew Ferguson <mbf...@gmail.com> wrote:
> > Supervisord (http://supervisord.org) is great for these situations, along with its own init scripts. You can check out a tutorial on exactly such a thing athttp://www.jeremybowers.com/blog/4/tornado-web-framework-production-d...
>
> > On Jan 11, 2010, at 12:55 PM, Gabriel Farrell wrote:
>
> >> I don't know what Bret uses, but daemontools
> >> (http://cr.yp.to/daemontools.html) is widely employed for this kind of
> >> thing. A little tricky to set up, but it handles starting, stopping,
> >> logging, etc.
>
> >> I haven't tried supervisord (http://supervisord.org/), but it looks
> >> interesting. It's written in Python, so it must be good, right?
>
> >> On Mon, Jan 11, 2010 at 3:29 PM, Bret Taylor <btay...@gmail.com> wrote:
> >>> We use standard Unix methodology to start/stop/restart/etc (PID files, etc).
> >>> We ping by curl'ing a known URL.
> >>> Bret
>
9126 ? Ss 0:00 /usr/bin/python /usr/local/bin/supervisord
9548 ? S 0:01 \_ /usr/bin/python -W
ignore::DeprecationWarning /rinjani/app/main.py --port=9999 --
logging=error
9555 ? S 0:00 \_ /usr/bin/python -W
ignore::DeprecationWarning /rinjani/app/main.py --port=9999 --
logging=error
9556 ? S 0:00 \_ /usr/bin/python -W
ignore::DeprecationWarning /rinjani/app/main.py --port=9999 --
logging=error
after supervisorctl stop:
9126 ? Ss 0:00 /usr/bin/python /usr/local/bin/supervisord
9555 ? S 0:00 /usr/bin/python -W
ignore::DeprecationWarning /rinjani/app/main.py --port=9999 --
logging=error
9556 ? S 0:00 /usr/bin/python -W
ignore::DeprecationWarning /rinjani/app/main.py --port=9999 --
logging=error
i have no idea about process/fork. what happen?
Yes, that's what I experienced too.
I'm able to successfully stop or restart the forked processes by
adding
"stopsignal=INT" to the command configuration.
cheers
Klokie
> In any case, you should go ahead and file a bug on github, if anyone doesn't
> object.
>
> _steve
>