Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a web server with apache 2.0 installed. Sometimes, probably when load increase, it serves a blank page with 503 service unavailable.

Server load is not too high, is there a solution in apache configuration to solve this problem?

Thank you

share|improve this question
    
Does your apache serve as a proxy to another server such as tomcat? –  David Rabinowitz May 28 '09 at 11:32
    
No, it doesn't. –  Alessandro Astarita May 30 '09 at 11:12
add comment

4 Answers

You could try changing to a different MPM, which you can do in the configuration, or tweaking the parameters of your MPM. For example, if you're using the prefork or worker MPMs then you can increase the MaxClients value. In the latter case, ThreadsPerChild might also be a useful configuration value to tweak.

You can find information on the MPMs in the standard Apache documentation.

However, unless you're running a really busy website, I'm surprised you're seeing 503 errors at all - is it possible that there's some really slow server-side code that's tying up Apache requests for far too long? If so, you might get more mileage improving that than just trying to work around it in Apache.

share|improve this answer
    
I'm using prefork MPM. Here is an extract of my httpd.conf: KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 StartServers 20 MinSpareServers 25 MaxSpareServers 50 MaxClients 256 MaxRequestsPerChild 50 The problem appears on a simple pure html based page. –  Alessandro Astarita May 28 '09 at 10:12
add comment

Check your error log, which by default will be in

/var/log/httpd/error_log

If it mentions that you are our of worker processes then that could be your problem.

share|improve this answer
    
In the error_log there is nothing relevant. –  Alessandro Astarita May 28 '09 at 11:33
add comment

You can try setting up mod_status to get some insight into your server

Listen 127.127.127.127:10127

ExtendedStatus On

<VirtualHost 127.127.127.127:10127>
    ServerName 127.127.127.127:10127

    #
    # Allow server status reports generated by mod_status
    #
    <Location /server-status>
        SetHandler server-status
    </Location>

</VirtualHost>

The status vhost is bound to the localhost on your server. You can access it with a text mode browser like elinks, or ssh forward that port to your machine.

share|improve this answer
add comment

For me the answer was a bit different. Seems that someone wanted to limit the use of the 'Downloads' folder. And later forgot that it shouldn't be used for images.

So, when a page with 16 images on it, all from the Downloads folder, tried to load, the error log shows LOTS of 503 errors.

Upping the limit here on MaxConnPerIP (I set to 20) or removing altogether fixed my problem.

<IfModule mod_limitipconn.c>
    <Location /Downloads>
        # This section affects all files under http://domain.com/Downloads
        MaxConnPerIP 2
    </Location>
</IfModule>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.