{"id":2737,"date":"2012-06-12T10:39:22","date_gmt":"2012-06-12T10:39:22","guid":{"rendered":"http:\/\/www.theperfectarts.com\/?p=2737"},"modified":"2014-11-21T06:56:11","modified_gmt":"2014-11-21T06:56:11","slug":"script-to-kill-httpd-processes","status":"publish","type":"post","link":"https:\/\/www.ktchost.com\/blog\/script-to-kill-httpd-processes\/","title":{"rendered":"Script to kill httpd processes"},"content":{"rendered":"<p>While server having heavy load and we want to stop or kill the httpd service on the server to reduce the server but its not stopping at that time, refer to the following script to kill the httpd process and its always better to save the script on the server, so that you can execute any time when you want to kill the httpd processes.<\/p>\n<blockquote><p><strong>#!\/bin\/bash<\/strong><br \/>\n<strong> for pid in `ps -C httpd|sed -e &#8216;s\/^\\ \\+\/\/g&#8217; | grep httpd|awk &#8216;{print $1}&#8217;`<\/strong><br \/>\n<strong> do<\/strong><br \/>\n<strong> kill $pid<\/strong><br \/>\n<strong> done<\/strong><\/p><\/blockquote>\n<p>Make sure that you have assigned the execution permission to the script, so it won&#8217;t cause the permission error.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>While server having heavy load and we want to stop or kill the httpd service on the server to reduce the server but its not <a class=\"mh-excerpt-more\" href=\"https:\/\/www.ktchost.com\/blog\/script-to-kill-httpd-processes\/\" title=\"Script to kill httpd processes\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2737","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2737"}],"collection":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/comments?post=2737"}],"version-history":[{"count":4,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2737\/revisions"}],"predecessor-version":[{"id":3789,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2737\/revisions\/3789"}],"wp:attachment":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media?parent=2737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/categories?post=2737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/tags?post=2737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}