monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: depend take 2


From: Jan-Henrik Haukeland
Subject: Re: depend take 2
Date: 17 Dec 2002 23:20:41 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Rory Toma <address@hidden> writes:

> >   if(is(action, "start")) {
> >     ASSERT(p->start);
> >     if(! is_process_running(p)) {
> >       int max_tries= 10;
> >       log("%s: (%s) %s\n", action, p->name, p->start->arg[0]);
> >       spawn(p, p->start);
> >       p->visited= TRUE;
> >       while(max_tries--) {
> >     if(is_process_running(p))
> >         break;
> >     sleep(1);
> >       }
> >     }
> 
> This will probably work fine, except maybe instead of a sleep(1), we
> want to make it sleep(Run.polltime/max_tries), that way if you have
> slow-starting processes, you can tune it with setting the poll time.

It takes to long, the idea is *not* to suspend the control for more
than necessary and doing it like this is reasonable fast. Suspending
monit for more time is not good, imagine that monit has to watch 20 or
more processes and with a poll cycle for 60 seconds or more. In a
worst case scenario monit can take up to 20 minutes before it finaly
manage to start all programs..!

Besides if a program does not manage to create a pidfile in 10 seconds
something is wrong. 

There are other strange stuff that is happening also, although I
cannot put my finger on it, but I'm on it. (At least on it tomorrow,
it's late :)


-- 
Jan-Henrik Haukeland



reply via email to

[Prev in Thread] Current Thread [Next in Thread]