httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Edmundsson <>
Subject Re: ThreadStackSize quirk on Linux
Date Thu, 02 Apr 2009 14:57:25 GMT
On Tue, 31 Mar 2009, Eric Covener wrote:

> I'm finding that when I try to reduce the stack size with
> ThreadStackSize on recent linux systems, where ulimit -s is NOT
> unlimited (but very large, 10240K) , ThreadStackSize fails to have any
> effect (via pmap / ps -eFw).
> When ulimit -s is unlimited, and the default is very large,
> ThreadStackSize works. Has this always been the case? If so, I'd like
> to document for Linux that you're best off heading straight to ulimit
> / limits.conf.
> (I looked at RHEL4 and RHEL5 with recent maintenance)

Yes, a "feature" since the NPTL-stuff. So now we have the range of 
defaults from 4k (Solaris I think) to huge (Linux), makes for funny 
surprises when porting applications written on Linux that doesn't set 
the stacksize appropriately...

We have the following in all our httpd startup scripts (Ubuntu boxes, 
but it's the same issue):

# 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

  Niklas Edmundsson, Admin @ {acc,hpc2n}      |
  Luckily, I'm out of hairs to split!

View raw message