Bug 683504 - [RFE] Add ability to splay global cron jobs
Summary: [RFE] Add ability to splay global cron jobs
Keywords:
Status: CLOSED DUPLICATE of bug 532157
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: crontabs
Version: 5.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Marcela Mašláňová
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 554476
TreeView+ depends on / blocked
 
Reported: 2011-03-09 15:39 UTC by J.H.M. Dassen (Ray)
Modified: 2013-07-03 04:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-02 13:16:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description J.H.M. Dassen (Ray) 2011-03-09 15:39:32 UTC
2. What is the nature and description of the request?

Customer has a large number of systems and they all kick off their nightly
cronjobs (such as mlocate, logrotate, etc) at the same time, resulting in very
high I/O wait.  They would like cron to offer the ability to randomize jobs
across a given time period.  

3. Why does the customer need this? (List the business requirements here)

To prevent hundreds of systems from kicking off the same job at the same time,
putting excessive load on storage, network, etc

4. How would the customer like to achieve this? (List the functional
requirements here)

They gave us a set of example patches, but they do not completely solve the
problem.  These patches would configure SPLAY for *every* job on the system,
but they want the ability to selectively enable it for certain jobs.  The
patches to demonstrate the feature:

--- /usr/bin/run-parts.orig   2006-07-14 23:05:38.000000000 -0500
+++ /usr/bin/run-parts       2010-10-28 13:18:38.000000000 -0500
@@ -1,6 +1,7 @@
 #!/bin/bash

 # run-parts - concept taken from Debian
+. /etc/sysconfig/crond

 # keep going when something fails
 set +e
@@ -15,6 +16,11 @@
        exit 1
 fi

+if [ -n $SPLAY ]
+then
+       sleep `expr $RANDOM % $SPLAY`
+fi
+
 # Ignore *~ and *, scripts
 for i in $1/*[^~,] ; do
        [ -d $i ] && continue

--- /etc/sysconfig/crond.orig       2009-12-11 03:31:19.000000000 -0600
+++ /etc/sysconfig/crond   2010-10-28 13:20:47.000000000 -0500
@@ -7,3 +7,4 @@
 #                           from this tr(1) set : [@!:%-_.,:alnum:]
 #                           otherwise mailing is not attempted.
 CRONDARGS=
+SPLAY=600

So, if you configured a job for "0 4 * * *" and set SPLAY=7200, jobs would be
randomly scattered across the 2 hour period from 4am-6am.  

Ideally, their example would be extended to allow you to set this per cronjob.  

5. For each functional requirement listed in question 4, specify how Red Hat
and the customer can test to confirm the requirement is successfully
implemented.

Set SPLAY for the relevant cronjob on multiple servers.  Observe that they were
randomized across the SPLAY period.

6. Is there already an existing RFE upstream or in Red Hat bugzilla?

No

7. How quickly does this need resolved? (desired target release)

5.8

8. Does this request meet the RHEL Inclusion criteria (please review)

Yes

9. List the affected packages

vixie-cron


Note You need to log in before you can comment on or make changes to this bug.