[PATCH] configurehood: Introduce random delays to dilute requests

Adrian Schmutzler mail at adrianschmutzler.de
Mo Okt 29 12:48:59 CET 2018


Gerade noch eingefallen:

Ist sleep beim micrond im Path oder soll ich

/bin/sleep

nehmen?

Grüße

Adrian

> -----Original Message-----
> From: franken-dev [mailto:franken-dev-bounces at freifunk.net] On Behalf Of
> Adrian Schmutzler
> Sent: Montag, 29. Oktober 2018 12:45
> To: franken-dev at freifunk.net
> Subject: [PATCH] configurehood: Introduce random delays to dilute requests
> 
> Instead of having 1000 routers accessing the KeyXchange in the
> same second, this will dilute the request within a period of
> 10 seconds.
> 
> Same is done for queries from gateways.
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 47e228b7..b6cae476 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -74,6 +74,7 @@ if [ -s "$hoodfilelocal" ]; then
>  else
>  	# if we have Internet, we download the Hoodfile from the
> keyxchangev2
>  	if hasInternet ; then
> +		sleep $(/usr/bin/random 1 10)
>  		getKeyserverHoodfile "$hoodfiletmp" && cp "$hoodfiletmp"
> "$hoodfilewww"
> 
>  		#if no Internet, we connect to the hidden AP and download the
> file from another Node in range
> @@ -95,6 +96,8 @@ else
>  			getEthernetHoodfile "$hoodfiletmp" ||
> getWirelessHoodfile "$hoodfiletmp"
>  		else
>  			echo "We have a Gateway in Range, we load the
> keyxchangev2data from fe80::1"
> +
> +			sleep $(/usr/bin/random 1 10)
>  			getGatewayHoodfile "$hoodfiletmp" && cp
> "$hoodfiletmp" "$hoodfilewww"
>  		fi
>  	fi
> --
> 2.11.0
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : nicht verfügbar
Dateityp    : application/pgp-signature
Dateigröße  : 834 bytes
Beschreibung: nicht verfügbar
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20181029/6032325b/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev