OpenVZ Forum


Home » General » Support » Apache don't start Cannot allocate memory
Apache don't start Cannot allocate memory [message #12855] Fri, 11 May 2007 19:26 Go to next message
gaper is currently offline  gaper
Messages: 9
Registered: May 2007
Location: México
Junior Member
Hi guys first I apologize for my terrible English ... I have a server (HN) with two VE's, this VE's are going to run "trac", trac needs apache, mod_python and litesql, but I just can't start apache, /var/log/apache2/error.log sayd:

Fri May 11 13:48:09 2007] [notice] mod_python: using mutex_directory /tmp
[Fri May 11 13:48:09 2007] [notice] Apache/2.2.3 (Debian) mod_python/3.2.10 Pyth on/2.4.4 configured -- resuming normal operations
[Fri May 11 13:48:09 2007] [alert] (12)Cannot allocate memory: apr_thread_create : unable to create worker thread
[Fri May 11 13:48:09 2007] [alert] (12)Cannot allocate memory: apr_thread_create : unable to create worker thread
[Fri May 11 13:48:11 2007] [alert] No active workers found... Apache is exiting!
julius:~#


My enviroment its:
piso-7-48:~# vzlist
     VPSID      NPROC STATUS  IP_ADDR         HOSTNAME
       101          7 running 192.168.7.201   julius
       102          5 running 192.168.7.202   dalton
piso-7-48:~#


I have 512mb of ram ... I tryed:
vzctl set 101 --vmguarpages 224M --save
vzctl set 101 --oomguarpages 224M --save
vzctl set 101 --privvmpages 100000 --save


But not working so I reloaded the old and default config:
vzctl set 101 --vmguarpages 6144:2147483647 --save
vzctl set 101 --oomguarpages 6144:2147483647 --save
vzctl set 101 --privvmpages 49152:53575 --save


With the default config I got this in /proc/user_beancounters:

piso-7-48:~# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
      102:  kmemsize         295987     953952    2752512    2936012          0
            lockedpages           0          0         32         32          0
            privvmpages         795      49416      49152      53575          2
            shmpages              0        136       8192       8192          0
            dummy                 0          0          0          0          0
            numproc               5         32         65         65          0
            physpages           489       2689          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages        489       2689       6144 2147483647          0
            numtcpsock            1          3         80         80          0
            numflock              1          2        100        110          0
            numpty                0          0         16         16          0
            numsiginfo            0          4        256        256          0
            tcpsndbuf             0          0     319488     524288          0
            tcprcvbuf             0          0     319488     524288          0
            othersockbuf       2232       2928     132096     336896          0
            dgramrcvbuf           0       8376     132096     132096          0
            numothersock          2          5         80         80          0
            dcachesize            0          0    1048576    1097728          0
            numfile             132        612       2048       2048          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        128        128          0
      101:  kmemsize         266605     911208    2752512    2936012          0
            lockedpages           0          0         32         32          0
            privvmpages         795      49060      49152      53575          2
            shmpages              0        136       8192       8192          0
            dummy                 0          0          0          0          0
            numproc               5         32         65         65          0
            physpages           488       2558          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages        488       2558       6144 2147483647          0
            numtcpsock            1          3         80         80          0
            numflock              1          2        100        110          0
            numpty                0          0         16         16          0
            numsiginfo            0          4        256        256          0
            tcpsndbuf             0          0     319488     524288          0
            tcprcvbuf             0          0     319488     524288          0
            othersockbuf       2232       2928     132096     336896          0
            dgramrcvbuf           0       8376     132096     132096          0
            numothersock          2          5         80         80          0
            dcachesize            0          0    1048576    1097728          0
            numfile             132        604       2048       2048          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        128        128          0
        0:  kmemsize        2075423    2455127 2147483647 2147483647          0
            lockedpages           0          0 2147483647 2147483647          0
            privvmpages        3088       8076 2147483647 2147483647          0
            shmpages            655        671 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numproc              42         58 2147483647 2147483647          0
            physpages          1508       1508 2147483647 2147483647          0
            vmguarpages           0          0 2147483647 2147483647          0
            oomguarpages       1508       1508 2147483647 2147483647          0
            numtcpsock            2          2 2147483647 2147483647          0
            numflock              1          6 2147483647 2147483647          0
            numpty                1          1 2147483647 2147483647          0
            numsiginfo            0          3 2147483647 2147483647          0
            tcpsndbuf         17856          0 2147483647 2147483647          0
            tcprcvbuf         32768          0 2147483647 2147483647          0
            othersockbuf      13392      18080 2147483647 2147483647          0
            dgramrcvbuf           0       8376 2147483647 2147483647          0
            numothersock         21         25 2147483647 2147483647          0
            dcachesize            0          0 2147483647 2147483647          0
            numfile             783        948 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numiptent            10         10 2147483647 2147483647          0
piso-7-48:~#


I will estimate your help. Tnks.

att: gaper

p.d: live net !!!

Re: Apache don't start Cannot allocate memory [message #12858 is a reply to message #12855] Sat, 12 May 2007 04:17 Go to previous message
swindmill is currently offline  swindmill
Messages: 57
Registered: April 2007
Member
The default Debian Apache2 install uses the worker MPM which seems to eat up memory at initialization.

I edited my /etc/apache2/apache2.conf to look like this:

...

<IfModule mpm_worker_module>
#Default is 2
StartServers 1
#Default is 150
MaxClients 80
#Default is 25
MinSpareThreads 5
MaxSpareThreads 75
#Default is 25
ThreadsPerChild 5
MaxRequestsPerChild 0
</IfModule>

...

And apache2 starts up properly on a VE and uses MUCH less memory.

You can also install libapache2-mod-php5 and Debian will switch Apache2 to use the prefork MPM which needs less memory.

apt-get install lib-apache2-mod-php5

You can check which MPM apache2 is set to use by running /usr/sbin/apache2 -l

You'll see either prefork.c or worker.c? (I'm not currently using worker) in the output.
Previous Topic: CPT ERR
Next Topic: VE_PRIVATE on GFS2
Goto Forum:
  


Current Time: Tue Apr 23 10:42:34 GMT 2024

Total time taken to generate the page: 0.01274 seconds