On Sun, 21 Oct 2007, Ruediger Pluem wrote:

What is your setting for ThreadsPerChild?

On my Linux each thread consumes 8MB of virtual memory (I assume for stack and other thread private data) as shown by pmap. This can sum up to a large amount of memory.

This is due to linux libc setting the thread stack size using the stack resource limit. We have the following in our apache httpd startup script:

# NPTL (modern Linux threads) defaults the thread stack size to the setting
# of your stack resource limit. The system-wide default for this is 8MB,
# which is waaay exaggerated when running httpd.
# 512kB should be more than enough (AIX manages on 96kB, Netware on 64kB).
ulimit -s 512

We didn't bother with trying to lower it more, but I've run the same httpd config on IBM AIX 5.1 with the default 96kB thread stack size without problems.

This could probably be worked around in httpd/APR by calling setrlimit before starting the threads, however I think it's probably better to just document this Linux thread bogosity and let vendors fix their httpd startup scripts though.

 Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     [EMAIL PROTECTED]
 No boom now.  Boom tomorrow...there's ALWAYS a boom tomorrow...BOOM!

Reply via email to