yannk / ControlFreak

a process supervisor in Perl

This URL has Read+Write access

name age message
file .gitignore Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
file .shipit Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
file Changes Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
file MANIFEST Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
file MANIFEST.SKIP Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
file Makefile.PL Fri Nov 20 11:16:23 -0800 2009 Requires Find::Lib for cfkd [yannk]
file README Thu Dec 17 20:16:48 -0800 2009 Better README. What is ControlFreak? and how d... [yannk]
file cfk-share-mem-proxy.pl Fri Nov 20 10:05:59 -0800 2009 Cleanup. Adds deps to Makefile.PL [yannk]
file cfkctl Wed Nov 18 16:25:15 -0800 2009 Adds shutdown to cfkctl [yannk]
file cfkd Fri Nov 20 11:16:23 -0800 2009 Requires Find::Lib for cfkd [yannk]
directory lib/ Wed Dec 30 12:45:15 -0800 2009 double while loop for blocking select Closes #... [yannk]
directory t/ Sat Dec 19 21:51:30 -0800 2009 a proxied service should just be a single file ... [yannk]
directory xt/ Wed Sep 30 10:31:08 -0700 2009 initial import [yannk]
README
This is WORK IN PROGRESS. Documentation is messy as well,
don't hesitate to shoot questions directly.

What is ControlFreak?
=====================

  see also: - lib/ControlFreak/Tutorial.pod
            - lib/ControlFreak.pm (pod)

ControlFreak's intent is to help you really control your (web) app (in
production and in development) and your resources effectively.

It's a process supervisor:

- It fixes the mess of pid file management
- It facilitates the roll-forward and backward of releases
- It optionally controls the resources that your app needs
  (essentially sockets) and make these resources available to your app using
  a push model
- ... and many other benefits like flexible logging/monitoring of everything

It supervises any type of services. Examples:

In Dev:
- memcached
- gearmand
- perlbal
- plack
- workers
- ddlockd

In Prod:
- gearman workers
- schwartz workers
- plack (web) workers)
- (or, apache if you prefer)

How does it work?
=================

It is a pure Perl implementation consisting in:
- a controlling process: cfkd, which runs an AnyEvent loop usually running
  in the background
- a command line tool to talk to it: cfkctl
- a configuration file (just a bunch of commands really)

cfkd forks to start (exec) the services it controls.

Optimally, cfkd binds sockets and share them with workers before forking
(known as pre-fork module), it can also make you benefit from Copy On Write
effect (sharing memory between all your workers for instance).

At your command cfkd, restarts, stops, kills any service.