Each time I’m trying to troubleshoot some salt states, I end up spending too much time waiting for the management qube to open. Is there a way to keep the management qube open or anything that might help to get a faster execution?
A partial workaround might be to manually start the related disp-mgmt-<QUBE> and the target as soon as the previous qubesctl command is done, it takes me ~25 seconds instead of 50.
configure them to be the default management template
undo all this
record 2-5 and 6 as two scripts
Something like this should work per this guide (excluding persistency parts, of course)
Qube preloading is a mistake.
p.s. 34 seconds is slow! Is this a storage or cpu bottleneck for you? My idea is useless if cpu is the limitation
p.p.s. I don’t like my plan no more, it permanently takes away significant chunk of memory from the system. It might be okay for people with a lot of memory though, especially if they run minimal templates. Qube preloading is fine.
The obvious conclusion is that performance boost is very limited. My setup is quite haphazard, it might be possible to optimize by a lot. For this test it’s just zram drive with file qubes pool driver. Giving more cores to my qubes at this point might notably improve the speed.
Actually interesting conclusion is that management dvm itself is quite fast overall, there aren’t much performance to gain even if you make its startup literally instant. Speeding up boot time of the managed qube is more valuable.
Another idea I have is to try to optimize qube-starting algorithm of qubesctl. As is it is just starting qubes one by one, it doesn’t even start management qube - managed qube pair at the same time.
Low hanging fruit is to make a wrapper around qubesctl that simply pre-runs qvm-start for all targeted qubes (but respects max-concurrency)
As far as I understand the Linux kernel’s LRU cache, giving enough RAM to dom0 and preloading the files of the VMs with vmtouch or plain old cat ... >/dev/null should achieve virtually the same thing.
As such, if your management/AppVMs’ template is the same as for your other, currently running qubes, I believe you’ll see better performance due to caching than if the template was different.