pve-manager/bin
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
..
.gitignore Extend the .gitignore(s) 2018-05-04 14:50:04 +02:00
Makefile replace systemd timer with pvescheduler daemon 2021-11-10 16:11:00 +01:00
pve6to7 add pve6to7 WIP 2021-05-19 19:01:51 +02:00
pve-startall-delay fix #844: allow to pre-delay start-all-marked guests on boot 2019-11-20 20:20:58 +01:00
pveam Use run_cli_handler instead of deprecated run_cli 2017-10-18 15:32:52 +02:00
pvebanner use shorter login message 2013-06-17 11:22:33 +02:00
pveceph cleanup: use new run_cli_handler() method 2015-10-02 11:28:01 +02:00
pvedaemon cleanup: use new run_cli_handler() method 2015-10-02 11:28:01 +02:00
pvemailforward.c cleanup C wrapper 2013-03-25 17:47:33 +01:00
pvemailforward.pl use PVE::DataCenterConfig 2019-11-18 12:25:35 +01:00
pvenode add pvenode CLIHandler 2018-05-02 11:34:52 +02:00
pveperf pveperf: print errno on die if sensible 2019-01-31 13:50:37 +01:00
pveproxy cleanup: use new run_cli_handler() method 2015-10-02 11:28:01 +02:00
pvereport Move pvereport functionality into a separate PVE package 2015-11-03 18:10:22 +01:00
pvescheduler replace systemd timer with pvescheduler daemon 2021-11-10 16:11:00 +01:00
pvesh pvesh cleanup: use a handler class - PVE/CLI/pvesh.pm 2018-07-26 15:20:15 +02:00
pvesr pvesr: add pve storage replication tool 2017-05-31 08:23:46 +02:00
pvestatd pvestatd: log warnings to syslog 2016-10-26 15:58:23 +02:00
pvesubscription cleanup: use new run_cli_handler() method 2015-10-02 11:28:01 +02:00
pveupdate fix #2890: also detect & renew DNS-only ACME certs 2020-07-27 10:53:32 +02:00
pveupgrade Revert "Close #1623: replace apt-get to apt" 2020-07-08 10:55:56 +02:00
pveversion pveversion: fix removed packages with residual configs 2019-12-03 14:12:50 +01:00
spiceproxy spiceproxy: import PVE::SafeSyslog 2017-01-26 12:59:57 +01:00
vzdump cleanup: use new run_cli_handler() method 2015-10-02 11:28:01 +02:00