-
Notifications
You must be signed in to change notification settings - Fork 776
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
Reduce number of core threads in HTTPServer to one #786
Conversation
Signed-off-by: Fabian Stäber <fabian@fstab.de>
This PR violates the OpenMetrics spec and should be reverted. Concurrent
exposition must be supported, as it is very common such as a HA pair. This
PR will break users, failing scrapes and adding artifacts to their graphs.
…On Thu 19 May 2022, 22:44 Fabian Stäber, ***@***.***> wrote:
Merged #786 <#786> into
master.
—
Reply to this email directly, view it on GitHub
<#786 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJG5VZRQO32QDBHYVRU6LVK2Y5DANCNFSM5WNRCL2A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for keeping an eye on PRs! In this case I think there is just a misunderstanding with the weird terminology of
This PR sets the |
Thanks for the clarification, that makes perfect sense to do. |
### Motivation prometheus client 0.16.0 contains some approvements that we can benefit from. Thanks for @dave2wave @michaeljmarshall the reminder and pointing out. > [ENHANCEMENT] Reduce the number of core threads in HTTPServer from 5 to 1. The HTTPServer will still start up to 5 threads on demand if there are parallel requests, but it will use only 1 thread as long as requests are sequential (prometheus/client_java#786). [ENHANCEMENT] Optimize metric name sanitization: Replace the regular expression with a hard-coded optimized algorithm to improve performance (prometheus/client_java#777). Thanks @fwbrasil See https://github.com/prometheus/client_java/releases ### Modifications Bump prometheus client version from 0.15.0 to 0.16.0 ### Documentation Check the box below or label this PR directly. Need to update docs? - [x] `doc-not-needed` dependency updates, no need doc
prometheus/client_java#786 reduced the core pool size to 1 for the http executor size. This had adverse effects in our environment leading to connectivity issues to metrics port This patch overrides that behaviour reverting back to 5 persistent threads in the executor pool
@fstab we have a setup using the Prometheus client including this change, and we started to experience some inconveniences. Our setup is Kafka on Kubernetes, running prometheus/jmx_exporter as an agent attached to the Kafka process. Our scrape duration is about 12 seconds. After upgrading the Prometheus client to include this fix, we started experiencing health-check network timeouts. Investigations showed us that the latency when calling We normally thought about increasing the timeout, which is one of the options beside rolling back the Prometheus Java client version to 0.16. |
@ctrlaltluc thanks a lot for pointing this out. This was a bug. Apparently the description of I pushed a fix, switching to a cached thread pool executor. |
### Motivation prometheus client 0.16.0 contains some approvements that we can benefit from. Thanks for @dave2wave @michaeljmarshall the reminder and pointing out. > [ENHANCEMENT] Reduce the number of core threads in HTTPServer from 5 to 1. The HTTPServer will still start up to 5 threads on demand if there are parallel requests, but it will use only 1 thread as long as requests are sequential (prometheus/client_java#786). [ENHANCEMENT] Optimize metric name sanitization: Replace the regular expression with a hard-coded optimized algorithm to improve performance (prometheus/client_java#777). Thanks @fwbrasil See https://github.com/prometheus/client_java/releases ### Modifications Bump prometheus client version from 0.15.0 to 0.16.0 ### Documentation Check the box below or label this PR directly. Need to update docs? - [x] `doc-not-needed` dependency updates, no need doc (cherry picked from commit 948000b)
prometheus/client_java#786 reduced the core pool size to 1 for the http executor size. This had adverse effects in our environment leading to connectivity issues to metrics port This patch overrides that behaviour reverting back to 5 persistent threads in the executor pool
prometheus/client_java#786 reduced the core pool size to 1 for the http executor size. This had adverse effects in our environment leading to connectivity issues to metrics port This patch overrides that behaviour reverting back to 5 persistent threads in the executor pool
In a typical scenario with a Prometheus server scraping every 15 seconds, one thread should be enough in
HTTPServer
. Reduce the number of core threads from 5 to 1.