首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从weblogic Server收集线程卡住的最佳方法

问从weblogic Server收集线程卡住的最佳方法
EN

Stack Overflow用户
提问于 2018-03-22 22:32:48
回答 2查看 642关注 0票数 0

我需要在生产环境中收集有关weblogic服务器的不同信息。我目前正在使用restful管理服务api来收集很多信息,比如健康和状态。但是这个api不能给我提供像threadstuck这样的信息。

我的问题是,使用python或其他语言收集线程卡住的最好方法是什么。

EN

回答 2

Stack Overflow用户

发布于 2018-03-23 16:51:44

我认为最好的方法是使用JMX和运行时mbeans。ThreadPoolRuntimeMBean是获取所有exexute线程然后获取其状态的入口点。如果线程被占用或卡住,您还将获得信息。看看mbean reference documentation吧。

票数 0
EN

Stack Overflow用户

发布于 2018-03-24 03:07:11

这实际上是相当困难的。如果您使用的是WLS11g,则需要运行每个应用程序的所有工作管理器运行时。如果您的WLS是一个12c环境,那么每个服务器运行时都有一个具有"stuckthreadcount“属性的ThreadPoolRuntime。

下面是一个WLS 12c wlst示例,它打印每个服务器的阻塞线程数:

代码语言:javascript
复制
## Prevent printing WLST verbose output to the screen
redirect('/dev/null','false')

## Insert your own password here
connect("weblogic", <your password>, "t3://localhost:7001")

domainRuntime()
servers = ls('/ServerRuntimes','true','c')
result = dict()
for server in servers:
    cd('/ServerRuntimes/' + server + '/ThreadPoolRuntime/ThreadPoolRuntime')
    result[server] = get('StuckThreadCount')

## Reenable printing output
redirect('/dev/null','true')
for key in result:
        print(key + " has "  + str(result[key]) + " stuck threads.")
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49431324

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档