Graylog2 / Graylog2/graylog2-server

Add jitter to periodical startup

Open
#22,487 0 comments 0 reactions 0 assignees View on GitHub
feature triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## What?

- Add a random delay before starting a `Periodical` that runs forever
- Delay should be correlated to period and not exceed a full period
- Provide option to disable jitter for periodicals that should start immediately

## Why?

Most periodicals specify startup delay of 0, so they all run at the same time on system startup. If the periods are the same (or multiples) then they will continue to run in sync. This causes repeating spikes in resource usage, that could be avoided.

Since system restarts are unpredictable, so is the exact time when periodicals will run. Therefore it is not a problem to introduce a random delay, except if the periodical must always run immediately upon startup. We provide an opt-out for those cases.

It is still desirable to have predictable repeatability, e.g. once an hour, once a day, etc. - so don't add additional delays in between subsequent runs.

## Your Environment

* Graylog Version: 6.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.