理解 Dropwizard 的 JMX 指标排队线程池

huangapple go评论109阅读模式
英文:

Understanding Dropwizard JMX metric Queued Thread Pool

问题

以下是翻译好的部分:

来自排队线程池的4个指标

jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.size.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.jobs.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization.max.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization.Value

它们代表什么?理想值是多少?

英文:

There are 4 metric from Queued Thread Pool

jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.size.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.jobs.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization.max.Value
jmx.metrics.org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization.Value

What do they mean? what is ideal value?

答案1

得分: 9

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.jobs

“等待线程的作业数量”。希望这个指标尽可能低,因为您不希望请求等待被处理。偶尔可能会出现1,但那是当指标获取其值时发生的,即在单个作业在队列中的微小时间内,这不是什么需要担心的事情,因为所有请求都必须从队列中处理。

理想情况:理想情况下,此值应接近0。每当这个数字增加而且 dw.size < maxThreads 时,Dropwizard 将会启动新线程。从而将等待重置为0。

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.size

“池中当前的线程数”。这些是服务请求的(Jetty)Web 服务器中的线程。

理想情况:此数字应小于您在 config.yml 中定义的 maxThreads(默认为1024)。如果您看到这个指标接近 maxThreads 而且 QueuedThreadPool.dw.jobs 没有减少,您应该调查为什么使用了这么多线程,并在您的机器支持的情况下尝试增加它。

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization

“池中当前正在使用的线程数(例如,池中当前有多少线程处于非空闲状态)”

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization-max

“当前正在使用的线程数与池最大可增长线程数的比较”。

理想情况:这应该小于1。如果这个值经常为1,则应增加 maxthread 计数。

来源和参考资料 nickb

英文:

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.jobs

> “Number of jobs queued waiting for a thread”. This metric you want as low as possible as you don’t want requests waiting to be served. You may get the occasional 1, but that is when the metric grabbed it’s value, during the miniscule amount of time a single job is in the queue, and it is nothing to worry about, as all requests have to be served from the queue.

>Ideal: Ideally this value should be close to 0. Whenever this number will go up and dw.size < maxThreads, dropwizard will spun up new thread. Thus resetting waiting to 0.

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.size
>The number of threads currently in the pool”. These are the threads in the (Jetty) web server that are servicing requests.

> Ideal: this number will be less than maxThreads (default 1024) that you define in your config.yml. If you see this metric going close to maxThreads and QueuedThreadPool.dw.jobs is not decreasing you should investigate why so many threads are being used and try to increase it, if your machines can support it.

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization
> the number of threads currently being used in the pool (eg. how many threads currently in the pool are not idle)

org.eclipse.jetty.util.thread.QueuedThreadPool.dw.utilization-max
>the number of threads currently being used compared to what the maximum number of threads the pool can grow to.

> Ideal: this should be less than 1. If this is constantly 1 then you should increase maxthread count.

source and credits nickb

huangapple
  • 本文由 发表于 2020年9月28日 18:06:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/64100086.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定