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.

Continuous Apache Issues

Discussion in 'Workarounds and Optimization' started by blink8908, Feb 19, 2011.

  1. blink8908

    blink8908 Member

    Joined:
    Feb 9, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I've been having Apache issues for months now. The primary issue is: the server works fine for hours, and then all of a sudden the requests jump up to over 1,000 and Apache ends up crashing and has to be restarted. This happens all the time, and I keep trying various configurations but none seem to work. I am posting here because everything pertaining to Apache configuration on Google seems to differ in what should be set as what.

    Also, I seem to have users on my site that have no connection issues to the site, while others have trouble connecting to the website all the time.

    Here is my server information:

    WHM 11.28.83
    REDHAT Enterprise 5.2 x86_64 standard on host
    16 GB of RAM
    8 processors of Intel(R) Xeon(R) CPU E5405 @ 2.00GHz


    Here is my current Apache config:
    MaxClients 1400
    ServerLimit 1400
    StartServers 16
    MinSpareServers 16
    MaxSpareServers 64
    MaxRequestsPerChild 800
    KeepAlive On
    KeepAliveTimeout 2
    MaxKeepAliveRequests 500
    TimeOut 20

    If anyone has any advice, I would greatly appreciate it. This has been something that has been stumping me for months. Thank you for reading.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In WHM > Service Configuration > Apache Configuration > Global Configuration, I believe these are the default values:

    MaxClients 150
    ServerLimit 256
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxRequestsPerChild 200
    KeepAlive On
    KeepAliveTimeout 5
    MaxKeepAliveRequests 100
    TimeOut 300


    Try going back to those.
     
  3. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    The values depends on the spec of the server and the hits to the domains in the server. It will be good if you give us an idea about that.
     
  4. blink8908

    blink8908 Member

    Joined:
    Feb 9, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I was having issues with the original Apache configuration which is why I began experimenting with changes to it. I was told at one point that the original config was for servers with only a really small amount of RAM/processors. No clue if that is correct or not.

    There is only one domain that has significant traffic. The domain consists of many PHP scripts that rely heavily on MySQL. I finally got the MySQL configured to where I no longer have issues with it, as well as many MySQL query optimizations.

    The domain on average gets 3,100,302 hits per day.

    This is what it says at the top of my Apache Status page:
    Server Version: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.3.4

    If there are any other specific specs needed, I am more than happy to provide it. Thanks for reading.
     
  5. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    You are right. Original config is for the servers having min RAM. If you have higher resource in the server we can tweak the services according to it. Can you please paste the free -m result here for a further check.

    Do you thinks all the hits are valid? If it is not it may be a DOS or DDOS. We can configure the firewall and also install additional softwares in order to prevent it.
     
  6. blink8908

    blink8908 Member

    Joined:
    Feb 9, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Sure, here is the result:


    total used free shared buffers cached
    Mem: 16047 14385 1661 0 629 9822
    -/+ buffers/cache: 3933 12113
    Swap: 2047 0 2047


    It's possible some of the hits are not valid but they have remained pretty constant over the months.

    I do have ConfigServer Security & Firewall installed.
     
  7. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    I could see you have more than enough RAM and free mem in the server. So your current httpd conf won't cause any issues. Depends on how many domains are there in the server it can be modified also.

    You need to configure your firewall for PORT_FLOOD and SYN_FLOOD. You can also install deflate or mod_evasive to control httpd connections. You can contact your host to do this for you.
     
  8. blink8908

    blink8908 Member

    Joined:
    Feb 9, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I am the host, that is, I manage the server. Do I contact the people that are housing the server? Or is it something on my end? Thanks again.
     
  9. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    If it is a managed server the people who hosts the server will help you on this.
    Cheers!
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The default settings are a good place to start, you might start back at defaults and instead look at that website a bit closer.
     
  11. blink8908

    blink8908 Member

    Joined:
    Feb 9, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Do you recommend one or the other? Or is it fine for both of them to be installed together?
     
  12. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    It won't harm if you install both. Both are easy to get installed. Good luck!
     
Loading...

Share This Page