是否可以通过JMX使JBoss中的单个会话无效? [英] Is it a possible to invalidate an individual session in JBoss through JMX?

查看:123
本文介绍了是否可以通过JMX使JBoss中的单个会话无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在跟踪应用程序中的一些内存问题,并且我们可以看到问题似乎存在的会话大小。它只会影响某些会话,它们似乎会失控,并且我们希望能够或多或少地手动使这些会话无效以回收该内存。有没有办法通过JMX做到这一点?我们正在使用JBoss 4.5.2。

We are tracking down some memory issues in our application and we have visibility into the size of our sessions where the problem seems to be. It is only affecting certain sessions where they seem to balloon out of control and we'd like to have the ability to invalidate those sessions more-or-less 'by hand' to reclaim that memory . Is there a way to do this through JMX? We are using JBoss 4.5.2 .

提前致谢。

推荐答案

答案是肯定的,你可以。

The answer is yes, you can.

- 这将获得在JBoss中加载的Web模块MBean -

--this gets the web module MBeans loaded in JBoss--

/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh -s< - ServerIP - >:1099 query'jboss.web:*'| greptype = Manager

- 一旦你有了,你可以从那个MBean获得活动会话 -

--Once you have that you can get the active sessions from that MBean--

/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh -s 172.16.0.216:1099调用< - MBean-- >listSessionIds

- 最后,一旦你有了这个列表,你就可以选出感兴趣的会话并使它过期 -

--And finally, once you have that list, you can pick out the session of interest and expire it--

/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh -s< - ServerIP - >:1099调用< - MBean - >expireSession< - SessionID - >

您将替换< - ServerIP - >用ip绑定服务器...它不一定是本地的。只要您有权访问端口1099,就可以远程运行。

You would replace <--ServerIP--> with the ip the server is bound on...it need not be local. This can be run remotely as long as you have access to port 1099.

< - MBean - >将替换为第一个查询的结果之一。

<--MBean--> would be replaced with one of the results of the first query.

< - SessionID - >将替换为第二个命令中的一个会话ID。

<--SessionID--> would be replaced with one of the session ids from the second command.

此外,您还可以将/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh替换为机器上旋转的位置。它包含在JBoss中。

Also you would replace /opt/lib/jboss-4.2.3.GA/bin/twiddle.sh with the location of twiddle on your machine. It is included in JBoss.

这篇关于是否可以通过JMX使JBoss中的单个会话无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆