[GH-ISSUE #192] PRemoteM hogs CPU when opening many SSH connections #165

Closed
opened 2026-02-26 11:57:00 +03:00 by kerem · 14 comments
Owner

Originally created by @BrommD on GitHub (Jan 25, 2022).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/192

Originally assigned to: @VShawn on GitHub.

Describe the bug
When opening some remote connections, the PRemoteM main executable starts consuming CPU to the max.

To Reproduce
Steps to reproduce the behavior:

  1. Have some profiles configured (i.e ssh)
  2. Open them (I have in average 5-15 SSH connections open)

Expected behavior
main EXE not using any CPU when not being used

Screenshots
image

Desktop (please complete the following information):
image

  • PRemoteM Version 0.6.1.1

Additional context
maybe with WIn10 Upgrade 21H1, I did this last week... before of that, there was no high CPU usage

Originally created by @BrommD on GitHub (Jan 25, 2022). Original GitHub issue: https://github.com/1Remote/1Remote/issues/192 Originally assigned to: @VShawn on GitHub. **Describe the bug** When opening some remote connections, the PRemoteM main executable starts consuming CPU to the max. **To Reproduce** Steps to reproduce the behavior: 1. Have some profiles configured (i.e ssh) 2. Open them (I have in average 5-15 SSH connections open) **Expected behavior** main EXE not using any CPU when not being used **Screenshots** ![image](https://user-images.githubusercontent.com/33422643/150968168-910400ec-b658-41b8-bf39-a56ae7904342.png) **Desktop (please complete the following information):** ![image](https://user-images.githubusercontent.com/33422643/150968247-4b80f8ff-338a-4175-be05-21861436bf04.png) - PRemoteM Version 0.6.1.1 **Additional context** maybe with WIn10 Upgrade 21H1, I did this last week... before of that, there was no high CPU usage
Author
Owner

@BrommD commented on GitHub (Jan 25, 2022):

BTW as long it hogs all CPU, I switch it to "low priority" and "CPU affinity" to one core after startup, so it runs acceptable

<!-- gh-comment-id:1021099830 --> @BrommD commented on GitHub (Jan 25, 2022): BTW as long it hogs all CPU, I switch it to "low priority" and "CPU affinity" to one core after startup, so it runs acceptable
Author
Owner

@majkinetor commented on GitHub (Jan 25, 2022):

Can't confirm this with 2 SSH + 2 RDP connections. CPU never goes over 3% on my machine.

<!-- gh-comment-id:1021107496 --> @majkinetor commented on GitHub (Jan 25, 2022): Can't confirm this with 2 SSH + 2 RDP connections. CPU never goes over 3% on my machine.
Author
Owner

@BrommD commented on GitHub (Jan 25, 2022):

well, did an OS reboot and got now
image

which is not 90%, but still wondering, why ~15% CPU is required for the subprocesses.... any polling functions

<!-- gh-comment-id:1021254698 --> @BrommD commented on GitHub (Jan 25, 2022): well, did an OS reboot and got now ![image](https://user-images.githubusercontent.com/33422643/150998087-bfcc6959-9432-4451-aa57-fdb74025c8bd.png) which is not 90%, but still wondering, why ~15% CPU is required for the subprocesses.... any polling functions
Author
Owner

@majkinetor commented on GitHub (Jan 25, 2022):

Yeah, that is high. I wonder if that is specific to your system. Have you tried some other machine?

  1. Do you have something funky in logs?
  2. Does it require that many connections or it happens with few of them?
  3. Do you have AV software on and if so does it change anything when you disable it?
<!-- gh-comment-id:1021264027 --> @majkinetor commented on GitHub (Jan 25, 2022): Yeah, that is high. I wonder if that is specific to your system. Have you tried some other machine? 1. Do you have something funky in logs? 2. Does it require that many connections or it happens with few of them? 3. Do you have AV software on and if so does it change anything when you disable it?
Author
Owner

@majkinetor commented on GitHub (Jan 25, 2022):

BTW, I don't have latest windows update, I intentionally disable that because fuck ups rule rather then exception.

<!-- gh-comment-id:1021265689 --> @majkinetor commented on GitHub (Jan 25, 2022): BTW, I don't have latest windows update, I intentionally disable that because fuck ups rule rather then exception.
Author
Owner

@BrommD commented on GitHub (Jan 25, 2022):

look at screenshot :) you don't get "enterprise" as a regular user. And yes, I need them open, sometimes more.... Logs are looking quite unspectacular, only one, which might be an issue is:

<!-- gh-comment-id:1021297593 --> @BrommD commented on GitHub (Jan 25, 2022): look at screenshot :) you don't get "enterprise" as a regular user. And yes, I need them open, sometimes more.... Logs are looking quite unspectacular, only one, which might be an issue is:
Author
Owner

@BrommD commented on GitHub (Jan 25, 2022):

2022-01-25T15:06:44.8350257+01:00[ThreadId:0000000006]		Warning		

System.ArgumentException: Der Typ des Wertobjekts entspricht nicht der angegebenen RegistryValueKind, oder das Objekt konnte nicht richtig konvertiert werden.
   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
   bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355.
   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
   bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355.
regKey.SetValue(HostName, 10.55.11.178, DWord)
   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
   bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355.
<!-- gh-comment-id:1021297661 --> @BrommD commented on GitHub (Jan 25, 2022): ``` 2022-01-25T15:06:44.8350257+01:00[ThreadId:0000000006] Warning System.ArgumentException: Der Typ des Wertobjekts entspricht nicht der angegebenen RegistryValueKind, oder das Objekt konnte nicht richtig konvertiert werden. bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355. bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355. regKey.SetValue(HostName, 10.55.11.178, DWord) bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) bei PRM.Core.External.KiTTY.KittyConfig.SaveToKittyRegistryTable() in C:\projects\premotem-release-by-tag-automatically\PRM.Core\External\KiTTY\KittyConfig.cs:Zeile 355. ```
Author
Owner

@majkinetor commented on GitHub (Jan 25, 2022):

You didn't answer anything but 1 question @BrommD

<!-- gh-comment-id:1021374474 --> @majkinetor commented on GitHub (Jan 25, 2022): You didn't answer anything but 1 question @BrommD
Author
Owner

@BrommD commented on GitHub (Jan 25, 2022):

ok,

Do you have something funky in logs?
see above

Does it require that many connections or it happens with few of them?
yes it does (also answered above)

Do you have AV software on and if so does it change anything when you disable it?
MS Defender, cannot change settings, maintained by AD admins. maybe an issue.. But I've moved the complete PremoteM folder within an excluded folder (excluded from AV scan/checks). It does not change CPU usage, which is still 15-25% now using ~10 open SSH connections...

thx
Dejan

<!-- gh-comment-id:1021414200 --> @BrommD commented on GitHub (Jan 25, 2022): ok, Do you have something funky in logs? see above Does it require that many connections or it happens with few of them? yes it does (also answered above) Do you have AV software on and if so does it change anything when you disable it? MS Defender, cannot change settings, maintained by AD admins. maybe an issue.. But I've moved the complete PremoteM folder within an excluded folder (excluded from AV scan/checks). It does not change CPU usage, which is still 15-25% now using ~10 open SSH connections... thx Dejan
Author
Owner

@majkinetor commented on GitHub (Jan 25, 2022):

I can confirm this. I reproduced it like this:

  1. I duplicated single SSH connection 15 times and selected it later via unique tag (test3 here)
  2. 1 bulk connected all of them

image

image

This doesn't happen with RDP. The CPU goes linearly. My laptop cooler started working ASAP.

<!-- gh-comment-id:1021610371 --> @majkinetor commented on GitHub (Jan 25, 2022): I can confirm this. I reproduced it like this: 1. I duplicated single SSH connection 15 times and selected it later via unique tag (`test3` here) 2. 1 bulk connected all of them ![image](https://user-images.githubusercontent.com/85767/151059922-91eda85d-06da-4517-a3ac-05667b4d44e7.png) ![image](https://user-images.githubusercontent.com/85767/151059812-1462356d-ed3f-4795-9060-9e25a9350dd5.png) This doesn't happen with RDP. The CPU goes linearly. My laptop cooler started working ASAP.
Author
Owner

@VShawn commented on GitHub (Jan 26, 2022):

then the problem may be with the integrated external exe. the ssh session periodically checks to see if its own Kitty process has the focus. It may be that when the number of ssh is large, this periodic check brings performance problems. I've never had more than 5 ssh open so never noticed this.

The above is not confirmed, performance debugging is required.

<!-- gh-comment-id:1021748168 --> @VShawn commented on GitHub (Jan 26, 2022): then the problem may be with the integrated external exe. the ssh session periodically checks to see if its own Kitty process has the focus. It may be that when the number of ssh is large, this periodic check brings performance problems. I've never had more than 5 ssh open so never noticed this. The above is not confirmed, performance debugging is required.
Author
Owner

@VShawn commented on GitHub (Jan 26, 2022):

image

I think I have fix it. You can try this pre-release.

PRemoteM 0.6.2 alpha.zip

<!-- gh-comment-id:1021933659 --> @VShawn commented on GitHub (Jan 26, 2022): ![image](https://user-images.githubusercontent.com/10143738/151120032-38baf49a-ca3d-482a-8d64-616cc6177ef4.png) I think I have fix it. You can try this pre-release. [PRemoteM 0.6.2 alpha.zip](https://github.com/VShawn/PRemoteM/files/7939695/PRemoteM.0.6.2.alpha.zip)
Author
Owner

@BrommD commented on GitHub (Jan 26, 2022):

looks good, 18 ssh sessions open and this
image
but it was a little complicated to start them up with this verison, as it seems that all SSH sessions settings were recognized as new ("host fingerprint changed" and "move settings to registry" windows), issues was, the pop-up to request either "accept new host" and "move settings to registry)
image

image

is shown and pops away again quickly, so one cannot approve question. I had to reconnect up to 10 times each session to have this box being there long enough to get it done....

:)

thx, Dejan

<!-- gh-comment-id:1021951650 --> @BrommD commented on GitHub (Jan 26, 2022): looks good, 18 ssh sessions open and this ![image](https://user-images.githubusercontent.com/33422643/151124053-0abb668d-a2fe-4e26-a44b-4001cc23d258.png) but it was a little complicated to start them up with this verison, as it seems that all SSH sessions settings were recognized as new ("host fingerprint changed" and "move settings to registry" windows), issues was, the pop-up to request either "accept new host" and "move settings to registry) ![image](https://user-images.githubusercontent.com/33422643/151124579-30d6ff4a-db0d-4af7-80e0-1a5db2cd4594.png) ![image](https://user-images.githubusercontent.com/33422643/151124367-3578c878-7c1e-40e1-8f2f-ef1866382d58.png) is shown and pops away again quickly, so one cannot approve question. I had to reconnect up to 10 times each session to have this box being there long enough to get it done.... :) thx, Dejan
Author
Owner

@VShawn commented on GitHub (Jan 26, 2022):

but it was a little complicated to start them up with this verison, as it seems that all SSH sessions settings were recognized as new

Oh, this is beacuse I change the default location of KiTTY in 0.6.2 for #183 (moved to ./Kitty from AppData/PRemoteM/Kitty), so the old cached can not be read by the new KiTTY, you have to check the pop-up again.

BTW, you have to handle the pop-up again if you delete the folder ./Kitty .

<!-- gh-comment-id:1021957223 --> @VShawn commented on GitHub (Jan 26, 2022): > but it was a little complicated to start them up with this verison, as it seems that all SSH sessions settings were recognized as new Oh, this is beacuse I change the default location of KiTTY in 0.6.2 for #183 (moved to `./Kitty` from `AppData/PRemoteM/Kitty`), so the old cached can not be read by the new KiTTY, you have to check the pop-up again. BTW, you have to handle the pop-up again if you delete the folder `./Kitty` .
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#165
No description provided.