The Fat Controller v0.0.3 released!

Finally, after almost five months, version 0.0.3 is ready!

There are plenty of changes, mostly bug fixes which relate to startup options (not the actual running of The Fat Controller) and a new thread model – fixed interval – which runs processes like cron at fixed, regular intervals between each new process creation.

Here are some highlights from the changelog:

ADDED Fixed interval thread model
The ‘independent thread model’ and ‘dependent thread mode’ start another instance of the target program a specified number of seconds after the previous instance ends. The ‘fixed interval thread model’ starts another instance a specified number of seconds after the previous instance starts, hence the interval beteen new instances is fixed. The interval is specified using the -s,--sleep argument, just as for the other thread models. Note that the interval is respected even if a process returns status 64. Only if a process returns a status of -1 will the interval specified by -e,--sleep-on-error be used.

ADDED Long running instance termination
Using the --proc-run-time-max argument, it is now possible to specify that an instance be terminated if it runs longer than the specified number of seconds. Default behaviour is never to terminate processes unless the main Fat Controller process is requested to shutdown. (Processes terminated by sending SIGTERM). It is advised to specify this argument.

Plans for v0.0.4
I’ve already drawn up a rough list of features and improvements for v0.0.4, the most important being changing the logging of sub-processes. Rather than collecting from STDOUT and writing everything to the log file once a sub-process ends, The Fat Controller will continually write whatever arrives from STDOUT and STDERR to log files. This will make things much better for long running sub-processes.

If you have any ideas or suggestions then please comment or file a report on the Sourceforge Fat Controller tracker page:

This entry was posted in The Fat Controller. Bookmark the permalink.

8 Responses to The Fat Controller v0.0.3 released!

  1. Beau says:

    This is a great piece of work. I have been looking for a simple alliterative to gearman, zeromq etc. I got this up and running in minutes.

    Question. Is it possible to run multiple separate scripts? i.e.

    ARGUMENTS[0]=”-f backgroundJob.php — –items-to-process=10″
    ARGUMENTS[1]=”-f otherbackgroundJob.php — –items-to-process=5″

    I couldn’t tell from the docs.

    Thanks again for your work. Keep it up.

  2. Nick says:

    Hello – thanks for the feedback, it makes such a difference to know that The Fat Controller is useful for people! Version 0.0.4 is already in development.

    It is possible to run multiple scripts, for this you need to make a separate configuration for each – start by making a copy of the default Fat Controller config file:

    sudo cp /etc/fatcontroller /etc/fatcontroller_job1
    sudo cp /etc/fatcontroller /etc/fatcontroller_job2

    Now you can edit these new config files to specify the correct scripts and parameters.

    To start and stop them, you specify the configuration file as the second parameter to the init script, for example:

    sudo /etc/init.d/fatcontrollerd start /etc/fatcontroller_job1
    sudo /etc/init.d/fatcontrollerd stop /etc/fatcontroller_job1
    sudo /etc/init.d/fatcontrollerd status /etc/fatcontroller_job1

    If the second parameter isn’t specified then The Fat Controller uses the default config file (/etc/fatcontroller) as usual.

    I think this is now actually the most frequently asked question so perhaps I will rethink the approach and make it more user-friendly. Any comments are very much appreciated!

  3. Beau says:

    That is perfect. Thanks again. I look forward to version 0.0.4

  4. Wayne says:

    Fat Controller, what a name! I have been looking for a program like yours for the longest of time, great work!

    I have a question, though. Basically I have a script that reads a directory for one or more input files to be processed. If I use SLEEP=2, THREADS=1, THREAD_MODEL=FIXED, does it mean that at any one time, there is only one script process running, ever?

    I was thinking that since my script already supports multiple input files — processing time is not long — it’s not really necessary to make any changes, just use the above-mentioned set of params.

  5. Nick says:

    Hello. Thanks for the feedback – I really appreciate it!

    Regarding your question, you are right – by setting THREADS=1 when using the fixed interval thread model will mean only one script process will ever run at a time.

    The Fat Controller will try to stick to the schedule as close as possible, in your case running a new script instance every 2 seconds. If, however, a script takes longer than 2 seconds then The Fat Controller will wait until it finishes and then immediately start a new one.

    If you want to specify a maximum wait time then you can use the PROC_RUN_TIME_MAX or FIXED_INTERVAL_WAIT arguments.

    I’ve almost finished work on v0.0.4 (currently looking for volunteers to help test it!) but once it’s done I will spend some time updating the documentation so that all of this will hopefully be a bit clearer.

  6. Wayne says:

    Thanks for the explanation. THREAD_MODEL=FIXED fits my requirements exactly.

    I’d deployed 0.0.3 to production on the 9th!

    It was an act of desperation; I couldn’t reproduce a critical bug creating invalid data. My system uses 3 scripts, let’s call ’em, and baz.php:

    nohup ./.bar &> /dev/null

    while true
    php baz.php
    sleep 2

    I adjusted /etc/fatcontroller accordingly, and lo and behold, the bug went away.

    If you are ever in Singapore, I owe you at least 3 beers. Hehe

  7. Nick says:

    Glad it worked! :-)

  8. bhird says:

    fatcontroller is a miracle… has really saved my sms processing with php scripts..
    Cheers for the goodwork

Leave a Reply

Your email address will not be published. Required fields are marked *