Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jul 2001 21:19:00 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Load average synchronisation and phantom loads 
Message-ID:   <200107172119.aa30092@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Wed, 18 Jul 2001 03:19:48 %2B1000." <Pine.BSF.4.21.0107180242310.67803-100000@besplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.21.0107180242310.67803-100000@besplex.bde.org>, Bruce Ev
ans writes:
>
>I think that is far too much variation.  5 seconds is hard-coded into
>the computation of the load average (constants in cexp[]), so even a
>variation of +-1 ticks breaks the computation slightly.

I have not changed the mean inter-sample time from 5 seconds (*),
so is this really a problem? There will be a slight time-warping
effect in the load calculation, but even for the shorter 5-minute
timescale, this will average out to typically no more than a few
percent (i.e the "5 minutes" will instead normally be approx 4.8
to 5.2 minutes). Apart from a marginally more wobbley xload display,
this should not make any real difference.

If the variation was much smaller than it is in the proposed patch,
you could get a noticable drifting in and out of phase with processes
that have a regular run-pause pattern. Obviously this is a much
bigger problem when the sample period is fixed like it is now, but
I wanted to minimise the possibility of this effect while keeping
the inter-update time "relatively" constant.

The alternative that I considered was to sample the processes once
during every 5-second interval, but to place the sampling point
randomly over the interval. That probably results in a better
synchronisation-avoidance behaviour. However, to incorporate the
sample into the load average requires either waiting until the end
of the interval, or updating the load average at the time of
sampling. The former introduces a new delay into the load average
computation, and the latter results in a lot of very noticable
jitter on the inter-sample interval.

(*) Actually, I have changed the mean by 0.5 ticks, but that is a
bug that I will fix. The "4 + random() % (hz * 2)" should be "4 +
random() % (hz * 2 + 1)" instead.

>Not another SYSINIT (all SYSINITs are evil IMO).  SI_SUB_PSEUDO is
>bogus here -- there are no pseudo ttys here.  sched_setup() is a
>good place to do this initialization.

John Baldwin suggested moving the load average calculation into
kern_synch.c, so it would certainly make sense to initialise it
from sched_setup() then. This seems like a good idea to me; does
that sound OK?

Ian

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200107172119.aa30092>