Opened 5 years ago

Last modified 2 years ago

#1360 assigned enhancement

I2P-Bote, randomize check interval (and maybe other cronjobs)

Reported by: user Owned by: str4d
Priority: minor Milestone: eventually
Component: apps/plugins Version: 0.9.14.1
Keywords: I2P-Bote privacy Cc:
Parent Tickets: #1359

Description

trivial.

The intervall for automatic mail checking should be taken as a guideline, not as exact time. Rather should the exact checking time be more random, so to add more entropy.

Subtickets (add)

Change History (8)

comment:1 Changed 5 years ago by user

to clarify: not a fixed intervall should be chosen at random, but the concrete time for each individual mail check be chosen randomly (uniform distribution).

Last edited 5 years ago by user (previous) (diff)

comment:2 Changed 5 years ago by user

  • Parent Tickets set to 1359

comment:3 Changed 4 years ago by str4d

  • Keywords I2P-Bote privacy added
  • Milestone 0.9.16 deleted

comment:4 Changed 4 years ago by str4d

  • Milestone set to eventually
  • Summary changed from I2P-Bote, randomize check interval to I2P-Bote, randomize check interval (and maybe other cronjobs)

A comment from rfree:

( I offer small tip of 0.01 Bitcoin - so a beer at current prices - for who ever implements this, e.g. from
https://blockchain.info/address/152fnfBqRjVMDvRa5LQ2upx9tJAeHnyqHC )

A few details about delay of "cronjobs" - especially the "check email" action:
For each account, where T is the configured time of action, e.g. 10 minutes for "check email each 10 minutes":
and L option:
Sometimes pretend to be offline for up to .... hours to make others confused about when your computer is online.

1) At start, job should delay random(T*0 to T*2)
2) After running the check, job should schedule next run, to be randomly between time from now

sleeptime = random(T*0.5 to T*1.5)
if random(0..100) is < 30 then sleeptime += randomGauss(0 to L/5)
if random(0..100) is < 10 then sleeptime += randomGauss(0 to L)

choose the scheduled time: ID.nextrun = now() + sleeptime

It is a good idea to look at the possibility of randomizing other cronjobs, if they are visibly tied to an identity.

comment:5 Changed 4 years ago by user

I'd like the option to manually set the intervall from which to draw the actual waitTime randomly.
But I also see the convenience of just putting one approximate time.
So what about this compromise:
For what above you call sleeptime, and previously was called checkintervall, either let the user specify either an intervall [ min,max] or one value checkIntervall for check intervall and a randomization/spread factor factor.
Either way, you can transform them.
(With user-set min and max values, you obtain factor from factor := (max-min)/(max+min) and checkInterval := (max+min)/2 This calculation is only performed on saving this very setting from the ui. Otherwise it only reads the two needed values checkIntervall and factor from the config file.)

For determining the next check time you first obtain two values helpFactor1 and helpFactor2 of a Gaussian random variable centered around the randomization factor factor independently from one another, set
finalMin := (1-helpFactor1/100.0)*checkInterval and
finalMax := (1+helpFactor2/100.0)*checkInterval (both helpFactors can be discarded now)
(Assert that finalMin <= finalMax)
Then choose waitTime from a uniform distribution between [finalMin, finalMax].
(both values can be discarded now)
Finally, you get the scheduledTime = timeOfLastCheck + waitTime.

This does not yet take the L option rfree mentions into account.

Heck, if you want, you can even provide both options and let the user choose which input method is more intuitive for him, giving the average and a randomization factor, or giving min and max.

And the very same calculations can be used to determine the exact wait time per relay which is sent to the respective Bote relay node.

Default vlaues to be determined.

wrt the above mentioned L feature: I don't desperately need it. but if you do it, nice. Should imho be off / set to 0 by default thought, in order not to delay things too much for users that expect some quicker workings. but then rather choose an offline duration and a "timezone" and simply gauß the period.

Last edited 4 years ago by user (previous) (diff)

comment:6 Changed 4 years ago by user

just saw #1462, yes, something like that is what I vaguely had in mind. But then the L thing here above is onbsolete, or what is it for? Or is the L independed of timezone just a ramdom "computer switched off"?

comment:7 Changed 2 years ago by zzz

  • Owner changed from HungryHobo to str4d
  • Status changed from new to assigned

comment:8 Changed 2 years ago by str4d

Migrated to https://github.com/i2p/i2p.i2p-bote/issues - I will close these tickets as things are resolved rather than right now, but please make future comments on GitHub?.

Note: See TracTickets for help on using tickets.