Varnish/Swap usage and network timeouts

Erik Steigler erik at okcupid.com
Mon Jun 2 17:54:46 CEST 2008


Hello,
I have 2 machines running varnish which handles around 1000 requests per 
second each and sometimes the machines will just stop responding to any 
network communication. A coworker used wireshark to check the connection 
and saw a whole lot of tcp retransmissions. Normally I would suspect 
some sort of network buffer issue but there is nothing in the logs at 
all. This is on FreeBSD  6.3 with a default 64 bit kernel with bge 
network cards. They are both running varnish-trunk revision 2635. 
Attached is the VCL file that is currently running. Varnish is started 
with the following options:
file,/vol/data1/varnish.cache,90% -t 259200 -h classic,500009 -p 
lru_interval=3600

The only suspicious things I've found are: Varnish says it is using 372G 
of virtual memory when I told it to use a 58gb file and there is only 
2gb of physical memory in the machine and there is pretty constant 
swapping going on, mostly under 500K but it seems to be pretty constant 
no matter the number of connections and such. The amount of swap space 
in the machine is 4gb and things are using 1.1gb.

Threads don't seem to be a problem, as the highest I've seen it is at 
500 and that was after an extended period of time around 250 or so. So I 
don't think I'm running into thread issues

So I guess I'm asking if anyone has any other suggestions other then 
reinstalling to FreeBSD 7.0 which seems to be the best solution I can 
see. If that is the best solution, what is the optimal FreeBSD 
configuration for Varnish? Lots of swap space? No swap space? Currently 
the mmap-ed file is on an SSD so one alternative I thought of was to 
make the entire SSD part of swap and use the malloc option and get rid 
of any regular disk basked swap.

Thanks for any help,
Erik


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: default.vcl
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20080602/18744435/attachment-0001.ksh>


More information about the varnish-misc mailing list