2010 py ohio supervisor talk

1,351 views
1,296 views

Published on

Supervisor is a Python daemon that can control arbitrary processes in a UNIX-like environment. It features a client/server model of control that can easily be extended. This talk will cover the configuration and setup of Supervisor. It will also cover how to extend Supervisor and take advantage of its XML-RPC interface and ability to react to events that it generates.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,351
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
28
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

  • Pure Python
    Simple, centralized, efficient, extensible, compatible, proven
    Maintainable Software - Mike
    Agendaless - Chris

    Accuracy

  • supervisord
    supervisorctl
  • tail -f (stderr)

    utilize the supervisor namespace
    supports XML-RPC multicall API - encapsulate multiple calls to a remote server into a single request
  • stop processes, reload config

    close and re-open log files, rotate log files
  • manages complete lifetime of child processes

    can't daemonize

    for daemons that can't

  • stdout
  • Supervisor Cache can prevent the synchronization headaches you might have using the filesystem or a database to accomplish the same task

    manipulated in ways that are not normally possible at runtime.
  • need to mention superlance
    Supervisor sends specially-formatted input to an event listener process' stdin and stdout
    supervisor maintains state of event listeners, busy, ready, acknowleged

    starting, running, backoff, stopping, exited, stopped, fatal, unknown

    stdout, stderr

    watches for tags in process output, stdout and stderr

    running, stopping

    5, 60, 3600

    event listeners can be in any lang, but supervisor contains a support lib to make this easy.
  • need to mention superlance
    Supervisor sends specially-formatted input to an event listener process' stdin and stdout
    supervisor maintains state of event listeners, busy, ready, acknowleged

    starting, running, backoff, stopping, exited, stopped, fatal, unknown

    stdout, stderr

    watches for tags in process output, stdout and stderr

    running, stopping

    5, 60, 3600

    event listeners can be in any lang, but supervisor contains a support lib to make this easy.


  • 2010 py ohio supervisor talk

    1. 1. Controlling UNIX Processes using Supervisor Calvin Hendryx-Parker PyOhio 2010 nowhere to go but open source s i xf e e tu p . c om
    2. 2. Supervisor Overview • Convenience • Delegation • Distributed Control • Process Groups sixfeetup.com
    3. 3. Similar Tools • launchd • daemontools • runit sixfeetup.com
    4. 4. Installation and Configuration • virtualenv! • Installation via setuptools • Configuration File Details • Overview of the major sections • Group Processes sixfeetup.com
    5. 5. Running Supervisor • Command line • Web Interface • XML-RPC sixfeetup.com
    6. 6. supervisord Signals • SIGTERM, SIGINT, SIGQUIT • SIGHUP • SIGUSR2 sixfeetup.com
    7. 7. Subprocesses • supervisord is the parent process • Child Processes • pidproxy sixfeetup.com
    8. 8. Subprocess States sixfeetup.com
    9. 9. Logging • Activity Log • Child Process Logs sixfeetup.com
    10. 10. Utilizing XML-RPC • Remote Control of Supervisor • Extending Supervisor • supervisor_cache • supervisor_twiddler sixfeetup.com
    11. 11. Event Notifications • Types of Events • PROCESS_STATE • REMOTE_COMMUNICATION • PROCESS_LOG • PROCESS_COMMUNICATION • SUPERVISOR_STATE_CHANGE • TICK sixfeetup.com
    12. 12. Event Notifications • supervisor.childutils • Example usage of events • Monitor resource usage • Span new processes based on usage sixfeetup.com
    13. 13. Resources • http://supervisord.org • http://pypi.python.org/pypi/supervisor • http://pypi.python.org/pypi/ collective.recipe.supervisor • http://pypi.python.org/pypi/superlance • http://pypi.python.org/pypi/supervisor_cache • http://virtualenv.openplans.org/ • http://docs.repoze.org/bfg/1.3/narr/firstapp.html sixfeetup.com
    14. 14. Questions? Thank you! nowhere to go but open source s i xf e e tu p . c om

    ×