I would like to have a possibility to use jconsole in production, but am a bit concerned about performance. Is it ok to leave JMX agent running (via -Dcom.sun.management.jmxremote) or will it have a noticeable performance footprint?
Asked
Active
Viewed 1.5k times
28
-
1related http://stackoverflow.com/questions/313730/is-a-good-idea-to-enable-jmx-lambda-probe-on-a-production-server – JoseK Jul 21 '10 at 12:15
-
Thanks a lot, JoseK, this link contains all answers that I need! – azerole Jul 21 '10 at 13:00
-
Possible duplicate of [Is enabling JConsole remote monitoring affect system performance in production?](https://stackoverflow.com/questions/6577758/is-enabling-jconsole-remote-monitoring-affect-system-performance-in-production) – slm Jul 16 '17 at 16:14
2 Answers
19
In general running the JVM with JMX enabled does not incur in appreciable performance hits. The performance hit happens only when a tool like jconsole is connected and actually polling for information.
See the below link for more details:
-
@tanderson Thanks for fixing the link. To make this answer even more time-proof I reccommend pasting the relevant parts of the linked article into this answer (OFC after verifying the license of the content). – jannis Dec 19 '22 at 11:51
-
That post is from 2006 and claims to be 'highly unscientific'. He says `Running with-Dcom.sun.management.jmxremote has no appreciable impact. Connecting jconsole has an impact of 3--4%.' I'd like to see if the percentages for connecting jconsole holds for other tests but haven't found other references. – tanderson Dec 20 '22 at 22:00
3
From Tuning Your GlassFish – Performance Tips :
General Tuning Tips
Unused features could have a negative impact on the performance and should be disabled:
Auto-deployment of applications
JMX Monitoring
JMS
Dynamic JSP reloading
JDBC Connection validation
Security Manager could be turned off if the applications are all trusted internal applications
Source: http://wiki.glassfish.java.net/attach/GlassFishDay2008Hyderabad/GlassFishDay2008PerfPreso.pdf (PDF document)

bakkal
- 54,350
- 12
- 131
- 107
-
3yes, obviously turn off things you're not using, but if you're using JMX for monitoring, then likely it's worth the overhead. – Peter Drier Jun 07 '13 at 19:16