{"id":29794,"date":"2023-12-18T08:15:00","date_gmt":"2023-12-18T07:15:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=29794"},"modified":"2023-12-18T08:15:00","modified_gmt":"2023-12-18T07:15:00","slug":"howto-detect-and-analyze-long-stuck-threads-in-tomcat","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/","title":{"rendered":"HowTo &#8211; Detect and analyze long\/stuck threads in Tomcat"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Most Application Servers allow for long and\/or stuck threads detection, to let you know that something is currently very slow, waiting on something or just simply stuck. On tomcat, this isn&#8217;t enabled by default, and you need to manually configure it as needed. But once done, it will start displaying information into the logs that can be used to find some patterns, some issues on your environments\/application. In this blog, I will use a Documentum D2 application hosted on Tomcat. As you probably know, Documentum and D2 are quite the complex software, an out-of-the-box WAR file of D2 will be around 1.1Gb once exploded, so you can imagine there quite a bit of things happening inside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First of all, the configuration of Tomcat. To be able to display information on the long running threads, you will need to add the corresponding Tomcat Valve into the &#8220;<em>server.xml<\/em>&#8221; file. As far as I know, the configuration for this didn&#8217;t change recently and it&#8217;s pretty well <a href=\"https:\/\/tomcat.apache.org\/tomcat-10.0-doc\/config\/valve.html#Stuck_Thread_Detection_Valve\" target=\"_blank\" rel=\"noreferrer noopener\">documented<\/a> as everything else with Apache. There are two optional parameters for this valve:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>threshold<\/em>: Duration in seconds after which a thread will be considered &#8220;stuck&#8221; and will be tracked in the logs, default to 600s (10min)<\/li>\n\n\n\n<li><em>interruptThreadThreshold<\/em>: Duration in seconds after which Tomcat will try to stop the thread, default to -1 (disabled)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, to enable it, you simply need to add the valve as done below and then restart Tomcat:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [3,14,15,21,38]; title: ; notranslate\" title=\"\">\n&#x5B;tomcat@d2-0 ~]$ cd $CATALINA_HOME\/conf\/\n&#x5B;tomcat@d2-0 conf]$\n&#x5B;tomcat@d2-0 conf]$ cat server.xml\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n...\n&lt;Server port=&quot;8005&quot; shutdown=&quot;b018b3d58bdbb490a1b2baed3c2efaee&quot;&gt;\n  ...\n  &lt;Service name=&quot;Catalina&quot;&gt;\n    ...\n    &lt;Engine name=&quot;Catalina&quot; defaultHost=&quot;localhost&quot;&gt;\n      ...\n      &lt;Host name=&quot;localhost&quot;  appBase=&quot;webapps&quot; unpackWARs=&quot;true&quot; autoDeploy=&quot;true&quot;&gt;\n        ...\n        &lt;Valve className=&quot;org.apache.catalina.valves.StuckThreadDetectionValve&quot;\n               threshold=&quot;120&quot; \/&gt;\n      &lt;\/Host&gt;\n    &lt;\/Engine&gt;\n  &lt;\/Service&gt;\n&lt;\/Server&gt;\n&#x5B;tomcat@d2-0 conf]$\n&#x5B;tomcat@d2-0 conf]$ stopTomcat\n  **\n  **  Apache Tomcat is running with PID: 4210\n  **\nUsing CATALINA_BASE:   $CATALINA_HOME\nUsing CATALINA_HOME:   $CATALINA_HOME\nUsing CATALINA_TMPDIR: $DATA_HOME\/temp\nUsing JRE_HOME:        $JAVA_HOME\nUsing CLASSPATH:       $CATALINA_HOME\/bin\/bootstrap.jar:$CATALINA_HOME\/bin\/tomcat-juli.jar\nUsing CATALINA_OPTS:\nUsing CATALINA_PID:    $DATA_HOME\/tomcat.pid\nNOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base\/java.lang=ALL-UNNAMED --add-opens=java.base\/java.io=ALL-UNNAMED --add-opens=java.base\/java.util=ALL-UNNAMED --add-opens=java.base\/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi\/sun.rmi.transport=ALL-UNNAMED\nTomcat stopped.\n  **\n  **  Apache Tomcat is shutdown\n  **\n&#x5B;tomcat@d2-0 conf]$\n&#x5B;tomcat@d2-0 conf]$ startTomcat\n  **\n  **  Apache Tomcat is shutdown\n  **\nCleanup of app_data for &quot;D2&quot;\n\nUsing CATALINA_BASE:   $CATALINA_HOME\nUsing CATALINA_HOME:   $CATALINA_HOME\nUsing CATALINA_TMPDIR: $DATA_HOME\/temp\nUsing JRE_HOME:        $JAVA_HOME\nUsing CLASSPATH:       $CATALINA_HOME\/bin\/bootstrap.jar:$CATALINA_HOME\/bin\/tomcat-juli.jar\nUsing CATALINA_OPTS:\nUsing CATALINA_PID:    $DATA_HOME\/tomcat.pid\nTomcat started.\n  **\n  **  Apache Tomcat is running with PID: 8426\n  **\n&#x5B;tomcat@d2-0 conf]$\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Now that messages are being printed on the logs, it&#8217;s a first step but it might take some time to analyze these. For that purpose, you can write a parser to find all messages and extract the needed information. Of course, such tool would be sensitive to the log format (length of date\/timestamp, number of fields you integrated in the logs, etc.). Here is an example of a thread being detected as stuck (&#8220;<em>threshold<\/em>&#8221; of 120s) and its successful completion:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n&#x5B;tomcat@d2-0 conf]$ cd $CATALINA_HOME\/logs\/\n&#x5B;tomcat@d2-0 logs]$\n&#x5B;tomcat@d2-0 logs]$ grep notifyStuckThread catalina.out\n...\n2023-12-13 10:03:21,079 UTC WARNING &#x5B;Catalina-utility-2] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread &#x5B;https-jsse-nio-8080-exec-417] (id=&#x5B;27927]) has been active for &#x5B;122,196] milliseconds (since &#x5B;12\/13\/23 10:01 AM]) to serve the same request for &#x5B;https:\/\/dctm-env1.domain.com\/D2\/x3_portal\/searchManagerService] and may be stuck (configured threshold for this StuckThreadDetectionValve is &#x5B;120] seconds). There is\/are &#x5B;2] thread(s) in total that are monitored by this Valve and may be stuck.\n...\n2023-12-13 10:03:31,090 UTC WARNING &#x5B;Catalina-utility-1] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted Thread &#x5B;https-jsse-nio-8080-exec-417] (id=&#x5B;27927]) was previously reported to be stuck but has completed. It was active for approximately &#x5B;127,144] milliseconds. There is\/are still &#x5B;1] thread(s) that are monitored by this Valve and may be stuck.\n...\n&#x5B;tomcat@d2-0 logs]$\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">On the above example, the thread started around <em>10:01:19<\/em>, was detected as stuck <em>122s<\/em> later (<em>10:03:21<\/em>) and completed after <em>127s<\/em> (<em>10:03:26<\/em>). It was related to a search request in D2 and at the time of the detection, there was already another thread stuck (2 threads stuck in the &#8220;<em>notifyStuckThreadDetected<\/em>&#8220;). When it completed, there was still another thread stuck (1 thread stuck in the &#8220;<em>notifyStuckThreadCompleted<\/em>&#8220;). That&#8217;s the kind of information you can get from the Tomcat logs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is an example of parser that will work with this logging format, it&#8217;s using &#8220;<em>awk<\/em>&#8221; to read all the lines, find the &#8220;<em>notifyStuckThreadDetected<\/em>&#8221; occurrences, find the associated &#8220;<em>notifyStuckThreadCompleted<\/em>&#8221; occurrences and then display all the needed information in a summary table. In case the thread is still running (didn&#8217;t complete yet), it will also mark it as such:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;tomcat@d2-0 logs]$ cd\n&#x5B;tomcat@d2-0 ~]$\n&#x5B;tomcat@d2-0 ~]$ cat parse_stuck.awk\nBEGIN {\n  print &quot;============================================&quot;;\n  print &quot;========== COMPLETED LONG THREADS ==========&quot;;\n  print &quot;============================================&quot;;\n  printf(&quot;%-25s\\t%20s\\t%12s\\t%10s\\t%12s\\t%3s\\t%-s\\n&quot;,&quot;THREAD&quot;,&quot;STIME&quot;,&quot;DTIME&quot;,&quot;DURATION&quot;,&quot;CTIME&quot;,&quot;NUM&quot;,&quot;REQUEST&quot;);\n}\n\n\/.\/ {\n  sub(&quot;UTC&quot;,&quot;&quot;);\n}\n\n\/org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected\/ {\n  thread=substr($7,2,length($7)-2);\n  dtime&#x5B;thread]=$2;\n  tmp=substr($0,index($0,&quot;since&quot;)+6);\n  stime&#x5B;thread]=substr(tmp,1,index(tmp,&quot;)&quot;)-1);\n  tmp=substr($0,index($0,&quot;active for &quot;)+11);\n  duration&#x5B;thread]=substr(tmp,1,index(tmp,&quot; &quot;)-1);\n  tmp=substr($0,index($0,&quot;request for &quot;)+12);\n  request&#x5B;thread]=substr(tmp,1,index(tmp,&quot; &quot;)-1);\n  tmp=substr($0,index($0,&quot;is\/are &quot;)+7);\n  count_stuck&#x5B;thread]=substr(tmp,1,index(tmp,&quot; &quot;)-1);\n  ended&#x5B;thread]=0;\n}\n\n\/org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted\/ {\n  thread=substr($7,2,length($7)-2);\n  tmp=substr($0,index($0,&quot;approximately &quot;)+14);\n  duration&#x5B;thread]=substr(tmp,1,index(tmp,&quot; &quot;)-1);\n  ctime&#x5B;thread]=$2;\n  ended&#x5B;thread]=1;\n  tmp=substr($0,index($0,&quot;is\/are still &#x5B;&quot;)+14);\n  nb_stuck&#x5B;thread]=substr(tmp,1,index(tmp,&quot;]&quot;)-1);\n\n  printf(&quot;%-25s\\t%20s\\t%s\\t%10s\\t%s\\t%3d\\t%-s\\n&quot;,thread,stime&#x5B;thread],dtime&#x5B;thread],duration&#x5B;thread],ctime&#x5B;thread],nb_stuck&#x5B;thread],request&#x5B;thread]);\n\n  dtime&#x5B;thread]=&quot;&quot;;\n  ctime&#x5B;thread]=&quot;&quot;;\n  stime&#x5B;thread]==&quot;&quot;;\n  duration&#x5B;thread]==&quot;&quot;;\n  request&#x5B;thread]==&quot;&quot;;\n  count_stuck&#x5B;thread]==&quot;&quot;;\n  nb_stuck&#x5B;thread]==&quot;&quot;;\n  ended&#x5B;thread]==&quot;&quot;;\n}\n\nEND {\n  print &quot;&quot;;\n  print &quot;============================================&quot;;\n  print &quot;======= CURRENTLY STUCK LONG THREADS =======&quot;;\n  print &quot;============================================&quot;;\n  printf(&quot;%-25s\\t%20s\\t%12s\\t%10s\\t%-s\\n&quot;,&quot;THREAD&quot;,&quot;STIME&quot;,&quot;DTIME&quot;,&quot;DURATION&quot;,&quot;REQUEST&quot;);\n  for ( i in ended ) {\n    if (ended&#x5B;i]==0) {\n      printf(&quot;%-25s\\t%20s\\t%s\\t%10s\\t%-s\\n&quot;,i,stime&#x5B;i],dtime&#x5B;i],duration&#x5B;i],request&#x5B;i]);\n    }\n  }\n}\n&#x5B;tomcat@d2-0 ~]$\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The execution of this small parser is quite simple, here are two examples:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;tomcat@d2-0 ~]$ cat $CATALINA_HOME\/logs\/catalina.out | awk -f parse_stuck.awk\n============================================\n========== COMPLETED LONG THREADS ==========\n============================================\nTHREAD                                         STIME           DTIME      DURATION             CTIME    NUM     REQUEST\nhttps-jsse-nio-8080-exec-420     &#x5B;12\/14\/23, 4:53 AM]    04:55:44,045     &#x5B;228,883]      04:57:24,983      0     &#x5B;https:\/\/dctm-env1.domain.com\/D2\/servlet\/ExportContent?uid=...]\nhttps-jsse-nio-8080-exec-463     &#x5B;12\/14\/23, 5:03 AM]    05:05:36,427     &#x5B;240,259]      05:07:31,980      0     &#x5B;https:\/\/dctm-env1.domain.com\/D2\/x3_portal\/searchManagerService]\nhttps-jsse-nio-8080-exec-502     &#x5B;12\/14\/23, 5:34 AM]    05:36:34,645     &#x5B;185,688]      05:37:38,489      0     &#x5B;https:\/\/dctm-env1.domain.com\/D2\/servlet\/ExportContent?uid=...]\nhttps-jsse-nio-8080-exec-355     &#x5B;12\/14\/23, 7:41 AM]    07:43:48,877     &#x5B;165,236]      07:44:38,900      0     &#x5B;https:\/\/dctm-env1.domain.com\/D2\/x3_portal\/doclistService]\n\n============================================\n======= CURRENTLY STUCK LONG THREADS =======\n============================================\nTHREAD                                         STIME           DTIME      DURATION      REQUEST\nhttps-jsse-nio-8080-exec-355    &#x5B;12\/14\/23, 11:49 AM]    11:51:22,124     &#x5B;121,961]      &#x5B;https:\/\/dctm-env1.domain.com\/D2\/x3_portal\/doclistService]\n&#x5B;tomcat@d2-0 ~]$\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;tomcat@d2-0 ~]$ cat $CATALINA_HOME\/logs\/catalina.out | awk -f parse_stuck.awk\n============================================\n========== COMPLETED LONG THREADS ==========\n============================================\nTHREAD                                         STIME           DTIME      DURATION             CTIME    NUM     REQUEST\nhttps-jsse-nio-8080-exec-33       &#x5B;12\/6\/23, 2:37 PM]    14:39:47,521     &#x5B;280,031]      14:42:27,965      0     &#x5B;https:\/\/dctm-env2.domain.com\/D2\/x3_portal\/checkoutDocumentService]\nhttps-jsse-nio-8080-exec-21       &#x5B;12\/6\/23, 4:36 PM]    16:38:45,420     &#x5B;268,730]      16:41:15,626      0     &#x5B;https:\/\/dctm-env2.domain.com\/D2\/x3_portal\/searchManagerService]\nhttps-jsse-nio-8080-exec-29      &#x5B;12\/12\/23, 9:26 PM]    21:28:57,339     &#x5B;154,656]      21:29:27,356      1     &#x5B;https:\/\/dctm-env2.domain.com\/D2\/x3_portal\/propertiesService]\nhttps-jsse-nio-8080-exec-33      &#x5B;12\/12\/23, 9:26 PM]    21:28:47,332     &#x5B;168,044]      21:29:27,357      0     &#x5B;https:\/\/dctm-env2.domain.com\/D2\/x3_portal\/propertiesService]\n\n============================================\n======= CURRENTLY STUCK LONG THREADS =======\n============================================\nTHREAD                                         STIME           DTIME      DURATION      REQUEST\n&#x5B;tomcat@d2-0 ~]$\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The different columns are the following ones:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>THREAD: Name of the thread, can be used to find the start\/end of the request<\/li>\n\n\n\n<li>STIME: Start date\/time of the thread<\/li>\n\n\n\n<li>DTIME: Detection time of the thread (~120s after STIME)<\/li>\n\n\n\n<li>DURATION: Total duration of the thread<\/li>\n\n\n\n<li>CTIME: Completion time of the thread (~DURATIONs after STIME)<\/li>\n\n\n\n<li>NUM: Number of threads still stuck<\/li>\n\n\n\n<li>REQUEST: URL used that triggered the thread<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That concludes this blog, hopefully you find this information useful to debug\/improve your applications. Don&#8217;t hesitate to change the threshold of 120 seconds in the Tomcat configuration to something relevant for your use-case.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most Application Servers allow for long and\/or stuck threads detection, to let you know that something is currently very slow, waiting on something or just simply stuck. On tomcat, this isn&#8217;t enabled by default, and you need to manually configure it as needed. But once done, it will start displaying information into the logs that&hellip;&nbsp;<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4135,4179],"tags":[839,551,552,771],"class_list":["post-29794","post","type-post","status-publish","format-standard","category-digitalization","category-documentum","tag-apache","tag-stuck","tag-thread","tag-tomcat"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>HowTo - Detect and analyze long\/stuck threads in Tomcat - dbi services Blog<\/title>\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.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HowTo - Detect and analyze long\/stuck threads in Tomcat\" \/>\n<meta property=\"og:description\" content=\"Most Application Servers allow for long and\/or stuck threads detection, to let you know that something is currently very slow, waiting on something or just simply stuck. On tomcat, this isn&#8217;t enabled by default, and you need to manually configure it as needed. But once done, it will start displaying information into the logs that&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-18T07:15:00+00:00\" \/>\n<meta name=\"author\" content=\"Morgan Patou\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MorganPatou\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Morgan Patou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/\"},\"author\":{\"name\":\"Morgan Patou\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/80b23b8d61648c45dd30be73b6b6979d\"},\"headline\":\"HowTo &#8211; Detect and analyze long\\\/stuck threads in Tomcat\",\"datePublished\":\"2023-12-18T07:15:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/\"},\"wordCount\":579,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"keywords\":[\"Apache\",\"Stuck\",\"Thread\",\"Tomcat\"],\"articleSection\":[\"Digitalization\",\"Documentum\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/\",\"name\":\"HowTo - Detect and analyze long\\\/stuck threads in Tomcat - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2023-12-18T07:15:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HowTo &#8211; Detect and analyze long\\\/stuck threads in Tomcat\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/80b23b8d61648c45dd30be73b6b6979d\",\"name\":\"Morgan Patou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/MOP_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/MOP_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/MOP_web-min-scaled.jpg\",\"caption\":\"Morgan Patou\"},\"description\":\"Morgan Patou has over 15 years of experience building and deploying Java\\\/J2EE applications. He specializes in Enterprise Content Management (ECM) solutions such as Alfresco and Documentum, covering open-source (Apache, OpenLDAP, Kerberos) and proprietary (WebLogic) technologies, with deep expertise in business requirement analysis, ECM architecture, and high-availability infrastructure for mission-critical environments. He oversees knowledge management and technology direction for the ECM practice. He holds Alfresco Content Services Certified Administrator (ACSCA) and Certified Engineer (ACSCE) credentials, plus an Engineering degree in Computer Science from ENSISA Mulhouse. His industry experience covers the public sector, IT, financial services\\\/banking, and pharmaceutical industries.\",\"sameAs\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/morgan-patou\\\/\",\"https:\\\/\\\/x.com\\\/MorganPatou\"],\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/morgan-patou\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"HowTo - Detect and analyze long\/stuck threads in Tomcat - dbi services Blog","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.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/","og_locale":"en_US","og_type":"article","og_title":"HowTo - Detect and analyze long\/stuck threads in Tomcat","og_description":"Most Application Servers allow for long and\/or stuck threads detection, to let you know that something is currently very slow, waiting on something or just simply stuck. On tomcat, this isn&#8217;t enabled by default, and you need to manually configure it as needed. But once done, it will start displaying information into the logs that&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2023-12-18T07:15:00+00:00","author":"Morgan Patou","twitter_card":"summary_large_image","twitter_creator":"@MorganPatou","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Morgan Patou","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/"},"author":{"name":"Morgan Patou","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/80b23b8d61648c45dd30be73b6b6979d"},"headline":"HowTo &#8211; Detect and analyze long\/stuck threads in Tomcat","datePublished":"2023-12-18T07:15:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/"},"wordCount":579,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"keywords":["Apache","Stuck","Thread","Tomcat"],"articleSection":["Digitalization","Documentum"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/","url":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/","name":"HowTo - Detect and analyze long\/stuck threads in Tomcat - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-12-18T07:15:00+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/howto-detect-and-analyze-long-stuck-threads-in-tomcat\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"HowTo &#8211; Detect and analyze long\/stuck threads in Tomcat"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/80b23b8d61648c45dd30be73b6b6979d","name":"Morgan Patou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/MOP_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/MOP_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/MOP_web-min-scaled.jpg","caption":"Morgan Patou"},"description":"Morgan Patou has over 15 years of experience building and deploying Java\/J2EE applications. He specializes in Enterprise Content Management (ECM) solutions such as Alfresco and Documentum, covering open-source (Apache, OpenLDAP, Kerberos) and proprietary (WebLogic) technologies, with deep expertise in business requirement analysis, ECM architecture, and high-availability infrastructure for mission-critical environments. He oversees knowledge management and technology direction for the ECM practice. He holds Alfresco Content Services Certified Administrator (ACSCA) and Certified Engineer (ACSCE) credentials, plus an Engineering degree in Computer Science from ENSISA Mulhouse. His industry experience covers the public sector, IT, financial services\/banking, and pharmaceutical industries.","sameAs":["https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/","https:\/\/x.com\/MorganPatou"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/29794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=29794"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/29794\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=29794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=29794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=29794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}