You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "msshapira (via GitHub)" <gi...@apache.org> on 2026/08/06 13:16:54 UTC
[PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
msshapira opened a new pull request, #703:
URL: https://github.com/apache/guacamole-server/pull/703
Adds a per-connection limit on the number of encoder worker threads created for each guac_display, configurable via max_worker_threads in guacd.conf, -w on the command line, and MAX_WORKER_THREADS in the Docker image.
The limit is stored on guac_client (appended to the struct) and read by guac_display_alloc(), so it transports from guacd across the protocol-plugin boundary without changing any existing public signature. Default 0 preserves current behavior.
See GUACAMOLE-2316 for the motivation and the open question about whether the default should stay 0/unlimited or become a finite value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "msshapira (via GitHub) via dev" <de...@guacamole.apache.org>.
msshapira commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-6555827480
@
> @msshapira Please remove the merge commit - if you need to get the current `apache:main` changes onto this PR the correct way to do that is to rebase your branch on top of the current `main` branch and then force push it. The PR will update automatically when you do that.
rebased
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "otlg (via GitHub)" <gi...@apache.org>.
otlg commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-5505125044
@mike-jumper @necouchman Hi,
We also need this change. In general, this change allows controlling the number of available threads per session, so it's the maintainer's responsibility if something goes wrong.
Is there anything else that should be done for approval and releasing a new patch based on it?
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "msshapira (via GitHub)" <gi...@apache.org>.
msshapira commented on code in PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#discussion_r3758541559
##########
src/libguac/display.c:
##########
@@ -148,6 +148,18 @@ guac_display* guac_display_alloc(guac_client* client) {
}
display->worker_thread_count = cpu_count * GUAC_DISPLAY_CPU_THREAD_FACTOR;
+
+ /* Limit the number of worker threads if the client is configured with a
+ * maximum. Each connection has its own guac_display (and therefore its
+ * own set of worker threads), and a single display will rarely produce
+ * enough parallelizable work to occupy a large number of processors. On
Review Comment:
@mike-jumper can you approve this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "necouchman (via GitHub)" <gi...@apache.org>.
necouchman commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-5207878367
> > Overall I'm fine with the changes; however, I wonder if there's something a bit different we should do for the default maximum of threads? Maybe the default of scaling to the maximum number of processors isn't the best option? Is there some sort of default maximum that's actually more appropriate for performance - that is, over X number of threads, you don't see any additional benefit?
>
> @necouchman I agree that a hard limit may be a good idea. Opus suggested X=4, assuming more that that won't give much benefit anyway. Agree?
I'll defer to @mike-jumper on that one - he probably has a better idea of the cross-over point at which the number of threads will become more of a burden than it is a help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "mike-jumper (via GitHub)" <gi...@apache.org>.
mike-jumper commented on code in PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#discussion_r3730993291
##########
src/libguac/display.c:
##########
@@ -148,6 +148,18 @@ guac_display* guac_display_alloc(guac_client* client) {
}
display->worker_thread_count = cpu_count * GUAC_DISPLAY_CPU_THREAD_FACTOR;
+
+ /* Limit the number of worker threads if the client is configured with a
+ * maximum. Each connection has its own guac_display (and therefore its
+ * own set of worker threads), and a single display will rarely produce
+ * enough parallelizable work to occupy a large number of processors. On
Review Comment:
This is only true for very low levels of activity and relatively low resolutions, and only important if running under unusually strict resource levels. It's more important to have the threads available in case they are needed or users will hit a performance wall.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "msshapira (via GitHub)" <gi...@apache.org>.
msshapira commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-6492785545
@mike-jumper this is going stale...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "mike-jumper (via GitHub)" <gi...@apache.org>.
mike-jumper commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-5207988782
I think the default should remain as-is. There's plenty of parallelism to exploit in the render pipeline, even more so with WIP performance improvements to `guac_display`, and adding an arbitrary default ceiling would hobble performance on servers with the CPU to spare.
In my testing of the display, I've seen improvement in restricting the display to P-cores on platforms where the distinction exists, but a reduction in available workers only harms performance beyond that, especially since the FIFO ensures that the usage of the worker pool scales to the workload. Some workers may sit idle, but that's harmless vs. not having them available.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "necouchman (via GitHub)" <gi...@apache.org>.
necouchman commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-6509488225
@msshapira Please remove the merge commit - if you need to get the current `apache:main` changes onto this PR the correct way to do that is to rebase your branch on top of the current `main` branch and then force push it. The PR will update automatically when you do that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "msshapira (via GitHub)" <gi...@apache.org>.
msshapira commented on code in PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#discussion_r3731065415
##########
src/libguac/display.c:
##########
@@ -148,6 +148,18 @@ guac_display* guac_display_alloc(guac_client* client) {
}
display->worker_thread_count = cpu_count * GUAC_DISPLAY_CPU_THREAD_FACTOR;
+
+ /* Limit the number of worker threads if the client is configured with a
+ * maximum. Each connection has its own guac_display (and therefore its
+ * own set of worker threads), and a single display will rarely produce
+ * enough parallelizable work to occupy a large number of processors. On
Review Comment:
fixed the comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-2316: Allow the number of display worker threads per connection to be limited. [guacamole-server]
Posted by "msshapira (via GitHub)" <gi...@apache.org>.
msshapira commented on PR #703:
URL: https://github.com/apache/guacamole-server/pull/703#issuecomment-5207391050
> Overall I'm fine with the changes; however, I wonder if there's something a bit different we should do for the default maximum of threads? Maybe the default of scaling to the maximum number of processors isn't the best option? Is there some sort of default maximum that's actually more appropriate for performance - that is, over X number of threads, you don't see any additional benefit?
@necouchman I agree that a hard limit may be a good idea. Opus suggested X=4, assuming more that that won't give much benefit anyway. Agree?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org