[systemd-devel] Regarding service rate limiting (systemd 237)

Michal Koutný mkoutny at suse.com
Tue Jul 12 12:33:12 UTC 2022


On Tue, Jul 12, 2022 at 03:36:55PM +0530, Ani A <aniruddha.a at gmail.com> wrote:
> Demo services work fine, the actual service is quite heavy and takes
> time to startup.
> 
> > you may not reach the sufficient fail rate for start limit to kick
> I didn't get this part.

I meant that your values might have corresponded to too high (re)start
rate and the real service is slower, i.e. below that limit.

> Say the daemon takes 60s to startup and crash and I set the
> StartLimitIntervalSec=320 This should be sufficient time for 5
> restarts (?)

That gives roughly 320s/5 ~ 64s per (re)start. So I'd say this is
borderline, whether the limit throttles the service starts or not.

You can try whether rate limit works for your real service by setting
some very long StartLimitIntervalSec= (and then calibrating more
precisely).

	systemctl show $UNIT | grep -E "StartLimit.*|InactiveExitTimestamp|ActiveEnterTimestamp"

May give sou some insight into the timings (but internal ratelimiting
parameters are not available).


> Thanks, I didn't know about systemd-coredump, do I have to install
> this separately?
> I do not see coredump.conf or systemd-coredump service running on my host!
> (Ubuntu 18.04)

Not sure about that distro (and that age). You will ultimetely know if
coredump is configured by reading 
	/proc/sys/kernel/core_pattern

> Also, I would be more interested to get the rate-limiting to work
> rather than daemon respawning indefinitely.

Fair enough (just wanted to point out that start limiting won't prevent
coredump size accumulation).

Michal


More information about the systemd-devel mailing list