You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by Jeongmin Yu <ma...@gmail.com> on 2020/02/12 07:00:47 UTC

Apply distribution in openwhisk-package-alarm to reduce load

Hi, OpenWhisk developers.


I submitted a PR to openwhisk-package-alarms.
https://github.com/apache/openwhisk-package-alarms/pull/198


With the existing alarm package, the alarms with 5-field crons fire on the
top of the minute. Then a heavy load can occur in the provider worker when
the alarms converge on a specific time. My issue:
https://github.com/apache/openwhisk-package-alarms/issues/196#issue-480059133


My PR suggests handling this problem by applying the distribution of alarms
within one minute. This satisfies the given conditions(cron) and reduces
the load at the same time.


When the provider detects a new 5-field cron alarm with a parameter
strict=false, it converts the cron into 6 fields by adding a specific value
between 0-59 as a second-unit field. This gives a few seconds of spaces
among alarms, the load of the providers gets reduced as a result.

The injected value looks random, but actually, it's a hash of trigger.name.
So the intervals of each alarm are kept consistently before and after the
redeployment or the re-registration.


Please take a look and leave some comments.


Thanks

Jeongmin