Subject: [lmap] large random spreads compared to periodicity

From: Juergen Schoenwaelder <[email-masked]>
Date: Thu, 25 Feb 2016 18:27:57 +0100

Hi,

suppose I have a timer event triggering lets say every minute and I
have a random spread that can be larger than 60 seconds. Lets assume
the random spreads that I get are 20, 80, 10, 0. Is this the expected
behavior?

t0:	event triggers 1st time
t0+20:	1st schedule starts to run (due to 20 seconds random spread)
t0+60:  event triggers 2nd time
t0+120: event triggers 3rd time
t0+130: 3rd schedule starts to run (due to 10 seconds random spread)
t0+140: 2nd schedule starts to run (due to 80 seconds random spread)

Note that this means that I have to manage a potentially large number
of future invocations. If someone configures a random spread interval
of that is way larger than the periodicity, then I might queue up a
potentially large number of future schedules.

A more resource conserving interpretation would be to simply ignore
any future schedules if the previous one not yet been executed, that
is, in the sequence above, one would ignore the 3rd schedule at t0+130
since the 2nd scheduled for t0+140 did not run yet. The next one to
run would be the 4th schedule at t0+180.

I consider a random spread that is larger than the periodicity a
somewhat dubious configuration and that means I prefer to not spent
code complexity at it.

Perhaps the solution is that say that the behaviour in this situation
is simply undefined and implementation dependent. This allows
implementations to do what is sensible from the way the code works and
at the same time tells people to not use random spreads that can
exceed the periodicity. Or is there a use case for this?

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: "MORTON, ALFRED C (AL)" <[email-masked]>
Date: Thu, 25 Feb 2016 20:55:37 -0500

> somewhat dubious configuration and that means I prefer to not spent
I agree, in fact let's say a task takes 20 seconds to complete
and needs to run every 60 seconds as in your example.

Then the schedule says start on each minute:00 seconds,
and the random spread can be no larger than 40 seconds
to allow the task to complete and start the next minute 
in the clear, with any random spread possible in the 
next minute.

So, Max(random_spread) = period - max_task_duration

Al

> -----Original Message-----
> From: lmap [mailto:[email-masked]] On Behalf Of Juergen
> Schoenwaelder
> Sent: Thursday, February 25, 2016 12:28 PM
> To: [email-masked]
> Subject: [lmap] large random spreads compared to periodicity
> 
> Hi,
> 
> _______________________________________________
> lmap mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/lmap