OpenVZ Forum


Home » General » Support » Problem with running apache2
Problem with running apache2 [message #1589] Tue, 14 February 2006 14:21 Go to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

If i'm starting apache2, it's runnig for about ten seconds and then gets killed.
The following message is printed to apache log
Quote:

[Tue Feb 14 14:19:58 2006] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create work
er thread


Anybody has run into the same problem?

TIA,
Steffen
Re: Problem with running apache2 [message #1590 is a reply to message #1589] Tue, 14 February 2006 16:13 Go to previous messageGo to next message
devnu11 is currently offline  devnu11
Messages: 64
Registered: September 2005
Location: USA
Member

A real quick check of Everyone's Friend, Google, returned this.

Quote:

apr_thread_create: unable to create worker thread

This is a tuning issue. The operating system failed a request by the web server to create another thread. The operating system can be tuned to allow more threads, or the web server can be tuned to create fewer threads per process so that it doesn't encounter this issue.

Things to check:

1. value of ThreadsPerChild in the worker MPM configuration in serverroot/conf/httpd.conf

It may be too high for current operating system limits on memory or processes or threads.
2. AIX: value of LDR_CNTRL variable in serverroot/bin/envvars file

This controls how much of the address space can be used for heap storage, and heap storage is the main requirement on AIX for being able to create a new thread.



This is the original URL: http://publib.boulder.ibm.com/httpserv/ihsdiag/errorlog.html

Good luck


Just Because You Have One, Doesn't Mean You Have To Be One!
Re: Problem with running apache2 [message #1592 is a reply to message #1590] Tue, 14 February 2006 19:25 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
*umpf*

Next time I will try googling first.

Thanks,
Steffen
Re: Problem with running apache2 [message #1593 is a reply to message #1592] Tue, 14 February 2006 20:25 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hmm...Something is really wrong on my system.
If I'm starting apache2 set to max one client, it works. If I double this value, the error is printed out.

Is there a limit on threads?

Somebody has a running apache2 under debian?

TIA,
Steffen
Re: Problem with running apache2 [message #1623 is a reply to message #1593] Thu, 16 February 2006 11:00 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Steffen, there is a single limit for processes/threads in /proc/user_beancounters calles numproc. You can check failcnt columnt in this file to make sure that you don't hit the limit. I really doubt you do hit it.

What can help to resolve this issue is if you made a strace of apache, e.g.
# strace -f -o output_file <cmd to start apache server'


http://static.openvz.org/userbars/openvz-developer.png
Re: Problem with running apache2 [message #1626 is a reply to message #1623] Thu, 16 February 2006 11:30 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
I've got Gentoo installed in a VPS. Apache is working in this install.

The difference between Gentoo and Debian/Suse: Apache is using the worker-mpm (threaded). Under Gentoo it's using prefork-mpm.
I'm going to compile Apache under Gentoo with the worker-mpm.

Debian VPS output of cat /proc/user_beancounters:
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       101: kmemsize         562242     934175   26624384   26624384          0
            lockedpages           0          0        182        182          0
            privvmpages        1490      14632      15930      17523          1
            shmpages              0        336       1593       1593          0
            dummy                 0          0          0          0          0
            numproc              10         20        400        400          0
            physpages          1050       5335          0 2147483647          0
            vmguarpages           0          0       5310 2147483647          0
            oomguarpages       1050       5335       5310 2147483647          0
            numtcpsock            2          6        950        950          0
            numflock              3          9        608        668          0
            numpty                1          1         95         95          0
            numsiginfo            0          7        512        512          0
            tcpsndbuf             0      11472    1268947    4153147          0
            tcprcvbuf             0      86736    1268947    4153147          0
            othersockbuf     112560     124128     634473    3518673          0
            dgramrcvbuf           0       2224     634473     634473          0
            numothersock         72         82        950        950          0
            dcachesize       137529     173265    6144384    6144384          0
            numfile             199        305      16001      16001          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        200        200          0


Output of Gentoo VPS:
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       102: kmemsize         255909    1223451    2752512    2936012          0
            lockedpages           0          0         32         32          0
            privvmpages         716      19939      49152      53575          0
            shmpages              0         14       8192       8192          0
            dummy                 0          0          0          0          0
            numproc               5         29         65         65          0
            physpages           546      14084          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages        546      14084       6144 2147483647          0
            numtcpsock            0          5         80         80          0
            numflock              0          3        100        110          0
            numpty                1          1         16         16          0
            numsiginfo            0         10        256        256          0
            tcpsndbuf             0     113424     319488     524288          0
            tcprcvbuf             0     220176     319488     524288          0
            othersockbuf       2224       6672     132096     336896          0
            dgramrcvbuf           0       2224     132096     132096          0
            numothersock          1          5         80         80          0
            dcachesize        56286     122130    1048576    1097728          0
            numfile              32        207       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
Re: Problem with running apache2 [message #1627 is a reply to message #1626] Thu, 16 February 2006 12:02 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

you have much lower "privvmpages" limits in your Debian VPS and you hit this limit.
try to increase the limit to the same value as in Gentoo via:
# vzctl set 101 --privvmpages 49152:53575


http://static.openvz.org/userbars/openvz-developer.png
Re: Problem with running apache2 [message #1628 is a reply to message #1627] Thu, 16 February 2006 12:07 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Thanks. Must have overseen this.
Now everything is working.

HAND,
Steffen

PS: Have you had the time to take a look at the full no-module-patch? It's working probably on two systems.
Re: Problem with running apache2 [message #1629 is a reply to message #1628] Thu, 16 February 2006 12:14 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

P.S.
No, I haven't yet Sad
Glad to hear that it works fine!


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: assign public ( or private ) ip to new vps?
Next Topic: Network timeout
Goto Forum:
  


Current Time: Fri Jul 12 20:29:34 GMT 2024

Total time taken to generate the page: 0.02446 seconds