pve-manager/services
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
..
ceph-after-pve-cluster.conf cleanup: rename bin/init.d to services 2018-06-20 13:04:51 +02:00
Makefile replace systemd timer with pvescheduler daemon 2021-11-10 16:11:00 +01:00
pve-daily-update.service cleanup: rename bin/init.d to services 2018-06-20 13:04:51 +02:00
pve-daily-update.timer cleanup: rename bin/init.d to services 2018-06-20 13:04:51 +02:00
pve-guests.service fix #844: allow to pre-delay start-all-marked guests on boot 2019-11-20 20:20:58 +01:00
pve-storage.target ceph: remove obsolete ceph.service and do not distribute it anymore 2019-07-04 17:09:48 +02:00
pvebanner.service cleanup: rename bin/init.d to services 2018-06-20 13:04:51 +02:00
pvedaemon.service service: add restart on-failure to pveproxy and pvedaemon 2019-06-05 08:48:01 +02:00
pvenetcommit.service pvenetcommit: better handle non-existent pending changes 2021-10-20 16:47:06 +02:00
pveproxy.service pveproxy.service: take over pvecm call from pve-cluster.service 2019-11-18 12:25:35 +01:00
pvescheduler.service replace systemd timer with pvescheduler daemon 2021-11-10 16:11:00 +01:00
pvestatd.service services; update 'PIDFile' to point directly to /run 2019-05-26 11:03:29 +02:00
spiceproxy.service services; update 'PIDFile' to point directly to /run 2019-05-26 11:03:29 +02:00