canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.81k stars 645 forks source link

[gui] Use event based connection to the daemon instead of polling #1528

Open hatched opened 4 years ago

hatched commented 4 years ago

Describe the bug

Menu bar app on MacOS 10.14.6 consistently uses 0.1-0.2% CPU. Upon closing sometimes it'll spike to 30-40% although this isn't consistent.

To Reproduce

  1. Open the activity monitor on MacOS and sort by CPU usage.

Expected behavior It shouldn't use a consistent amount of CPU.

Additional info

Additional context No vms are running and after a fresh reboot.

townsend2010 commented 4 years ago

Hey @hatched,

Yes, unfortunately right now, the gui client has to poll the daemon every second in order to get the most up to date state since the cli client can also start, stop, delete, etc. instances. We have plans to change this to event based gRPC connections, but that isn't so straight forward and is a lower priority at this time. I thought we already had a bug report opened for this, but I can't find it, so I think I'll change this bug report for that enhancement :smiley:

Regarding the closing of the gui, is it just a quick spike or does the process keep running at that high of a percentage?

hatched commented 4 years ago

That sounds good :)

The spike is momentary before it shuts down completely. I can't reproduce it reliably however.