{"id":3187,"date":"2013-07-17T09:21:01","date_gmt":"2013-07-17T14:21:01","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=3187"},"modified":"2013-07-17T09:21:01","modified_gmt":"2013-07-17T14:21:01","slug":"which-threads-are-talking-to-the-database","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2013\/07\/17\/which-threads-are-talking-to-the-database\/","title":{"rendered":"Which threads are talking to the database?"},"content":{"rendered":"<p>Often while troubleshooting, I will want to know where the bottleneck is.  If I think the database may be the culprit, I will run the following to print those threads that are making database calls&#8230;<\/p>\n<pre lang=\"text\">\r\n-bash-4.1$ jstack 20711 | awk '{if ($1 ~ \"^\\\"\") {l=1;thread=$1} else if (l == 1 && $0 != \"\" && $0 ~ \"oracle\") {l=0;print thread} else if ($0 == \"\") {l=0}}'\r\n\"http-172.28.8.80-10180-29\"\r\n\"http-172.28.8.80-10180-24\"\r\n\"http-172.28.8.80-10543-7\"\r\n\"http-172.28.8.80-10180-14\"\r\n\"http-172.28.8.80-10180-4\"\r\n-bash-4.1$\r\n<\/pre>\n<p>All this does is print each thread that has &#8220;oracle&#8221; in at least one call on the stack.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often while troubleshooting, I will want to know where the bottleneck is. If I think the database may be the culprit, I will run the following to print those threads that are making database calls&#8230; -bash-4.1$ jstack 20711 | awk&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2013\/07\/17\/which-threads-are-talking-to-the-database\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[24,25,28,27],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3187"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3187"}],"version-history":[{"count":4,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3187\/revisions"}],"predecessor-version":[{"id":3191,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3187\/revisions\/3191"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3187"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}