Load 99% of the CPU server crashes

I am running a Server P4 @2400 Mhz, 512Mb Ram, Redhat Linux and Plesk 6



I am having troubles with it.

One of my sites has a big gallery (with some 7000 to 8000 photos) and suddenly it appears to use up to 99% of the CPU (with the httpd) and the server crashes



To alleviate this problem . I put a cron which executes itself each hour



#!/bin/bash

/sbin/service httpd stop

sleep 20

/sbin/service httpd start



This has helped a lot.

Now, if the server crashes, it will be reset in less than an hour



But I am not happy with this business of resetting the server each hour



What I World like is to install a script which would reset the server every time the CPU is loaded over 50% for more than 5 min.

It would reset the httpd only

 

 

 

 

Top