亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

監控Springboot 2.0 Tomcat服務器線程利用率

監控Springboot 2.0 Tomcat服務器線程利用率

慕絲7291255 2023-06-14 16:05:24
我已經使用以下 tomcat 參數啟動了我的 springboot 應用程序-Dserver.tomcat.max-threads=400 -Dserver.tomcat.max-connections=4000我想監控繁忙的線程和繁忙的連接大???springboot里面有內置解決方案嗎?否則我需要獲得 mbean 嗎?
查看完整描述

3 回答

?
手掌心

TA貢獻1942條經驗 獲得超3個贊

起初,我使用 Spring Boot Actuator 和 Micrometer。但它不顯示 tomcat 線程利用率。所以我這樣配置了application.yml。


server:

  port: 3200

  address: 0.0.0.0

  tomcat:

    max-threads: 4000

    mbeanregistry:

      enabled: true

我設置server.tomcat.mbeanregistry.enabled為真。然后 Tomcat 線程利用率顯示在 /actuator/metrics 中。


這是我的輸出。

{

  "names": [

    "http.server.requests",

    "http.server.requests.histogram",

    "jvm.buffer.count",

    "jvm.buffer.memory.used",

    "jvm.buffer.total.capacity",

    "jvm.classes.loaded",

    "jvm.classes.unloaded",

    "jvm.gc.live.data.size",

    "jvm.gc.max.data.size",

    "jvm.gc.memory.allocated",

    "jvm.gc.memory.promoted",

    "jvm.gc.pause",

    "jvm.memory.committed",

    "jvm.memory.max",

    "jvm.memory.used",

    "jvm.threads.daemon",

    "jvm.threads.live",

    "jvm.threads.peak",

    "jvm.threads.states",

    "logback.events",

    "process.cpu.usage",

    "process.files.max",

    "process.files.open",

    "process.start.time",

    "process.uptime",

    "system.cpu.count",

    "system.cpu.usage",

    "system.load.average.1m",

    "thread.pool.core.size",

    "thread.pool.max.size",

    "thread.pool.pool.size",

    "thread.pool.thread.count",

    "tomcat.cache.access",

    "tomcat.cache.hit",

    "tomcat.global.error",

    "tomcat.global.received",

    "tomcat.global.request",

    "tomcat.global.request.max",

    "tomcat.global.sent",

    "tomcat.servlet.error",

    "tomcat.servlet.request",

    "tomcat.servlet.request.max",

    "tomcat.sessions.active.current",

    "tomcat.sessions.active.max",

    "tomcat.sessions.alive.max",

    "tomcat.sessions.created",

    "tomcat.sessions.expired",

    "tomcat.sessions.rejected",

    "tomcat.threads.busy",

    "tomcat.threads.config.max",

    "tomcat.threads.current"

  ]

}


查看完整回答
反對 回復 2023-06-14
?
躍然一笑

TA貢獻1826條經驗 獲得超6個贊

一種簡單的方法是使用上面帶有測微計的彈簧執行器。您可以獲得即時的 JMX 指標,也可以聲明您自己的自定義指標。



查看完整回答
反對 回復 2023-06-14
?
侃侃無極

TA貢獻2051條經驗 獲得超10個贊

您可以使用Spring Boot Actuator(/metrics 端點)來提供有關內存、堆、處理器、線程、加載的類、卸載的類、線程池等信息。

例如,此端點返回:

"threads.peak"?:?...,
"threads.daemon"?:?...,
"threads"?:?...,

此外,如果需要,您可以使用 /threaddump 端點獲取線程轉儲。


查看完整回答
反對 回復 2023-06-14
  • 3 回答
  • 0 關注
  • 364 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號