M mukamo New member Joined Nov 22, 2005 Messages 4 Jan 13, 2007 #1 hi all is there a script that runs every minute or so which checks the server load and when it reaches a certain number say 4.0, it executes service httpd restart thanks in advance
hi all is there a script that runs every minute or so which checks the server load and when it reaches a certain number say 4.0, it executes service httpd restart thanks in advance
chatwizrd Verified User Joined Jul 3, 2005 Messages 1,915 Jan 13, 2007 #2 There would be a reason if your server reached a load like that. Just restarting the webserver is not gonna change anything. You are just killing the established connections. Once they all reconnect the load will be the same.
There would be a reason if your server reached a load like that. Just restarting the webserver is not gonna change anything. You are just killing the established connections. Once they all reconnect the load will be the same.
M mukamo New member Joined Nov 22, 2005 Messages 4 Jan 13, 2007 #3 but the server load just shoots up only once in awhile and an apache restart always fixes it
K kke Verified User Joined Apr 4, 2006 Messages 198 Location Thailand Jan 14, 2007 #4 #!/bin/sh ld=`uptime | awk -F, '{print $5}' | awk -F. '{print $1}'`; limit=5; if [ $ld -gt $limit ]; then `service httpd restart`; fi Then put it in crontab */5 * * * * root path_to_script
#!/bin/sh ld=`uptime | awk -F, '{print $5}' | awk -F. '{print $1}'`; limit=5; if [ $ld -gt $limit ]; then `service httpd restart`; fi Then put it in crontab */5 * * * * root path_to_script