Date: Mon, 10 May 2004 08:40:15 -0700 (PDT) From: Dmitry Morozovsky <marck@rinet.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/66474: [patch] add jitter to cron(8) to smooth load spikes Message-ID: <200405101540.i4AFeFGL080026@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/66474; it has been noted by GNATS.
From: Dmitry Morozovsky <marck@rinet.ru>
To: FreeBSD-gnats-submit@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@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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405101540.i4AFeFGL080026>
