Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32 shadow server consumes 100% cpu even when inactive #691

Closed
totaam opened this issue Sep 24, 2014 · 5 comments
Closed

win32 shadow server consumes 100% cpu even when inactive #691

totaam opened this issue Sep 24, 2014 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Sep 24, 2014

Issue migrated from trac ticket # 691

component: server | priority: critical | resolution: fixed | keywords: shadow win32

2014-09-24 08:18:46: totaam created the issue


shadow servers are inefficient as they use screenscraping, but when the window is not shown, we stop refreshing the pixels - yet on win32, the cpu remains at 100%

@totaam
Copy link
Collaborator Author

totaam commented Sep 24, 2014

2014-09-24 10:45:14: totaam changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Sep 24, 2014

2014-09-24 10:45:14: totaam changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Sep 24, 2014

2014-09-24 10:45:14: totaam commented


To make it easier to debug such things, I added r7787 (full stacks for all threads in xpra info), r7785 network debug logging in error path.

And eventually I found that on windows with glib and sockets, we just get lots of spurious EWOULDBLOCK, see
Watching sockets with Glib on Windows puts them in non-blocking mode, because glib puts the socket in non-blocking mode.. and we just can't force it into blocking mode (I've tried).

So, r7790 does an ugly fix and introduces an up to 5ms sleep in the socket loop for win32 sockets (it starts at 0ms and goes up to 5ms) which isn't as good as blocking sockets or a working non-blocking polling implementation... but keeps the changes minimal. The win32 will wakeup up to 200 times per second on those sockets, but this barely registers in terms of CPU usage now.

I have also tested the win32 client to make ensure that this does not make any difference there.
The win32 shadow server is quite broken in 0.14.x already, not sure this is worth backporting, closing.

@totaam totaam closed this as completed Sep 24, 2014
@totaam
Copy link
Collaborator Author

totaam commented Sep 26, 2014

2014-09-26 04:46:32: totaam commented


Backport in 7811.

@totaam
Copy link
Collaborator Author

totaam commented Aug 8, 2016

2016-08-08 06:44:28: antoine commented


r13270 moves the win32 socket workaround code to win32 servers only. (no need to penalise win32 clients)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant