{"id":160,"date":"2012-01-19T22:12:59","date_gmt":"2012-01-20T06:12:59","guid":{"rendered":"http:\/\/shanelabs.com\/blog\/?p=160"},"modified":"2012-01-19T22:15:52","modified_gmt":"2012-01-20T06:15:52","slug":"determining-current-number-of-clients-in-apache-in-real-time","status":"publish","type":"post","link":"https:\/\/shanelabs.com\/blog\/2012\/01\/19\/determining-current-number-of-clients-in-apache-in-real-time\/","title":{"rendered":"Determining current number of clients in apache in real time"},"content":{"rendered":"<p>A server I was recently working on kept crashing because it was getting too many connections. This is normally a sign of popularity, but when it prevents people from being able to access your product that&#8217;s not a good thing. The first step in handling an issue like this is monitoring it in real-time so that you can see what causes it and know when it&#8217;s time to restart apache. The default setting is 256, so when you&#8217;re getting close to that number, be aware.<\/p>\n<p>Use this command at the terminal to get the current number of open connections:<\/p>\n<blockquote><p>pgrep httpd | wc -l<\/p><\/blockquote>\n<p>And if you want to monitor it in real time, watch it:<\/p>\n<blockquote><p>watch &#8220;pgrep httpd | wc -l&#8221;<\/p><\/blockquote>\n<p>Note that the best approach is to configure apache to provide server-status so that you can pull up all connections in a browser window, but that requires editing httpd.conf and restarting, and should be the topic of a whole other post.<\/p>\n<p>Hope that helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A server I was recently working on kept crashing because it was getting too many connections. This is normally a sign of popularity, but when it prevents people from being able to access your product that&#8217;s not a good thing. The first step in handling an issue like this is monitoring it in real-time so [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":5,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}