{"id":13866,"date":"2021-02-05T08:59:30","date_gmt":"2021-02-05T13:59:30","guid":{"rendered":"https:\/\/www.eginnovations.com\/blog\/?p=13866"},"modified":"2024-12-10T05:11:06","modified_gmt":"2024-12-10T10:11:06","slug":"jboss-performance-tuning","status":"publish","type":"post","link":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/","title":{"rendered":"How to Tune a JBoss Application Server for High Performance"},"content":{"rendered":"<div class=\"inner_content\">\n<p>In this guide we&#8217;re going to look at JBoss performance tuning tips and techniques across four different areas. However, it should be noted that simply doing performance tuning on JBoss alone is not enough to produce a high performance application. It is just one of the steps that you need to follow. We&#8217;ll get into more details about how to do total performance tuning for Java applications later on in this guide.<\/p>\n<p><a href=\"https:\/\/www.eginnovations.com\/supported-technologies\/jboss-monitoring\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-31716\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner.webp\" alt=\"\" width=\"1140\" height=\"180\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner.webp 1140w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-300x47.webp 300w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-1024x162.webp 1024w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-768x121.webp 768w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-800x126.webp 800w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-310x49.webp 310w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/Jboss-banner-140x22.webp 140w\" sizes=\"auto, (max-width: 1140px) 100vw, 1140px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_is_JBoss\"><\/span>What is JBoss?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>JBoss\u00a0is an open source, standards-compliant, J2EE application server implemented in 100% pure Java. There are many variants of JBoss available today:<\/p>\n<ul>\n<li>JBoss EAP is the name for the Java EE application server that Red Hat produces and supports.<\/li>\n<li>JBoss AS and WildFly are the community versions of the JBoss application server.<\/li>\n<\/ul>\n<p>While Apache Tomcat used to be the underlying engine for JBoss EAP and AS, more recently, Undertow is used as the application server engine.<\/p>\n<p>For long, JBoss has been one of the most popular and free application servers available. As a result, it has found applicability across several verticals and use cases. When deployed in production, it is essential that the JBoss application server performs well. This requires that JBoss be configured to handle the maximum load possible and yet provide the best response time to users. The performance that an application server delivers is often dependent on how well it is configured. Often, the default settings provided are non-optimal. This blog post documents best practices that you should employ when deploying JBoss in production.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"A_Holistic_Approach_is_Needed_for_Tuning_JBoss_Performance\"><\/span>A Holistic Approach is Needed for Tuning JBoss Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"alignright\" style=\"margin-top: 15px; margin-left: 25px; margin-bottom: 15px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13867 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tomcat-tuning.jpg\" alt=\"Key areas for JBoss Monitoring\" width=\"310\" height=\"347\" border=\"0\" \/><center class=\"fontmedium\" style=\"margin-top: 10px; line-height: 22px; font-size: 14px;\"><em>Performance tuning must be done at every layer:<br \/>\nthe operating system, JVM, JBoss container,<br \/>\nand at the application code-level<\/em><\/center><\/div>\n<p>A first step to achieving high performance is to recognize that tuning the JBoss application server alone is not sufficient. After all, JBoss runs on top of a\u00a0<a href=\"https:\/\/www.eginnovations.com\/supported-technologies\/jvm-monitoring\">Java virtual machine<\/a>\u00a0(JVM). So, a poorly configured JVM will compromise performance. Likewise, the JVM runs on an operating system and it is important to have the best possible operating system configuration to achieve the highest performance possible. Even bottlenecks in the\u00a0<a href=\"https:\/\/www.eginnovations.com\/blog\/java-code-level-visibility\/\">application code<\/a>\u00a0can result in \u201cJBoss is slow\u201d complaints.<\/p>\n<p>All in all, a holistic approach must be taken for JBoss performance tuning.<\/p>\n<p>In the following sections, we will present best practices to tune the JBoss application server. This will involve:<\/p>\n<div class=\"link_list_style\" style=\"margin-top: 10px;\">\n<ol class=\"ol_style_line\" style=\"margin: 0;\">\n<li>1 <a href=\"#question1\" rel=\"question1\">Configuring the Operating System<\/a><\/li>\n<li>2 <a href=\"#question2\" rel=\"question2\">Tuning the JVM <\/a><\/li>\n<li>3 <a href=\"#question3\" rel=\"question3\">Configuring the JBoss Container<\/a><\/li>\n<li>4 <a href=\"#question4\" rel=\"question4\">Detecting application code bottlenecks<\/a><\/li>\n<\/ol>\n<\/div>\n<h2 id=\"question1\"><span class=\"ez-toc-section\" id=\"Configuring_the_Operating_System_for_High_Performance\"><\/span>Configuring the Operating System for High Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-13875\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-configuration.png\" alt=\"Configuring the operating system for high performance\" width=\"150\" height=\"113\" border=\"0\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-configuration.png 150w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-configuration-140x105.png 140w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/p>\n<ul>\n<li>Ensure that the server operating system is sized correctly for the expected workload. Monitor the utilization of server CPU and memory to ensure that there are no CPU and memory bottlenecks. To achieve best performance, use a 64-bit operating system.<\/li>\n<li>For best performance, ensure that a dedicated system is provided for JBoss. If the system being used is a virtual machine, ensure that VM Ready time is low (well below 5%), which means that the VM is getting CPU when it needs it. In a cloud environment, make sure that the server\u2019s resource usage is not hitting any resource configuration limit (e.g., DTU usage is not close to 100% in Microsoft Azure).<\/li>\n<li>There are also several well documented operating system tweaks that should be applied to get the maximum performance:\n<ul>\n<li>On all JBoss or WildFly servers, set the Open Files (ulimit \u2013n) to at least 50,000 for the user that runs the JBoss or WildFly process.<\/li>\n<li>On all JBoss or WildFly servers, set the User Process (ulimit \u2013u) to at least 131,072 for the user that runs the JBoss or WildFly process.<\/li>\n<li>Set the connection backlog accordingly. Change the value of the echo parameter to 3,000 when a high rate of incoming connection requests result in connection failures:\n<pre>echo 3000 &gt; \/proc\/sys\/net\/core\/netdev_max_backlog<\/pre>\n<pre>echo 3000 &gt; \/proc\/sys\/net\/core\/somaxconn<\/pre>\n<\/li>\n<li>Set the value of the\u00a0TCP_KEEPALIVE_INTERVAL parameter to\u00a015 seconds, which is the recommended value.\u00a0The default value is\u00a075 seconds.\n<pre>echo 15 &gt; \/proc\/sys\/net\/ipv4\/tcp_keepalive_intvl<\/pre>\n<\/li>\n<li>The TCP_KEEPALIVE_PROBES parameter determines the number of probes before timing out. Set the value of the TCP_KEEPALIVE_PROBES parameter to 5 seconds, which is the recommended value. The default value is 9 seconds.\n<pre>echo 5 &gt; \/proc\/sys\/net\/ipv4\/tcp_keepalive_probes<\/pre>\n<\/li>\n<\/ul>\n<p>If the JBoss server is deployed on a Microsoft Windows server, changes to Windows registry settings may be required. See this\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/biztalk\/technical-guides\/settings-that-can-be-modified-to-improve-network-performance\">article<\/a>\u00a0for a list of registry changes recommended.<\/li>\n<\/ul>\n<h2 id=\"question2\"><span class=\"ez-toc-section\" id=\"Tuning_JBoss_JVM\"><\/span>Tuning JBoss\u2019 JVM<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>As JBoss uses a JVM, the performance of the JVM impacts JBoss\u2019 performance as well:<\/p>\n<ul>\n<li>Before you start adjusting any settings, you should make sure that you have chosen a modern JVM for your application. There are many benchmarks that indicate 5-20% performance gains from each version of Java (refer to this\u00a0<a href=\"https:\/\/www.optaplanner.org\/blog\/2019\/01\/17\/HowMuchFasterIsJava11.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">article<\/a> for more details).<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-13890\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-jvm.png\" alt=\"Tuning JBoss\u2019 JVM\" width=\"200\" height=\"97\" border=\"0\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-jvm.png 200w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-jvm-140x68.png 140w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/>Many JVMs are available in 32-bit and 64-bit modes. While the 32-bit mode is limited to 2GB of memory, 64-bit JVMs allow for the Java heap to be set much higher. Hence, make sure you are using a 64-bit JVM for best performance and highest scalability.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.eginnovations.com\/blog\/what-is-garbage-collection-java\/\/\">Garbage collection<\/a> is the process by which Java programs perform automatic memory management.\u00a0In the past, garbage collection was done in a stop-the-world manner. That is, when garbage collection happened, the application was paused to reclaim memory. Today, there are many garbage collection implementations where the garbage collection happens in parallel with the application execution:<\/p>\n<ul>\n<li>For best performance, make sure that you choose a modern garbage collector like\u00a0<a href=\"https:\/\/docs.oracle.com\/javase\/9\/gctuning\/garbage-first-garbage-collector.htm\">G1GC<\/a><br \/>\n(Garbage First Garbage Collector) or the\u00a0<a href=\"https:\/\/docs.oracle.com\/en\/java\/javase\/13\/gctuning\/available-collectors.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Z Garbage Collector<\/a>.<\/li>\n<li>The MaxGCPauseMillis setting for the JVM can be used to set the peak pause time expected in the environment. It is recommended that this value be between 500-2000ms for best performance. While longer pauses increase throughput, shorter pauses reduce the latency and the throughput<strong>.\u00a0<\/strong>In addition to the different GC settings, monitor the JBoss server in production and make sure that the percentage of time that the JVM spends on garbage collection is low. Any value over 5% will be detrimental to JBoss\u2019 performance.<\/li>\n<\/ul>\n<p>Memory availability in the JVM can also adversely impact\u00a0JBoss performance:<\/p>\n<ul>\n<li>You must make sure that sufficient memory is available in all the heap and non-heap memory pools. If any of the memory pools is running out of available memory, you will encounter OutOfMemory exceptions and the application can fail in unexpected ways. Use the Xmx and Xms flags of the JVM to set the maximum heap size and stack size, and the XX flags to set the PermSize or MetaspaceSize depending on the version of the JRE being used (read this\u00a0<a href=\"https:\/\/dzone.com\/articles\/permgen-and-metaspace\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">article<\/a> for additional details).<\/li>\n<\/ul>\n<div class=\"alignright\" style=\"margin-top: 0px; margin-bottom: 10px; margin-left: 25px;\"><a href=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-class-files-memory-view.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13873 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-class-files-memory.jpg\" alt=\"Jboss memory monitoring\" width=\"400\" height=\"280\" border=\"0\" \/><\/a><center class=\"fontmedium\" style=\"margin-top: 10px; line-height: 20px; font-size: 14px;\"><em>Make sure that the memory available to each of the memory<br \/>\npools of the JVM is sufficient. Memory shortage will<br \/>\nadversely affect JBoss server performance.<\/em><\/center><\/div>\n<ul>\n<li>Setting the memory limits is often a trial-and-error process. Setting the memory limits to be too low can result in exceptions while setting them too high can result in waste of resources. Use a\u00a0<a href=\"https:\/\/www.eginnovations.com\/supported-technologies\/jvm-monitoring\">JVM monitoring tool<\/a> and analyze performance during a week or more, considering peak hours as well to determine optimal values of the JVM memory pools.<\/li>\n<\/ul>\n<p>If memory grows unbounded in the JVM, you will need to determine if there is a memory leak in the application:<\/p>\n<ul>\n<li>Take a memory heap dump by using Java built-in tools, such as <a href=\"https:\/\/www.eginnovations.com\/blog\/free-java-monitoring-tools-pros-cons\/\">JvisualVM<\/a> and <a href=\"https:\/\/www.eginnovations.com\/blog\/free-java-monitoring-tools-pros-cons\/\">Jconsole<\/a>. Use tools such as the <a href=\"https:\/\/www.eginnovations.com\/blog\/free-java-monitoring-tools-pros-cons\/\">Eclipse Memory Analyzer<\/a> (MAT) to determine memory leak suspects. The Dominator Tree of MAT will help you narrow down which threads\/objects are causing the memory leak.<\/li>\n<\/ul>\n<p>Finally, track thread activity in the JVM:<\/p>\n<ul>\n<li>Whereas total threads in the JVM must be tracked to discover any thread leaks, it is important to track\u00a0<a href=\"https:\/\/www.eginnovations.com\/blog\/troubleshooting-java-application-deadlocks-diagnosing-application-hang-situations\/\">thread blocks and deadlocks<\/a> as they are detrimental to performance. Stack trace of blocking threads and deadlocked threads can reveal application code-level issues.<\/li>\n<\/ul>\n<div style=\"margin-top: 15px; margin-bottom: 15px;\"><a href=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard-view.jpg\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13879 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard.jpg\" alt=\"Monitoring Dashboard showing Jboss threads and deadlocks\" width=\"650\" height=\"384\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard.jpg 650w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard-300x177.jpg 300w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard-310x183.jpg 310w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-jvm-thread-tracking-dashboard-140x83.jpg 140w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><center class=\"fontmedium\" style=\"margin-top: 10px; line-height: 20px; font-size: 14px;\"><em>Identifying thread blocks and deadlocks causing application hangs<\/em><\/center><\/div>\n<ul>\n<li>In addition, monitor the CPU usage of individual threads to detect run-away threads that are taking CPU and slowing down JBoss. Again, any JVM-level monitoring tool can provide these insights.<\/li>\n<li>In some cases, background threads of an application may be taking excessive resources. By\u00a0<a href=\"https:\/\/www.eginnovations.com\/blog\/java-threads\/\">monitoring thread activity<\/a>, you can determine such scenarios and even determine the line of code\/method that is causing the problem.<\/li>\n<\/ul>\n<div style=\"margin-top: 15px; margin-bottom: 15px;\"><a href=\"https:\/\/www.eginnovations.com\/supported-technologies\/java-application-monitoring\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13872 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/java-jvm.png?2021\" alt=\"JBoss monitoring tool - free trial\" width=\"850\" height=\"150\" border=\"0\" \/><\/a><\/div>\n<h2 id=\"question3\"><span class=\"ez-toc-section\" id=\"Tuning_the_JBoss_Container\"><\/span>Tuning the JBoss Container<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-13870 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-container.jpg\" alt=\"Tuning the JBoss container\" width=\"280\" height=\"221\" border=\"0\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-container.jpg 280w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/tuning-jboss-container-140x111.jpg 140w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/>As is the case with the JVM, many scalability and security enhancements have been made with the latest releases. Hence, make sure that you are using the latest version of JBoss\/Wildfly.<\/p>\n<p>There are several configuration parameters that must be tweaked to scale a JBoss server instance. The exact configuration depends on the version of JBoss and whether the underlying servlet container is based on Tomcat or Undertow.<\/p>\n<div style=\"margin-top: 15px; margin-bottom: 15px;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13876 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-configuration-parameters.jpg?2021\" alt=\"Key JBoss components\" width=\"600\" height=\"94\" border=\"0\" \/><center class=\"fontmedium\" style=\"margin-top: 0px; line-height: 20px; font-size: 14px;\"><em>Key JBoss container components involved in request processing<\/em><\/center><\/div>\n<ul>\n<li><strong>Web Front-end Tuning<\/strong><br \/>\nTo tune the performance of a Java application server, it is important to understand the different steps involved in processing a request. The figure above shows a request from a Web front-end reaching WildFly EJBs, which in turn issues queries to a backend database server.In the JBoss\/Wildfly application server, the web request\u00a0is handled by an\u00a0Undertow XNIO thread. Setting a sufficient number of\u00a0IO threads\u00a0in the Undertow web container is extremely important, otherwise you will have a bottleneck in the first stage itself.Provided that there are enough\u00a0io-threads\u00a0to serve your http request, the\u00a0task-core-threads\u00a0(first) and the\u00a0task-max-threads\u00a0(after) are used to determine if the request is served or if it is discarded. Hence, it is important to configure the io-threads, task-core-threads and task-max-threads accordingly in the XNIO pool configuration. These settings are configured through the Undertow IO subsystem:<\/p>\n<pre>\/subsystem=io\/worker=default\/:write-attribute(name=task-core-threads,value=50)\r\n\/subsystem=io\/worker=default\/:write-attribute(name=task-max-threads,value=100)\r\n\/subsystem=io\/worker=default\/:write-attribute(name=io-threads,value=100)<\/pre>\n<p>You also need to consider the\u00a0<strong>number of sessions,<\/strong>\u00a0which are running. The parameter\u00a0<strong>max-active-sessions<\/strong>\u00a0is used to determine how many active HTTP sessions are allowed. When the number of active sessions exceeds the max-active-sessions setting, the oldest session known to the session manager will\u00a0<strong>passivate<\/strong>\u00a0to make room for the new session. To avoid this, set the max-active-sessions number accordingly in the jboss-web.xml file:<\/p>\n<pre>&lt;jboss-web&gt;\r\n &lt;max-active-sessions&gt;200&lt;\/max-active-sessions&gt;\r\n&lt;\/jboss-web&gt;<\/pre>\n<p>Continuous monitoring is necessary to ensure that there are no bottlenecks in web request handling \u2013 either due to insufficient worker threads or due to a low max sessions limit.<\/li>\n<li><strong>EJB Container Tuning<\/strong>: After an IO thread finishes processing a request, an EJB is picked up from the\u00a0Pool(Stateless EJB) or pinned from the\u00a0Cache\u00a0(Stateful EJB). If you are using Stateless Session Beans, be aware that\u00a0EJB pooling is not enabled by default on WildFly 8. A poorly configured pool of EJBs could be even detrimental in terms of performance, and hence, setting the correct configuration for the EJB cache is important.\n<ul>\n<li><strong>Tuning Database Connection Pooling: <\/strong>In case you are dealing with Database connections, you must acquire a connection from the pool, that is governed by the JCA layer. The key configuration parameter is max-pool-size, which specifies the maximum number of connections for a pool (default 20).\u00a0Note that there will be a maximum limit for the number of connections allowed by the database to match. You can set your\u00a0<strong>Connection pool max size<\/strong>\u00a0to a different attribute using this CLI:\n<pre>\/subsystem=datasources\/data-source=MySQLDS\/:write-attribute(name=max-pool-size,value=50)<\/pre>\n<p>Monitoring of connection pool usage is important to ensure that there are sufficient connections available in the pool to handle the workload being handled by the Wildfly server.<\/li>\n<\/ul>\n<\/li>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Other optimizations: <\/strong>There are several other optimizations that can be performed depending on whether Tomcat or Undertow is the servlet engine used. We have discussed several <a href=\"https:\/\/www.eginnovations.com\/blog\/tomcat-performance-tuning\/\">optimizations for Tomcat<\/a> in an earlier blog. For Undertow:\n<ul>\n<li><strong>Consider tuning the buffer cache<\/strong>. A buffer cache is used to cache static files handled by the\u00a0undertow This includes images, static HTML, CSS, and JavaScript files. Having an optimized buffer cache for your servlet container can improve Undertow performance for serving static files.<\/li>\n<li><strong>JSP Compilation optimizations<\/strong>: There are JSP configuration options for Undertow servlet containers that provide optimizations for how JSP pages are compiled into Java bytecode:\n<ol class=\"green_tick \">\n<li><strong>generate-strings-as-char-arrays: <\/strong>If your JSPs contain a lot of\u00a0Stringconstants, enabling this option optimizes scriplets by converting the\u00a0String\u00a0constants to\u00a0char<\/li>\n<li><strong>optimize-scriptlets: <\/strong>If your JSPs contain many\u00a0Stringconcatenations, enabling this option optimizes scriplets by removing\u00a0String\u00a0concatenation for every JSP request.<\/li>\n<li><strong>trim-spaces: <\/strong>If your JSPs contain a lot of white space, enabling this option trims the white space from HTTP requests and reduces HTTP request payload.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Tuning Listeners<\/strong>: Depending on your applications and environment, you can configure multiple listeners specific to certain types of traffic.Some performance-related options for listeners include:<strong>max-connections<\/strong>This is the maximum number of concurrent connections that the listener can handle. By default, this attribute is undefined, which results in unlimited connections.You can use this option to set a ceiling on the number of connections a listener can handle, which might be useful to cap resource usage. While configuring this value, you should consider your workload and traffic type.<strong>no-request-timeout<\/strong>This is the length of time in milliseconds that a connection is idle before it is closed. The default value is 60000 milliseconds (1 minute).\n<p>Tuning this option in your environment for optimal connection efficiency can help improve network performance. If idle connections are prematurely closed, there are overheads in re-establishing connections. If idle connections are open for too long, they unnecessarily use resources.<\/p>\n<p><strong>max-header-size<\/strong><\/p>\n<p>This is the maximum size of a HTTP request header in bytes. The default is 1048576 (1024KB).<\/p>\n<p>Limiting the header size can be useful to prevent certain types of denial-of-service attacks.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.eginnovations.com\/blog\/top-10-java-performance-problems\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13868\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/top-10-jboss-performance-problems.jpg?2021\" alt=\"Top 10 JBoss performance problems\" width=\"850\" height=\"219\" border=\"0\" \/><\/a><\/p>\n<h2 id=\"question4\"><span class=\"ez-toc-section\" id=\"Tuning_the_Application_Code_Performance\"><\/span>Tuning the Application Code Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Inefficient application code can also cause the application deployed on JBoss\/Wildfly to be slow. Logging is a common way to track an application\u2019s operation. However, logging to output files is a synchronized operation and excessive logging can actually slow down application performance.<\/p>\n<p>Employ transaction tracing techniques that are based on\u00a0<a href=\"https:\/\/www.eginnovations.com\/blog\/distributed-transaction-tracing\/\">byte-code instrumentation<\/a>\u00a0to monitor application processing without needing any changes to the application code. These techniques rely on a specially crafted jar file that utilizes the\u00a0<a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/instrument\/Instrumentation.html\">instrumentation API<\/a>\u00a0that the JVM provides to alter existing byte-code that is loaded in a JVM.<\/p>\n<p>IT teams and developers can use this capability to drill down into\u00a0<a href=\"https:\/\/www.eginnovations.com\/supported-technologies\/java-transaction-monitoring\">slow transactions<\/a>\u00a0and proactively detect performance problems before they impact end-users.<\/p>\n<div style=\"margin-top: 15px; margin-bottom: 25px;\"><a href=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow-view.jpg\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13877 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow.jpg\" alt=\"JBoss cross application transaction flow diagram\" width=\"650\" height=\"398\" border=\"0\" srcset=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow.jpg 650w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow-300x184.jpg 300w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow-310x190.jpg 310w, https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/jboss-cross-application-transaction-flow-140x86.jpg 140w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><center class=\"fontmedium\" style=\"margin-top: 10px; line-height: 20px; font-size: 14px;\"><em>Distributed transaction tracing used to identify code-level issues in web applications powered by JBoss<\/em><\/center><\/div>\n<p><a href=\"https:\/\/www.eginnovations.com\/product\/application-performance-monitoring\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13881 size-full\" src=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/slow-tomcat.jpg\" alt=\"Why is Jboss slow?\" width=\"850\" height=\"150\" border=\"0\" \/><\/a><\/p>\n<div class=\"containers mb-4\" style=\"clear:both\">\n \t<div class=\"fixed-free-trial-div mb-3\" id=\"fixedsectioninfo_blog_btn\">\n \t\n \t<style>.containers_hide_row,.all_blogs_bottom{\n \tdisplay:none;\n   \n}\t<\/style>\n                <div class=\"box-style container row pt-4 pb-4  animatedParent animateOnce\" data-sequence=\"100\" style=\"border-bottom: 1px solid #ddd;border-top: 1px solid #ddd;background: #4b4b4b;padding: 15px 15px 0 15px;border-radius: 12px;\">\n                \n                <div class=\"text-center animated fadeIn go\"> \n                <p class=\"text-center mb-4\" style=\"    color: #fff;\">\n\neG Enterprise is an Observability solution for Modern IT. Monitor digital workspaces, <br\/>web applications, SaaS services, cloud and containers from a single pane of glass.\n<\/p>\n                <\/div>\n                    <div class=\"text-center pb-1 animated fadeIn go\" data-id=\"8\">\n                        <a class=\"border-btnhead-eg\"  href=\"https:\/\/www.eginnovations.com\/it-monitoring\/free-trial\"> <span style=\"font-family: GraphikMedium!important;color: #fff;\">Free Trial<\/span><\/a>\n                        <a href=\"https:\/\/www.eginnovations.com\/product\/application-performance-monitoring\" class=\" border-btnhead-eg\" style=\"width:230px;   \"> <svg width=\"24\" height=\"24\" style=\"margin-top:-3px\" version=\"1.1\" id=\"Layer_1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 26.5 26.5\" style=\"enable-background:new 0 0 26.5 26.5;\" xml:space=\"preserve\">\n<style type=\"text\/css\">\n\t.st2{fill:#fff !important;stroke:#fff !important;stroke-miterlimit:10;}\n\t\n\t\t.border-btnhead:hover .st2 {\n  fill: #ffffff !important;\n  stroke: #ffffff;\n}\n<\/style>\n<g>\n\t<g>\n\t\t<path class=\"st2\" d=\"M13.3,25.8c-6.9,0-12.5-5.6-12.5-12.5S6.4,0.8,13.3,0.8s12.5,5.6,12.5,12.5S20.2,25.8,13.3,25.8z M13.3,1.8\n\t\t\tC6.9,1.8,1.8,6.9,1.8,13.3S7,24.8,13.3,24.8s11.5-5.2,11.5-11.5S19.6,1.8,13.3,1.8z M11.2,18.1c-0.2,0-0.4-0.1-0.6-0.2\n\t\t\tc-0.3-0.2-0.6-0.6-0.6-1V9.7c0-0.4,0.2-0.8,0.6-1c0.3-0.2,0.8-0.2,1.2,0l6.2,3.6c0.3,0.2,0.6,0.6,0.6,1s-0.2,0.8-0.6,1l-6.2,3.6\n\t\t\tC11.6,18,11.4,18.1,11.2,18.1z\"\/>\n\t<\/g>\n<\/g>\n<\/svg> <span style=\"font-family: GraphikMedium!important;color: #fff;\">&nbsp;See the platform<\/span><\/a>\n                    <\/div>\n                <\/div>\n                \n                 <\/div>\n            <\/div>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You may often hear that application servers based on Java, such as JBoss, are slow or not production ready. In this blog, we have provided a range of best practice configurations to help you get the most out of your JBoss web <a href=\"https:\/\/www.eginnovations.com\/blog\/server-performance-monitoring\/\">application server<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this guide we&#8217;re going to look at JBoss performance tuning tips and techniques across four different areas. However, it should be noted that simply doing performance tuning on JBoss alone is not enough to produce a high performance application. It is just one of the steps that you need to follow. We&#8217;ll get into [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":21191,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"categories":[371,27],"tags":[171,1479,176,427,1481,1478,1488,1491,1483,722,1486,1489,1485,1484,723,1490,1480,429,205,1482,428,1487],"class_list":["post-13866","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-performance-monitoring-apm","category-java-monitoring","tag-java","tag-java-application-server","tag-java-monitoring","tag-jboss","tag-jboss-application","tag-jboss-application-server","tag-jboss-jmx","tag-jboss-mbeans","tag-jboss-metrics","tag-jboss-monitoring","tag-jboss-server","tag-jboss-servlets","tag-jboss-speed","tag-jboss-throughput","tag-jboss-tuning","tag-jboss-urls","tag-jboss-web-server","tag-optimization","tag-performance","tag-redhat-jboss","tag-tuning","tag-what-is-jboss"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JBoss Performance Tuning &amp; Monitoring | eG Innovations<\/title>\n<meta name=\"description\" content=\"JBoss performance tuning made easy! Get in-depth insights into JBoss server &amp; application performance. Free trial available.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JBoss Performance Tuning &amp; Monitoring | eG Innovations\" \/>\n<meta property=\"og:description\" content=\"JBoss performance tuning made easy! Get instant visibility into server and application performance from a single-pane dashboard. Free trials available.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/\" \/>\n<meta property=\"og:site_name\" content=\"eG Innovations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eGInnovations\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-05T13:59:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-10T10:11:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Socialbanner.jpg\" \/>\n<meta name=\"author\" content=\"Arun Aravamudhan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"JBoss Performance Tuning &amp; Monitoring | eG Innovations\" \/>\n<meta name=\"twitter:description\" content=\"JBoss performance tuning made easy! Get instant visibility into server and application performance from a single-pane dashboard. Free trials available.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Socialbanner.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/x.com\/perfclarity\" \/>\n<meta name=\"twitter:site\" content=\"@eginnovations\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Aravamudhan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JBoss Performance Tuning & Monitoring | eG Innovations","description":"JBoss performance tuning made easy! Get in-depth insights into JBoss server & application performance. Free trial available.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/","og_locale":"en_US","og_type":"article","og_title":"JBoss Performance Tuning & Monitoring | eG Innovations","og_description":"JBoss performance tuning made easy! Get instant visibility into server and application performance from a single-pane dashboard. Free trials available.","og_url":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/","og_site_name":"eG Innovations","article_publisher":"https:\/\/www.facebook.com\/eGInnovations","article_published_time":"2021-02-05T13:59:30+00:00","article_modified_time":"2024-12-10T10:11:06+00:00","og_image":[{"url":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Socialbanner.jpg","type":"","width":"","height":""}],"author":"Arun Aravamudhan","twitter_card":"summary_large_image","twitter_title":"JBoss Performance Tuning & Monitoring | eG Innovations","twitter_description":"JBoss performance tuning made easy! Get instant visibility into server and application performance from a single-pane dashboard. Free trials available.","twitter_image":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Socialbanner.jpg","twitter_creator":"@https:\/\/x.com\/perfclarity","twitter_site":"@eginnovations","twitter_misc":{"Written by":"Arun Aravamudhan","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#article","isPartOf":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/"},"author":{"name":"Arun Aravamudhan","@id":"https:\/\/www.eginnovations.com\/blog\/#\/schema\/person\/d788cb81df96a940429c3f5a3b294a6a"},"headline":"How to Tune a JBoss Application Server for High Performance","datePublished":"2021-02-05T13:59:30+00:00","dateModified":"2024-12-10T10:11:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/"},"wordCount":2382,"commentCount":0,"publisher":{"@id":"https:\/\/www.eginnovations.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Thumbnail.jpg","keywords":["Java","java application server","Java Monitoring","Jboss","jboss application","jboss application server","jboss jmx","jboss mbeans","jboss metrics","Jboss monitoring","jboss server","jboss servlets","jboss speed","jboss throughput","Jboss tuning","jboss urls","jboss web server","Optimization","performance","redhat jboss","Tuning","what is jboss"],"articleSection":["Application Performance Monitoring (APM)","Java Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/","url":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/","name":"JBoss Performance Tuning & Monitoring | eG Innovations","isPartOf":{"@id":"https:\/\/www.eginnovations.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#primaryimage"},"image":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Thumbnail.jpg","datePublished":"2021-02-05T13:59:30+00:00","dateModified":"2024-12-10T10:11:06+00:00","description":"JBoss performance tuning made easy! Get in-depth insights into JBoss server & application performance. Free trial available.","breadcrumb":{"@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#primaryimage","url":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Thumbnail.jpg","contentUrl":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2021\/02\/JBoss-Tuning-Thumbnail.jpg","width":362,"height":235},{"@type":"BreadcrumbList","@id":"https:\/\/www.eginnovations.com\/blog\/jboss-performance-tuning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.eginnovations.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Tune a JBoss Application Server for High Performance"}]},{"@type":"WebSite","@id":"https:\/\/www.eginnovations.com\/blog\/#website","url":"https:\/\/www.eginnovations.com\/blog\/","name":"eG Innovations","description":"IT Performance Monitoring Insights","publisher":{"@id":"https:\/\/www.eginnovations.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.eginnovations.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.eginnovations.com\/blog\/#organization","name":"eG Innovations","alternateName":"eg innovations","url":"https:\/\/www.eginnovations.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eginnovations.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2014\/07\/eg-logo-dark-gray1_new.jpg","contentUrl":"https:\/\/www.eginnovations.com\/blog\/wp-content\/uploads\/2014\/07\/eg-logo-dark-gray1_new.jpg","width":362,"height":235,"caption":"eG Innovations"},"image":{"@id":"https:\/\/www.eginnovations.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eGInnovations","https:\/\/x.com\/eginnovations"]},{"@type":"Person","@id":"https:\/\/www.eginnovations.com\/blog\/#\/schema\/person\/d788cb81df96a940429c3f5a3b294a6a","name":"Arun Aravamudhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eginnovations.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7ff42334d908fb4060880a4487331e4a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7ff42334d908fb4060880a4487331e4a?s=96&d=mm&r=g","caption":"Arun Aravamudhan"},"sameAs":["https:\/\/www.linkedin.com\/in\/arun-aravamudhan\/","https:\/\/x.com\/https:\/\/x.com\/perfclarity"],"url":"https:\/\/www.eginnovations.com\/blog\/author\/arun-aravamudhan\/"}]}},"modified_by":"Review eG","_links":{"self":[{"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/posts\/13866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/comments?post=13866"}],"version-history":[{"count":0,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/posts\/13866\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/media\/21191"}],"wp:attachment":[{"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/media?parent=13866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/categories?post=13866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eginnovations.com\/blog\/wp-json\/wp\/v2\/tags?post=13866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}