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'm optimising a website, and the problem I'm facing with now is server related. During page load, there are about 40-50 requests sent to server (depending on the page), and in every case, server hangs for about 5-6 seconds on a certain file (images mostly, cause css and js is getting merged), or two or three.. take a look at firebug screenshot to get a better idea what I'm talking about

http://i.stack.imgur.com/aDhih.png

(there are 90 requests here cause js and css are not merged).
website is Bigelow Chemists . Any idea what might be causing this. I can take a deeper look, I just need a hint at what might be the cause for such behaviour. Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It seems your web server is not configured to handle that number of requests.

  • Enable Keep Alive

    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
    
    #
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 200
    
  • Adjust you server parameters to have a sufficient number of processes to handle concurrent requests

    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       5
        MaxSpareServers      50
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          5
        MaxClients          150
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadsPerChild      25
        MaxRequestsPerChild   0    
    </IfModule>
    
share|improve this answer
    
As I understand, these two MPM modules should not be used in the same time. I should be using only one, right? Which one do you recommend? We have xlarge amazon server. Thx –  Netismine Oct 8 '12 at 14:33
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.