[PATCH] Add load average support to makehistory

Julien ÉLIE julien at trigofacile.com
Fri Jun 19 18:35:57 UTC 2009

Hi Ondřej,

> as reported/proposed in RedHat bugzilla
> https://bugzilla.redhat.com/show_bug.cgi?id=276061 by Jonathan Kamens,
> it would be good to add support for load average into makehistory.
> Consider using that patch (I just sorted the options to match alphabet)
> or adding/depending on some inn.conf variable which would allow reducing
> of loadaverage for makehistory.

Thanks for the patch.

+ case 'L':
+     LoadAverage = atoi(optarg);
+     break;

+ if (LoadAverage) {
+     double loadavg;
+     while (getloadavg(&loadavg, 1) > 0 && (int)loadavg >= LoadAverage) {
+         sleep(1);
+     }
+ }

To INN maintainers:
Should we use "makehistory -L <number>" or a new makehistoryloadlimit:
parameter in inn.conf (based upon the existing nnrpdloadlimit: one)?
What would be the default value?  16 like nnrpd?  or 0 for no limit?

Is it okay to use "sleep(1)" like this?

(Is there something to do for makedbz, expire, expireover..?  I do not
know whether it is wise to make them sleep -- they could take a very long
time to execute and we would have to find the right moment to put the sleep.)

Julien ÉLIE

« L'homme a imaginé le cercle avant de savoir que la terre était ronde.
  Ça prouve quand même une certaine faculté d'invention. » (Jacques Sternberg) 

More information about the inn-workers mailing list