Varnish with many TIME_WAIT sockets and traffic problems

John S. mailingoijv at gmail.com
Mon Sep 26 16:00:22 CEST 2011


2011/9/26 Marinos Yannikos <mjy at geizhals.at>
> TIME_WAIT looks OK to me, it's not high. Here are some hints for sysctl settings: http://www.mail-archive.com/varnish-misc@projects.linpro.no/msg01571.html (do NOT set tw_recycle=1 though!).

It's not very high but twice as much what we have on Squid at the same
time. Thank you for your link, we actually use the same sysctls than
for Squid - that is, default values for everything except :
net.ipv4.ip_local_port_range = 1024 65535
vm.mmap_min_addr=4096
vm.swappiness = 40

> Regarding half the traffic, just check whether you have failed requests (e.g. "varnishncsa -m TxStatus:[45]" or similar), but it can be due to the way Varnish handles keepalives differently (what are your Varnish vs. Squid settings for Keepalives?).

We have a lot of 304 (not modified, I assume this is normal) and some
404, not enough to worry about so it seems to work.

Considering keep-alives, we have the default for Varnish :
default_grace              10.000000 [seconds]
default_keep               0.000000 [seconds]
default_ttl                120.000000 [seconds]
sess_timeout               5 [seconds]
sess_workspace             65536 [bytes]
session_linger             50 [ms]
session_max                100000 [sessions]

And for Squid, we have :
pconn_timeout 60 seconds
request_timeout 5 seconds
half_closed_clients off
client_persistent_connections on
server_persistent_connections on

Let me know if you need any other values.




More information about the varnish-misc mailing list