3 ms·
Systemd does exponential retry but IDK about jitter?
by westurner 2y ago
Systemd does exponential retry but IDK about jitter?
- westurner 2y agoA systemd unit file with RestartMaxDelaySec= for exponential back off: [Unit] Description="test exponential retry" [Service] ExecStart=-/bin/sh -c "date -Is" Type=simple Restart=on-failure RestartSec=60ms RestartMaxDelaySec=¶ RestartSteps= # StartLimitBurst=2 # StartLimitIntervalSec=30 # OnFailure= # TimeoutStartSec= # TimeoutStartFailureMode= # WatchdogSec= # RestartPreventExitStatus= # RestartForceExitStatus= # OOMPolicy= [Install] WantedBy=default.target man systemd.service https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html https://www.freedesktop.org/software/systemd/man/latest/syst... man systemd.unit https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html https://www.freedesktop.org/software/systemd/man/latest/syst... man systemd.resource-control https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html https://www.freedesktop.org/software/systemd/man/latest/syst... man systemd.service > "Table 1. Exit causes and the effect of the Restart= settings" https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Restart= https://www.freedesktop.org/software/systemd/man/latest/syst... "RFE: Exponentially increasing RestartSec=" https://github.com/systemd/systemd/issues/6129#issuecomment-1621750434 https://github.com/systemd/systemd/issues/6129#issuecomment-... "core: add RestartSteps= and RestartSecMax= to dynamically increase interval between auto restarts" https://github.com/systemd/systemd/pull/26902 https://github.com/systemd/systemd/pull/26902 > RestartSteps= accepts a positive integer as the number of steps to take to increase the interval between auto-restarts from RestartSec= to RestartMaxDelaySec= /? RestartMaxDelaySec https://www.google.com/search?q=RestartMaxDelaySec https://www.google.com/search?q=RestartMaxDelaySec Is this where to add jitter? "core/service: make restart delay increase more smoothly" https://github.com/systemd/systemd/pull/28266/files https://github.com/systemd/systemd/pull/28266/files