rustdesk
rustdesk copied to clipboard
excessive cpu usage in linux nightly
Describe the bug you encountered: cpu is up to 20.5% which is while rustdesk isn't even connected to a remote machine..

...
What did you expect to happen instead?
...
How did you install RustDesk?
github nightly
RustDesk version and environment
@Kingtous
did u just start rustdesk and do nothing?
Could you please provide the steps how to reproduce this issue?
@Kingtous

here is system monitor right now being connected to a windows machine. 58.8% even, i could not take a photo of that. i am trying to recreate yesterday's after disconnection high CPU usage but this too looks very high. ok. i am up to 61% now
@Kingtous ok. so i in the above screenshot i was connected to a machine so i disconnected and let it sit while i was writing this and suddenly the CPU is up to now 25%.... from rustdesk.
can i send you some logs or something?
@test2a Thanks for your report, we get some clue and will fix it soon.
@test2a could you try new nightly again?
@rustdesk ok. i do apt remove and install the nightly version and the cpu usage is now in cycles.
up and down,
i have left the remote connection "connected" and using other local windows and the graph shows just plain 35% all the time.

here is after i started directly using remote window for 1-2 minutes.

so from this i can gather, keeping the rustdesk as top active window keeps the cpu usage to minimum but if it goes behind other active windows, the usage just keeps on growing
can you help compare cpu usage with 1.1.9 based on above two scenarios?
@rustdesk ok. i installed 1.1.19 from github after removing nightly and the usage is 0.3%.
when using it, the cpu usage doesnt go much and the RAM is also very low. check the screenshots

@rustdesk 1.1.9 does not even show up in the graph on the right side for the most time
@Kingtous the memory usage is acceptable, but seems much more than dart vm usage, the cpu usage is still high.
@rustdesk ok. i do apt remove and install the nightly version and the cpu usage is now in cycles.
up and down,
i have left the remote connection "connected" and using other local windows and the graph shows just plain 35% all the time.
here is after i started directly using remote window for 1-2 minutes.
so from this i can gather, keeping the rustdesk as top active window keeps the cpu usage to minimum but if it goes behind other active windows, the usage just keeps on growing
I cannot reproduce the excessive cpu usage on my manjaro using latest nightly build. I connected to a remote computer, and KDE monitor shows below:

If I use other windows and unfocus the window, the cpu usage is becoming lower.

btw, I highly doubt there's some render issues on flutter engine. Could u please provide some cpu usage clues?
Steps:
perf record -F 99 -p RUSTDESK_PID -g -- sleep 60,RUSTDESK_PIDcan be found byps -aux | grep rustdesk- wait for one minute,
perfwill sample cpu usage of rustdesk. Then u can uploadperf.datagenerated by the command above.
And what are the graphic cards u use and your graphic drivers (nouveau or something)?
@Kingtous i installed the latest nightly today after removing 1.1.9 and the performance looks much better, same as your screenshots so it must've been something in the interim that fixed. i am going to install 2-3-5 days old nightly versions and send you perf data..
no dedicated graphics.
Operating System: KDE neon 5.26 KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7 Kernel Version: 5.15.0-52-generic (64-bit) Graphics Platform: X11 Processors: 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz Memory: 7.7 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 4400 Manufacturer: Dell Inc. Product Name: Latitude E7440 System Version: 01
@Kingtous i installed the latest nightly today after removing 1.1.9 and the performance looks much better, same as your screenshots so it must've been something in the interim that fixed. i am going to install 2-3-5 days old nightly versions and send you perf data..
no dedicated graphics.
Operating System: KDE neon 5.26 KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7 Kernel Version: 5.15.0-52-generic (64-bit) Graphics Platform: X11 Processors: 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz Memory: 7.7 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 4400 Manufacturer: Dell Inc. Product Name: Latitude E7440 System Version: 01
perfect, thanks for reporting.
can you help compare cpu usage with 1.1.9 based on above two scenarios?
I experienced the same on arch + gnome + x11. High load when I connect to the nightly or git compiled version. The stable version is not affected.
git compiled
then please help dig in.
I found a similar issue on macOS. RustDesk server daemon /Applications/RustDesk.app/Contents/MacOS/rustdesk --server always take nearly 90% usage of CPU (maybe a core?) even without any connection. Once this service has been stopped, the high-usage item in system activity monitor will be disappear for seconds.

Meanwhile, it seems that com.carriez.RustDesk_server.plist cannot be unload, and this servies always restart no matter how I stop it (making it really hard to upgrade).
macOS 13.2.1, Intel RustDesk nightly 1.2.0, Build date: 2023-02-22 00:16
@wakewon noted.
git compiled
then please help dig in.
how can i help, i just installed it from arch user repository
@21pages looks like it happens lately, please confirm and check when started.
Ok, let me try flamegraph first
how can i help
Sadly, I can not reproduce on Linux and Mac. You can try out chatgpt.

how can i help
Sadly, I can not reproduce on Linux and Mac. You can try out chatgpt.
Well... I have no idea how to provide a way to reproduce this issue since it just happens.
Without server agent:

Once server agen has been launchedt:

Let me know if you can get anything.

Let me know if you can get anything.
Sadly, my "Inspect" window doesn't have a "CPU" tab or a "Threads" tab.

Here is my sampling result, Sampling of "RustDesk".txt I don't know whether it is helpful.
Thanks a lot, though I can not get helpful message from the file so far.
But good news, I reproduced the problem.
But good news, I reproduced the problem.
Here are more detail for this issue (maybe still not helpful at all):
If remove RustDesk's server's global agent and start RustDesk manually, this issue can be override, and this device can still be accessed.
Meanwhile, directly running RustDesk's server in Terminal with /Applications/RustDesk.app/Contents/MacOS/rustdesk --server can also reproduce this problem (the agent service is previously disabled).
Another thing is that I found I cannot see my cursor (iOS -> macOS) when connecting to the latest nightly build for macOS. Maybe I will open a new issue for this problem later.
https://github.com/tauri-apps/tray-icon/issues/30
But good news, I reproduced the problem.
Here are more detail for this issue (maybe still not helpful at all): If remove RustDesk's server's global agent and start RustDesk manually, this issue can be override, and this device can still be accessed. Meanwhile, directly running RustDesk's server in Terminal with
/Applications/RustDesk.app/Contents/MacOS/rustdesk --servercan also reproduce this problem (the agent service is previously disabled).Another thing is that I found I cannot see my cursor (iOS -> macOS) when connecting to the latest nightly build for macOS. Maybe I will open a new issue for this problem later.
do you have a mouse and keyboard attached? if not, it will show a pointer instead of cursor