1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Apache performance server reached MaxClients setting

Discussion in 'Plesk for Linux - 8.x and Older' started by erhnam, Jun 1, 2005.

  1. erhnam

    erhnam Basic Pleskian

    23
    57%
    Joined:
    Oct 26, 2003
    Messages:
    37
    Likes Received:
    0
    I have a plesk (7.5.2 box) running with Redhat 9. This machine (Pentium 4 1024 mhz) was running fine for quite a long time. This week one of my sites became very populair and this gives me some troubles. The apache server stops to work and I need to restart it within every 10 minutes. Then apache is up and after 10 minutes its down again. The server log said this:

    [error] server reached MaxClients setting, consider raising the MaxClients setting

    So I changed the MaxClients from 100 to 256.
    This will increase the dying time from 10 minutes till 20 minutes but does not solve the problem. When I check the apache status I see this:

    /etc/init.d/httpd status
    httpd (pid 5073 5072 5071 5070 5069 5068 5067 5065 5064 5063 5062 5061 5060 5059 5058 5057 5056 5055 5054 5053 5052 5051 5050 5049 5048 5034 5033 5032 5031 5030 5029 5028 5027 5026 5025 5024 5023 5022 5021 5019 5018 5010 5009 5008 5007 5006 5004 5003 5002 4998 4997 4995 4994 4991 4990 4988 4953 4952 4951 4950 4949 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 4937 4936 4935 4934 4933 4932 4930 4929 4928 4927 4926 4925 4924 4923 4922 4921 etc etc etc

    This is my current httpd.conf:

    KeepAlive Off
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15

    <IfModule prefork.c>
    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    MaxClients 256
    MaxRequestsPerChild 1000
    </IfModule>

    <IfModule worker.c>
    StartServers 2
    MaxClients 256
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 0
    </IfModule>

    <IfModule perchild.c>
    NumServers 5
    StartThreads 5
    MinSpareThreads 5
    MaxSpareThreads 10
    MaxThreadsPerChild 20
    MaxRequestsPerChild 0
    </IfModule>

    Please let me know how I can solve this problem!
     
  2. graffix

    graffix Guest

    0
     
    Do not a Graceful Restart of Apache. The Memory rise up. You must Stop/Start it.

    I had the same problem and SW-Soft fixed it with this.
     
  3. erhnam

    erhnam Basic Pleskian

    23
    57%
    Joined:
    Oct 26, 2003
    Messages:
    37
    Likes Received:
    0
    Yes but after a restart of the apache webserver the problem is back again after just 15 minutes. Right now apache is restarting every 10 minutes but is not a proper solution.
     
  4. graffix

    graffix Guest

    0
     
    Where do you set the order (graceful or start/stop action)?
     
  5. jamesyeeoc

    jamesyeeoc Guest

    0
     
    erhnam - you didn't mention how high your hits are getting. By default, the ServerLimit directive is 256, so if you put 'ServerLimit 500', then you will be able to increase the MaxClients above 256.

    You will want to put ServerLimit after 'KeepAliveTimeout 15' and before '<IfModule prefork.c>'

    Solving the problem consists of having both limits set for the load which your hardware can safely handle as well as the amount of hits you expect to get.

    If the load then jumps higher, you will need to readjust the limits again.

    What are the hardware specs of your server?
     
  6. erhnam

    erhnam Basic Pleskian

    23
    57%
    Joined:
    Oct 26, 2003
    Messages:
    37
    Likes Received:
    0
    Thanks for your post! You made my day. The specs are:

    Pentium 4, 3 Ghz, 1024 Mb RAM.

    I raised the number to 500 and now the problem seems to be gone. I'm going to replace the 1024 mem by 2048 in case if 500 limits is not enough.
     
  7. jamesyeeoc

    jamesyeeoc Guest

    0
     
    I was going to suggest more ram...:D

    I am assuming the CPU is HT, so then the question is did you install the SMP version of RH9?
     
  8. poke

    poke Guest

    0
     
    More ram and A.R.T.'s httpd-highfd replace your current httpd build......


    -poke
     
Loading...