Skip to content

[LOG4J2-4012] Add random compression delay to reduce midnight disk I/O spike#4067

Open
ramanathan1504 wants to merge 3 commits intoapache:2.xfrom
ramanathan1504:issuse-4012
Open

[LOG4J2-4012] Add random compression delay to reduce midnight disk I/O spike#4067
ramanathan1504 wants to merge 3 commits intoapache:2.xfrom
ramanathan1504:issuse-4012

Conversation

@ramanathan1504
Copy link
Contributor

Fixes #4012

When rolling file appenders trigger compression at midnight, all nodes compress simultaneously, causing disk I/O spikes on shared/cloud storage.

Change

  • Added maxDelaySeconds parameter to GzCompressAction and ZipCompressAction
  • Before compression begins, a random sleep in [0, maxDelaySeconds] is applied
  • Defaults to 0 — fully backward-compatible; existing configs are unaffected

Usage

<GzCompress maxDelaySeconds="30"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Proactively deferring compression can reduce disk I/O pressure.

1 participant