pve-manager/debian
Thomas Lamprecht 6385fb8183 replace systemd timer with pvescheduler daemon
The whole thing is already prepared for this, the systemd timer was
just a fixed periodic timer with a frequency of one minute. And we
just introduced it as the assumption was made that less memory usage
would be generated with this approach, AFAIK.

But logging 4+ lines just about that the timer was started, even if
it does nothing, and that 24/7 is not to cheap and a bit annoying.

So in a first step add a simple daemon, which forks of a child for
running jobs once a minute.
This could be made still a bit more intelligent, i.e., look if we
have jobs tor run before forking - as forking is not the cheapest
syscall. Further, we could adapt the sleep interval to the next time
we actually need to run a job (and sending a SIGUSR to the daemon if
a job interval changes such, that this interval got narrower)

We try to sync running on minute-change boundaries at start, this
emulates systemd.timer behaviour, we had until now. Also user can
configure jobs on minute precision, so they probably expect that
those also start really close to a minute change event.
Could be adapted to resync during running, to factor in time drift.
But, as long as enough cpu cycles are available we run in correct
monotonic intervalls, so this isn't a must, IMO.

Another improvement could be locking a bit more fine grained, i.e.
not on a per-all-local-job-runs basis, but per-job (per-guest?)
basis, which would improve temporary starvement  of small
high-periodic jobs through big, less peridoci jobs.
We argued that it's the user fault if such situations arise, but they
can evolve over time without noticing, especially in compolexer
setups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 16:11:00 +01:00
..
changelog bump version to 7.0-14 2021-11-07 21:23:14 +01:00
compat d/control: update dh compat level to 12 2021-05-20 09:49:33 +02:00
control d/control: bump dep on pve-storage 2021-11-10 14:28:04 +01:00
copyright d/copyright: update years 2021-05-20 09:49:33 +02:00
docs change from dpkg-deb to dpkg-buildpackage 2017-06-09 14:00:32 +02:00
lintian-overrides d/lintian: update overrides 2021-10-04 12:22:02 +02:00
postinst replace systemd timer with pvescheduler daemon 2021-11-10 16:11:00 +01:00
postrm b/postrm: let debhelper generate systemd stuff 2018-03-12 15:14:16 +01:00
prerm b/prerm: cleanup cruft from prerm helper 2018-03-12 15:14:16 +01:00
rules d/rules: do not compress apl info trust db 2021-07-06 12:29:23 +02:00
triggers use -noawait triggers 2015-06-01 10:00:11 +02:00