Raising the number of threads will not significantly improve Varnish concurrency in most cases. I did a test a few months ago using 4 CPUs on RHEL 4.6 with very high request concurrency and a very low request-per-connection ratio (i.e., 1:1, no keepalives) and found that the magic number is about 16 threads/CPU. You should raise overflow_max to a very high value (10000% worked just fine for us).<br>
<br>Under optimal operating conditions you should not see the "threads not created" value increasing like this.<br><br>Best regards,<br><br>--Michael<br><br><div class="gmail_quote">On Tue, Jun 17, 2008 at 3:37 AM, <<a href="mailto:duja@torlen.net" target="_blank">duja@torlen.net</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I recently made a loadtest against through varnish.<br>
<br>
First I received a very high response time and found out that varnish was maxing the maximum nr of threads.<br>
<br>
I updated thread_min = 5 and thread_max = 300 and recevied much better resp. times.<br>
<br>
Then I increased the nr of concurrent users and made another loadtest. The strange thing here was that I received high resp. times but the threads stopped at 238.<br>
<br>
The "N worker threads not created" increased rapidly.<br>
<br>
I increased the threads again and changed listen_depth to 2048.<br>
<br>
Here is all the numbers:<br>
238 0.00 0.22 N worker threads created<br>
1318 4.98 1.21 N worker threads not created<br>
<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
0 Debug - "Create worker thread failed 12 Cannot allocate memory"<br>
<br>
default_ttl 120 [seconds]<br>
thread_pools 2 [pools] <<<<<br>
thread_pool_max 400 [threads] <<<<<br>
thread_pool_min 10 [threads] <<<<<br>
thread_pool_timeout 120 [seconds]<br>
thread_pool_purge_delay 1000 [milliseconds]<br>
thread_pool_add_threshold 2 [requests]<br>
thread_pool_add_delay 10 [milliseconds]<br>
thread_pool_fail_delay 200 [milliseconds]<br>
overflow_max 100 [%]<br>
rush_exponent 3 [requests per request]<br>
sess_workspace 8192 [bytes]<br>
obj_workspace 8192 [bytes]<br>
sess_timeout 5 [seconds]<br>
pipe_timeout 60 [seconds]<br>
send_timeout 600 [seconds]<br>
auto_restart on [bool]<br>
fetch_chunksize 128 [kilobytes]<br>
vcl_trace off [bool]<br>
listen_address <a href="http://0.0.0.0:80" target="_blank">0.0.0.0:80</a><br>
listen_depth 2048 [connections] <<<<<br>
srcaddr_hash 1049 [buckets]<br>
srcaddr_ttl 30 [seconds]<br>
backend_http11 off [bool]<br>
client_http11 off [bool]<br>
cli_timeout 5 [seconds]<br>
ping_interval 3 [seconds]<br>
lru_interval 2 [seconds]<br>
cc_command exec cc -fpic -shared -Wl,-x -o %o %s<br>
max_restarts 4 [restarts]<br>
max_esi_includes 5 [restarts]<br>
cache_vbe_conns off [bool]<br>
connect_timeout 400 [ms]<br>
cli_buffer 8192 [bytes]<br>
diag_bitmap 0x0 [bitmap]<br>
<br>
Why do I get "Create worker thread failed 12 Cannot allocate memory" when I had 1900MB free RAM and 65GB free Disk on the server? Any ideas?<br>
<br>
If "N worker threads not created" is increasing, is that a bad sign?<br>
<br>
Thanks<br>
Duja<br>
<br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@projects.linpro.no" target="_blank">varnish-misc@projects.linpro.no</a><br>
<a href="http://projects.linpro.no/mailman/listinfo/varnish-misc" target="_blank">http://projects.linpro.no/mailman/listinfo/varnish-misc</a><br>
<br>
</blockquote></div><br>