[Varnish] #572: Fix for: Create worker thread failed 11 Resource temporarily unavailable (Thread Problem on Linux)
Varnish
varnish-bugs at projects.linpro.no
Mon Nov 2 21:38:10 CET 2009
#572: Fix for: Create worker thread failed 11 Resource temporarily unavailable
(Thread Problem on Linux)
-------------------------+--------------------------------------------------
Reporter: whocares | Owner: phk
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by kb):
The "easy" way to avoid the 8MB or 10MB default stacksize penalty is to
run "ulimit -s 1024" to reduce the default stack to 1MB in the same
process before starting varnishd. Putting the ulimit in the start script
is the easier way.
But some threads will have a higher stack requirement than others. The
primary threads that are required for scale on Varnish (AFIACT) are the
worker and backend threads, so it made sense to me that reducing the usage
of these is most important, and that it was safest to only reduce the
stack size of these threads.
A few months ago, I wrote the attached patch which adds a varnishd
parameter to set the stack size for worker and backend threads. I've been
using it in production for months as "-p thread_pool_stacksize=256".
256KB is the smallest safe stack size on x86_64 in my experience, and
allows for plenty of threads.
This patch is against 2.0.4, but it applies without fuzz to trunk at 4339.
Ken
--
Ticket URL: <http://varnish.projects.linpro.no/ticket/572#comment:1>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list