Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Scheduling type daemon

by Laurielounge (Acolyte)
on Sep 13, 2017 at 20:18 UTC ( #1199347=note: print w/replies, xml ) Need Help??


in reply to Re: Scheduling type daemon
in thread Scheduling type daemon

The four crons is an acceptable approach but doesn't solve the other bit of the problem.

Take the every minute job as an example. At stay time either all of the jobs fire in series (or in parallel, doesn't really matter). What I'm trying to do is stretch the load over the period, in the case, the minute.
As I said, I've got the scheduling database ready. So on the minute when the cron fires, I want to run these few jobs immediately, at the five second mark (say) these ones... for the every 15 minute job, I want to immediately run these jobs, and at the three minute mark (say) run these ones... the five minute (say) run these ones... so the cron job fires a script which then times the execution of the jobs. Which may be timed to the second. The accuracy of the timing is not really important, its just about spreading the load a bit. I say "to the second" as that seems to me the only way to get that granularity in the "every minute" job.

Replies are listed 'Best First'.
Re^3: Scheduling type daemon
by choroba (Bishop) on Sep 13, 2017 at 21:45 UTC
    In the script, just run the scripts one by one in a loop. Add a sleep with the value of available seconds / number of jobs.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199347]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2017-11-25 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (355 votes). Check out past polls.

    Notices?