The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem increasing apache max connections

Discussion in 'Workarounds and Optimization' started by musioc, Oct 17, 2012.

  1. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    my server goes down when apache connections rise about 250.
    I set Server Limit and Max Clients in whm (Global Configuration)
    Server Limit = 2000
    Max Clients = 2000


    also I set this in pre_virtualhost_global.conf (Include Editor)
    ServerLimit 2000
    MaxClients 2000


    I think it should be ok now because I see about 2000 DOTs id apache status page:
    Server uptime: 5 hours 55 minutes 38 seconds
    Total accesses: 842023 - Total Traffic: 24.9 GB
    CPU Usage: u9.23 s10.38 cu311.1 cs0 - 1.55% CPU load
    39.5 requests/sec - 1.2 MB/second - 31.1 kB/request
    116 requests currently being processed, 52 idle workers

    _KWWR__K_W_KWK__KW_WWKRC.W___CW_KKWWWK.KKKWRWKR.._RRKK_W__R_W_KK
    _W.K_KCK.R.RWKK_.KKWKRW_WW_KRWWRK_RK_WWCK_WR_KKKRKW__W__._K._W__
    _KW__.K_WKKKRKK__WK.CR_RRWKK__W_K__WRK_KK.KW....RK...._...R._...
    ...............W..............................................._
    ......W................................_........................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................


    but problem persist yet and apache goes down by 256 connections

    Can anybody help me please?
     
  2. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I recompiled apache with mpm_worker
    and then
    Server Limit = 1500
    Max Clients = 1500

    now I can see 96,000 dot in apache status page!



    please see this:
    Server uptime: 3 minutes 50 seconds
    Total accesses: 5839 - Total Traffic: 59.2 MB
    CPU Usage: u4.47 s3.98 cu52.44 cs0 - 26.5% CPU load
    25.4 requests/sec - 263.6 kB/second - 10.4 kB/request
    77 requests currently being processed, 173 idle workers

    77 + 173 = 250
    I think I should increase number of workers, but how?
     
    #2 musioc, Oct 17, 2012
    Last edited: Oct 17, 2012
  3. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Anybody please?
    Do you always have less than 250 connection to apache???
    Can anyone describe how to increase apache connection limit?

    Thank you
     
  4. Skamasle

    Skamasle Member

    Joined:
    Mar 18, 2012
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Try turn On keep alive and reduce keepalivetimeout to 2 or 3 seconds, if have a lot of static content like images try use nginx plugin from nginxcp.com
     
  5. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello Skamasle
    keepalive is on (timeout = 5)
    most of contents are dynamic

    - - - Updated - - -

    I want to know is there any way to increase apache max clients?
     
  6. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I can see this line in apache error_log
    Can anyone help please?

    - - - Updated - - -

    I'm using WHM 11.32.5 (build 11)
    CLOUDLINUX 6.3 x86_64 standard
     
  7. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    It seams there is no way to use apache 2.x for more than 256 concurrent clients!
    So there is noway other than using lightspeed or nginx :eek:
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    For MPM Worker, you should not have MaxClients and ServerLimit the same:

    worker - Apache HTTP Server

    What do you have set for ThreadsPerChild? It would be MaxClients divided by ThreadsPerChild to determine ServerLimit. You've set ServerLimit into a range far excessive to that.
     
  9. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello,
    I was removed MPM Worker 3 days ago, No I only use MPM_Prefork
    Can you help me now to increase MaxClients?
     
  10. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello cPanelTristan
    I want to make apache possible to serve at least 1500 clients simultaneously.
    If I install worker again, Can you write an example for my problem?

    ServerLimit ?
    StartServers ?
    MaxClients 1500
    MinSpareThreads ?
    MaxSpareThreads ?
    ThreadsPerChild ?
    .
    .
    .



    Thank you
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    How much memory do you have on this machine? You'll need over 4GB of RAM to serve over 1000 simultaneous connections with Apache depending on the PHP handler being used.

    Frankly, yes, you need to switch to nginx or litespeed if you want this many simultaneous connections and don't have a large amount of server memory. Apache can't handle it without huge amounts of memory.
     
  12. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    I have to use apache for more compatibility...
    Server has 16GB DDR3 Ram
    I remember I used apache with more than 700 connections last year! (another server with apache 1.x I think)

    Thank you
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Could you open up a ticket for us to see what is happening then? If your server has this much memory, it should be able to use a sufficiently high number of connections depending on the configuration. We'd have to see your setup on it.

    A ticket can be submitted in WHM > Support Center > Contact cPanel or using the link in my signature. Please indicate which PHP handler and Apache MPM module you wish to have as well as the connection limit in the ticket.

    Thanks!
     
  14. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    Server Load is always under 1 even when apache crashes

    this is my configuration:
    after this, some sites get error 500, apache log:



    and this is configuration part of phpinfo:
     
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    As mentioned, please submit a ticket so we can check why it isn't working to add properly with the memory available.
     
  16. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    Thank you very much
    Problem solved, I can see over 1500 connections now!
    Sometimes it is comfortable when we see high load (1.4) ;)
     
  17. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please either post the ticket number or state how this was resolved for others. Thanks!
     
  18. musioc

    musioc Well-Known Member

    Joined:
    Aug 4, 2011
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Sure!

    My mistake was that I surfed apache status for number of connections and when I saw anything like this, I thought there is a problem:

    Then I used this command instead of apache status:
    and I see number of connections (1500, 1700, 2000, ...)
    but my maxclients was 900! so apache goes down with my settings, I increased maxclients to 3500 and problem solved.


    This post is my opinion and my experience, It resolved my problem while it maybe incorrect
     
Loading...

Share This Page