]> git.proxmox.com Git - pve-installer.git/commit
sys: command: wait for process exit with sub-second granularity
authorChristoph Heiss <c.heiss@proxmox.com>
Mon, 26 Feb 2024 16:50:43 +0000 (17:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Feb 2024 19:37:06 +0000 (20:37 +0100)
commit573457a7c5825c5a6f7baafb3f8fdf1847b00020
treeaf6eff5e329991d9bd26c5315dee0eba6ed92ca8
parentb3ca654d13f35540defc9b317bf72e41ee81f00f
sys: command: wait for process exit with sub-second granularity

Using full seconds as a granularity for sleeping between waitpid()'s is
way too much and unnecessarily slows down the installation a lot. Most
processes take a few moments after closing their stdin/stdout to
actually exit fully, which means that we would sleep a second in most
cases.

Lower it to 0.1 second, which immensely improves the situation.

Some values for comparison; tui-installer on the same bog-standard
2-core, SeaBIOS, ext4, virtio VM (roughly averaged over multiple runs):

  * 8.0 ISO (baseline): ~2:30 min
  * w/o patch: ~9:00 min
  * w/  patch: ~2:30 min

Values measured are from pressing the 'Install' button until the
autoreboot dialog (aka. install finished) popped up.

Fixes: 152bbef ("sys: command: factor out kill() + waitpid() from run_command()")
Reported-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reported-by: Filip Schauer <f.schauer@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Proxmox/Sys/Command.pm