Redhat – Basic Apache httpd server setup becomes slow to serve images requiring frequent restart

apache-2.2httpdhttpd.confperformanceredhat

I have an Apache httpd server running on RHEL 5.3. I'm using this server to serve static content (images) to for a website running on another httpd instance. In the public web directory are several images, and that is all. Some time after startup, the server becomes very slow to serve images to the browser, and can often hang for several minutes whilst trying to serve a 16×16 png.

What is the best way to go about debugging this problem?

I've run top on the box to verify that there is enough free memory, and CPU available. The machine isn't going into swap, and the httpd process only takes up CPU and memory for a couple of seconds when the image is requested through the browser. However the image is only returned often after several minutes.

A restart of the httpd process resolves the issue, and the images load quickly.

This seems like the simplest setup of a web server possible. What could the issue be?

Thanks

UPDATE: httpd.conf settings:

Timeout 10
KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 15
ServerLimit 3

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

Best Answer

A couple questions:

Have you done any tuning to the Apache.conf file? Which Apache MPM are you using?
What parameters are currently set in the Apache.conf file for:

Timeout
KeepAlive
MaxKeepAliveRequests
KeepAliveTimeout
MinSpareServers
MaxSpareServers
StartServers
MaxClients
MaxRequestsPerChild