英文:
How to setting http thread pool max size on quarkus
问题
抱歉,我不太了解 Quarkus 上的 HTTP 线程池如何工作。
我想设置 HTTP 线程池的最大大小,但我在 Quarkus 文档 中看到有很多关于线程的配置属性。
我尝试逐个进行设置,并在 Prometheus 上检查是否起作用。但是 prometheus 的 base_thread_max_count 总是不匹配我的配置。
因此,我想知道如何进行设置并进行检查。非常感谢!
英文:
Sorry, I'm not really know about http thread pool how work on Quarkus.
I want setting http thread pool max size, But I see the Quarkus doc have a lot config property about thread.
I try setting each that and check it working or not on prometheus. but prometheus base_thread_max_count always not match my config.
So, I want know how setting and check that.
Thanks so much
答案1
得分: 4
如果您指的是仅处理HTTP I/O事件的池,那么是 quarkus.http.io-threads
。
如果您指的是处理阻塞操作的工作池,那么是 quarkus.vertx.worker-pool-size
。
指标 base_thread_max_count
对此并不真正相关,它显示的是JVM中曾经活动的线程的最大数量,因此它考虑了与HTTP层无关的各种线程。要查看活动的I/O线程数,我建议获取线程转储并计算名为 vert.x-eventloop-thread-*
的线程数量,对于工作线程,是 executor-thread-*
。
还要注意,工作线程是懒惰地创建的,因此将 quarkus.vertx.worker-pool-size
设置为较大的数字可能不会立即产生任何效果。
英文:
If you mean the pool that handles HTTP I/O events only, then that's quarkus.http.io-threads
If you mean the worker pool that handles blocking operations, that's quarkus.vertx.worker-pool-size
The metric base_thread_max_count
isn't really relevant to this, it shows you the maximum number of threads ever being active in that JVM, so it takes into account various threads unrelated to the HTTP layer. To see the number of active IO threads, I'd suggest taking a thread dump and counting the threads named vert.x-eventloop-thread-*
, for worker threads it is executor-thread-*
.
Also bear in mind that worker threads are created lazily, so setting a high number to quarkus.vertx.worker-pool-size
might not have any immediate effect.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论