Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    461

    Exclamation EA3 and Apache problems

    I used EA3 to update my old apache into the latest available version, along with PHP. My setup is: Apache 2.2, PHP 5, SuPHP and the usual php stuff (mbstring, etc).

    The build process completed without any problem and my old apache 1.3 was converted without any problem as well. Once everything was done, Apache was restarted.

    Unfortunately, all pages displayed 500 errors and the error_log shows:

    Code:
    [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread
    Since this is a VPS, i looked at the resource limits and found out that Apache takes over the entire system memory, 398MB of memory in total.

    Weird...

    Looked further into this issue, i found out that the default apache configuration does NOT load the process/thread/memory limits and runs completely unlimited with its own defaults (which are probably based on a dedicated server with lots of gigs of memory).

    Weird... since the directory /usr/local/apache/conf/extra/ contains the "httpd-mpm.conf" file which has them defined in there! So why isn't apache using those limits?

    I then edited the /usr/local/apache/conf/extra/httpd-default.conf and those values were ignored as well... hmmm

    Apparently, the generated httpd.conf is missing the lines which actually load the "extra" configuration files. I don't know why.

    So i had to manually edit my httpd.conf and add:

    Code:
    # Server-pool management (MPM specific)
    Include "/usr/local/apache/conf/extra/httpd-mpm.conf"
    
    # Various default settings
    Include "/usr/local/apache/conf/extra/httpd-default.conf"
    Then restarted Apache and all those memory problems went away!!

    Someone from cPanel team care to comment on this please?

  2. #2
    cPanelBilly
    Guest

    Default

    We don't normally add these files as they are not needed. If wanted you will need to add these as you did and distill the config.

  3. #3
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    461

    Default

    not needed?

    heh, now that EA3 is in all branches, get ready for a stream of people asking why their apache eats the entire available memory of their VPS!

    using the forum search, i found several people who have already hit this issue.

    it may be a good idea to add some new documentation pages and mention these "extras", because i had to guess and do lots of "greps" before i found them.

  4. #4
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    461

    Default

    After many hours of testing, i believe the "worker" module IS NOT suitable for a VPS server because it allocates too much memory (allocated!=used memory).

    The key issue is that it allocates the memory, so your VPS will still report that you have loads of free memory but your'll be hitting your privvmpages limit (requested but unused memory).

    You'll know it when you'll see the following signs:

    Code:
    errors like: Cannot allocate memory: couldn't create child process.
    errors like: (12)Cannot allocate memory: couldn't create child process.
    your /proc/user_beancounters under "privvmpages" will raise the fail count.
    i managed to limit the memory usage with the following options:

    Code:
        ServerLimit            4
        ThreadLimit           20
        StartServers           1
        MaxClients            20
        MinSpareThreads        1
        MaxSpareThreads        5
        ThreadsPerChild        5
    unfortunately, they are too limited and then these will hit the privvmpages limit with 20 or more concurrent HTTP requests.

    i believe the only solution is to use the prefork module which has no issues with pre-allocating memory since it doesn't use threads.
    .
    Last edited by sehh; 12-14-2007 at 08:13 PM.

Similar Threads & Tags
Similar threads

  1. Apache Help... Stupid EA3
    By edesignway in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-28-2008, 11:24 AM
  2. No ea3 problems, but a different question :)
    By OffbeatAdam in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 10-30-2007, 10:50 AM
  3. EA3 - Question about old Apache 1.3 config
    By mtindor in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-15-2007, 11:07 AM
  4. EA3 problems
    By katmai in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-14-2007, 07:06 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube