{"id":1536,"date":"2012-04-20T14:58:10","date_gmt":"2012-04-20T19:58:10","guid":{"rendered":"http:\/\/www.kickflop.net\/blog\/?p=1536"},"modified":"2012-04-20T15:26:39","modified_gmt":"2012-04-20T20:26:39","slug":"parasitic-losses","status":"publish","type":"post","link":"https:\/\/www.kickflop.net\/blog\/2012\/04\/20\/parasitic-losses\/","title":{"rendered":"Parasitic Losses"},"content":{"rendered":"<p>Subtitle: &#8220;Derrrr &hellip; alert on stuff.&#8221;<!--more--><\/p>\n<p>For awhile now, we&#8217;ve been in a foggy area with our monitoring and alerting. I&#8217;ve been aware for months that we should be doing more than we currently are. We&#8217;ve been running <a href=\"http:\/\/www.nagios.org\/\">Nagios<\/a> for years and do an okay job with it in basic form. We also have <a href=\"http:\/\/ganglia.info\/\">Ganglia<\/a> metrics being collected for all of our servers, but they are largely ignored until needed for debugging. And finally, I&#8217;ve also just started seriously evaluating Graphite + various collectors as of 2 weeks ago. We do not <em>currently<\/em> perform any alerting based on the data in Ganglia. It is all a slowly moving work in progress.<\/p>\n<p>Today, I just so happened to have a look at Ganglia and noticed 2 servers with elevated status (showing as yellow instead of green). They were both <a href=\"http:\/\/www.openafs.org\/\">OpenAFS<\/a> &#8220;database&#8221; servers (we have 4), and for the sake of not sidetracking this blog post, are largely depended on for providing OpenAFS storage volume location information.<\/p>\n<p>It&#8217;s worth pointing out that there was no noticeable OpenAFS service degradation to the clients of the affected servers.<\/p>\n<p>We&#8217;ll only look at one because they both suffered the same problem. Below, you can see to the left side of the graphs the scene I was presented at the time I noticed the problem. We have completely flat load that is elevated, completely flat low CPU idle time, and a completely flat stream of ~360KB\/sec total network traffic:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-load.png\" alt=\"\" title=\"shiva-load\" width=\"397\" height=\"319\" class=\"aligncenter size-full wp-image-1540\" srcset=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-load.png 397w, https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-load-300x241.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-cpu_idle.png\" alt=\"\" title=\"shiva-cpu_idle\" width=\"397\" height=\"263\" class=\"aligncenter size-full wp-image-1539\" srcset=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-cpu_idle.png 397w, https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-cpu_idle-300x198.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-bytes.png\" alt=\"\" title=\"shiva-bytes\" width=\"397\" height=\"291\" class=\"aligncenter size-full wp-image-1538\" srcset=\"https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-bytes.png 397w, https:\/\/www.kickflop.net\/blog\/wp-content\/uploads\/2012\/04\/shiva-bytes-300x219.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/p>\n<p>Though the graphs above show the last 4 hours, digging further back in time (not shown here) showed that this situation started at around 9AM on April 9th. The flat graph shape seen above at the left of all 3 graphs was found in our data from that day and time all the way to today! Hmmm. What changed around 9AM on April 9th? A little digging through my email and our revision control history showed absolutely nothing, so it was time to dive in with no hints.<\/p>\n<p>I found the OpenAFS Volume Location server process, <code>vlserver<\/code>, eating a steady ~60% of the CPU on each of the 2 servers in question. Additionally, looking into the flat ~360KB\/sec network data with <code>snoop<\/code> showed a solid stream of OpenAFS UDP packets coming from port 7001 on a client node to port 7003 (<code>vlserver<\/code>!) on this server:<\/p>\n<pre>\r\n# OpenAFS client request to vlserver then response back\r\nrogle.ourdomain -> shiva.ourdomain UDP D=7003 S=7001 LEN=56\r\nshiva.ourdomain -> rogle.ourdomain UDP D=7001 S=7003 LEN=40\r\n<\/pre>\n<p>Very rough calculations indicate at least 2500 of these exchanges were happening per second.<\/p>\n<p>Was this legit traffic from some long-running job created by one of the engineers? Looking more closely with <code>snoop -x<\/code> showed that the request and response were identical every time. Something was clearly broken somewhere on host <code>rogle<\/code>.<\/p>\n<p>Once logged into <code>rogle<\/code>, I found 2 <code>bash<\/code> processes with high CPU utilization time.  One is shown below.<\/p>\n<pre>\r\njfivale  19137     1  0 Mar07 ?        03:43:03 bash\r\n<\/pre>\n<p>That&#8217;s not so interesting on its own, but adding in the detail that <code>bash<\/code> for our users is actually <code>\/afs\/rcf.ourdomain\/some\/path\/bin\/bash<\/code> changes things quite a bit.<\/p>\n<p>Brain says:<\/p>\n<blockquote><p>Wait a second. Some number of days ago we had a weird situation where we had to kill off 5-10 <code>bash<\/code> processes on several hosts due to them eating loads of CPU time. They had eaten far more CPU time than these, but this is getting familiar.<\/p><\/blockquote>\n<p>Sure enough, when I attached to the processes with <code>strace -f<\/code>, they showed the same behavior as the broken processes a week or so ago:<\/p>\n<pre>\r\n...\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) ---\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) ---\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) ---\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) ---\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) ---\r\nrt_sigreturn(0x7)                       = 0\r\n--- SIGBUS (Bus error) @ 0 (0) --- \r\n...\r\n<\/pre>\n<p>or alternatively:<\/p>\n<pre>\r\n...\r\n--- SIGSEGV (Segmentation fault) @ 0 (0) ---\r\nrt_sigreturn(0xb)                       = 316804680\r\n--- SIGSEGV (Segmentation fault) @ 0 (0) ---\r\nrt_sigreturn(0xb)                       = 316804680\r\n--- SIGSEGV (Segmentation fault) @ 0 (0) ---\r\nrt_sigreturn(0xb)                       = 316804680\r\n--- SIGSEGV (Segmentation fault) @ 0 (0) ---\r\nrt_sigreturn(0xb)                       = 316804680\r\n--- SIGSEGV (Segmentation fault) @ 0 (0) --- \r\n...\r\n<\/pre>\n<p>Once I had killed off the offending <code>bash<\/code> processes, both of the affected servers returned to the normalcy you see in the right-hand portion of the graphs above.<\/p>\n<p>The question then was: What was going on with the <code>bash<\/code> processes? Unfortunately, I have no answer. The <code>bash<\/code> processes that spiraled out of control all belonged to a small subset of a certain department&#8217;s users and no other problematic instances of the same binary on the same hosts were reported.<\/p>\n<p>Alert on things that are abnormalities in your particular environment. Over 2500 volume location lookups per second is not normal for us. A flat and consistent load on our OpenAFS servers is also not normal. This should have been noticed and fixed within a few hours on April 9th.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Subtitle: &#8220;Derrrr &hellip; alert on stuff.&#8221;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,35,11,48],"tags":[],"class_list":["post-1536","post","type-post","status-publish","format-standard","hentry","category-devops","category-linux","category-sysadmin","category-unixlinux"],"_links":{"self":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/comments?post=1536"}],"version-history":[{"count":18,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1536\/revisions"}],"predecessor-version":[{"id":1552,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1536\/revisions\/1552"}],"wp:attachment":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/media?parent=1536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/categories?post=1536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/tags?post=1536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}