rustdesk icon indicating copy to clipboard operation
rustdesk copied to clipboard

excessive cpu usage in linux nightly

Open test2a opened this issue 3 years ago • 16 comments
trafficstars

Describe the bug you encountered: cpu is up to 20.5% which is while rustdesk isn't even connected to a remote machine..

Screenshot_20221103_222256

...

What did you expect to happen instead?

...

How did you install RustDesk? github nightly


RustDesk version and environment

test2a avatar Nov 03 '22 16:11 test2a

@Kingtous

rustdesk avatar Nov 03 '22 18:11 rustdesk

did u just start rustdesk and do nothing?

Could you please provide the steps how to reproduce this issue?

Kingtous avatar Nov 04 '22 00:11 Kingtous

@Kingtous Screenshot_20221104_104005 Screenshot_20221104_103913

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

test2a avatar Nov 04 '22 05:11 test2a

@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 avatar Nov 04 '22 05:11 test2a

@test2a Thanks for your report, we get some clue and will fix it soon.

rustdesk avatar Nov 04 '22 06:11 rustdesk

@test2a could you try new nightly again?

rustdesk avatar Nov 05 '22 01:11 rustdesk

@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. Screenshot_20221105_105132

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

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

test2a avatar Nov 05 '22 05:11 test2a

can you help compare cpu usage with 1.1.9 based on above two scenarios?

rustdesk avatar Nov 05 '22 05:11 rustdesk

@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 Screenshot_20221105_113402

test2a avatar Nov 05 '22 06:11 test2a

@rustdesk 1.1.9 does not even show up in the graph on the right side for the most time

test2a avatar Nov 05 '22 06:11 test2a

@Kingtous the memory usage is acceptable, but seems much more than dart vm usage, the cpu usage is still high.

rustdesk avatar Nov 05 '22 06:11 rustdesk

@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. Screenshot_20221105_105132

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

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: image

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

image

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_PID can be found by ps -aux | grep rustdesk
  • wait for one minute, perf will sample cpu usage of rustdesk. Then u can upload perf.data generated by the command above.

And what are the graphic cards u use and your graphic drivers (nouveau or something)?

Kingtous avatar Nov 06 '22 04:11 Kingtous

@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

test2a avatar Nov 06 '22 09:11 test2a

@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.

Kingtous avatar Nov 06 '22 10:11 Kingtous

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.

xzipyx avatar Jan 07 '23 17:01 xzipyx

git compiled

then please help dig in.

rustdesk avatar Jan 08 '23 03:01 rustdesk

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. image

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 avatar Feb 22 '23 10:02 wakewon

@wakewon noted.

rustdesk avatar Feb 22 '23 10:02 rustdesk

git compiled

then please help dig in.

how can i help, i just installed it from arch user repository

xzipyx avatar Feb 22 '23 11:02 xzipyx

@21pages looks like it happens lately, please confirm and check when started.

rustdesk avatar Feb 22 '23 12:02 rustdesk

Ok, let me try flamegraph first

21pages avatar Feb 22 '23 12:02 21pages

how can i help

Sadly, I can not reproduce on Linux and Mac. You can try out chatgpt.

image

rustdesk avatar Feb 23 '23 07:02 rustdesk

how can i help

Sadly, I can not reproduce on Linux and Mac. You can try out chatgpt.

image

Well... I have no idea how to provide a way to reproduce this issue since it just happens.

Without server agent: image

Once server agen has been launchedt: image

wakewon avatar Feb 23 '23 07:02 wakewon

Let me know if you can get anything.

image

rustdesk avatar Feb 23 '23 08:02 rustdesk

Let me know if you can get anything.

Sadly, my "Inspect" window doesn't have a "CPU" tab or a "Threads" tab. image

Here is my sampling result, Sampling of "RustDesk".txt I don't know whether it is helpful.

wakewon avatar Feb 23 '23 08:02 wakewon

Thanks a lot, though I can not get helpful message from the file so far.

rustdesk avatar Feb 23 '23 09:02 rustdesk

But good news, I reproduced the problem.

rustdesk avatar Feb 23 '23 09:02 rustdesk

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.

wakewon avatar Feb 23 '23 09:02 wakewon

https://github.com/tauri-apps/tray-icon/issues/30

rustdesk avatar Feb 23 '23 10:02 rustdesk

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.

do you have a mouse and keyboard attached? if not, it will show a pointer instead of cursor

xzipyx avatar Feb 23 '23 16:02 xzipyx