Prefork webservers like gunicorn are usually configured to limit the number of requests each worker can serve, for various reasons. My model is based on similar motivations. It simplifies resource management and the scheduling logic, among other things.
So to be more precise, most of my processes are in fact set to autostart. They manage their own scheduling logic, and most of the cron jobs do `supervisorctl restart suchandsuch` which generally is expected to produce an error because the process will have exited normally at the end of the previous run. Perhaps not intuitive, and definitely not a complete separation of concerns as you point out, but I also don't see why I should reimplement in my own codebase what I have for free in cron. On Wed, Jun 10, 2015 at 01:54:39PM +0100, jon bennett wrote: > If you're using supervisor and have the logic to allow your processes > to sleep, why not make your processes persistent and leave it to them > to know when to run? > You then have a clear separation of concerns, Supervisor makes sure > the process is running (or stopped!) and the process makes sure it > only does things when it should do. > > On 10 June 2015 at 09:55, Aryeh Leib Taurog <v...@aryehleib.com> wrote: > > I have a bunch of cron jobs that run `supervisorctl start suchandsuch` > > and for the most part I make the processes themselves responsible for > > exiting at the right time (say, after market close). > > > > I also make the processes responsible for handling changes in start > > time due to other factors like daylight savings. The cron jobs start > > everything before the earliest time and the processes sleep until the > > correct start time for the current date. > > > > On Wed, Jun 10, 2015 at 02:36:34PM +1000, Steve Lorimer wrote: > >> Is there a way to schedule a window during which a service should be > >> running? > >> > >> Similar to cron, but managed through supervisord? > >> > >> [program:theprogramname] > >> command=/bin/cat > >> starttime=09:00:00 > >> stoptime=17:00:00 > >> dow=1-5 > >> dom=* > >> month=* > >> > >> If this isn't available in supervisord directly, what is the recommended > >> way to achieve this? > >> > >> TIA > >> Steve _______________________________________________ Supervisor-users mailing list Supervisor-users@lists.supervisord.org https://lists.supervisord.org/mailman/listinfo/supervisor-users