bin/66474: [patch] add jitter to cron(8) to smooth load spikes
Dmitry Morozovsky
marck at rinet.ru
Mon May 10 08:40:16 PDT 2004
The following reply was made to PR bin/66474; it has been noted by GNATS.
From: Dmitry Morozovsky <marck at rinet.ru>
To: FreeBSD-gnats-submit at FreeBSD.org
Cc:
Subject: Re: bin/66474: [patch] add jitter to cron(8) to smooth load spikes
Date: Mon, 10 May 2004 19:39:49 +0400 (MSD)
On Mon, 10 May 2004 FreeBSD-gnats-submit at FreeBSD.org wrote:
Minor correction [do_command.c]: sleep part moved earlier to improve logging.
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------
Index: usr.sbin/cron/cron/do_command.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/cron/cron/do_command.c,v
retrieving revision 1.15.2.6
diff -u -r1.15.2.6 do_command.c
--- usr.sbin/cron/cron/do_command.c 22 Jun 2003 18:49:39 -0000 1.15.2.6
+++ usr.sbin/cron/cron/do_command.c 10 May 2004 15:36:10 -0000
@@ -166,6 +166,11 @@
Debug(DPROC, ("[%d] grandchild process Vfork()'ed\n",
getpid()))
+ if (Jitter != 0) {
+ srandom(getpid());
+ sleep(random() % Jitter);
+ }
+
/* write a log message. we've waited this long to do it
* because it was not until now that we knew the PID that
* the actual user command shell was going to get and the
More information about the freebsd-bugs
mailing list