varnish constant hdd write

Alex F alex at acasa.ro
Wed Jun 9 11:13:43 CEST 2010


I issued a fresh free -m so that's why I said 1.6 free in my last mail:
          total  used  free shared buffers cached
Mem: 3950 3916 33      0       175     1450
-/+ buffers/cache: 2290 1659
Swap: 3999 0 3999

By "varnish log file" do you mean the .bin?
I now see that the most active partition with many HDD writes is /var. 
So I think it has something to do with /var/lib/varnish given the fact 
that my websites are located in /usr.

Also, can anyone explain to me if there is any relation between virtual 
memory allocated to varnish and the amount it uses for caching objects?

As a side note, I use munin for monitoring, and since I installed the 
latest version yesterday, the Memory Usage graphic shows that swap is 
not being used at all, compared to constant 1GB of swap used by the 
2.0.5 varnish version. Screenshot: http://i48.tinypic.com/66f7us.png

On 9.6.2010 11:28, Tollef Fog Heen wrote:
> You have about 2G of buffer cache, so no, you're not nearly out of
> memory.  In general, if you're seeing I/O problems, you should start by
> putting the varnish log file (which usually lives in /var/lib/varnish)
> on a tmpfs, to prevent Linux from writing that to disk.
>
> Given you're using a 2G storage file on a 4G machine, you probably also
> want to use -s malloc rather than -s file

Indeed, it is a web portal. I cache only  
(txt|ico|png|jpeg|jpg|gif|tiff|js|css).

On 9.6.2010 11:18, Per Buer wrote:
> You're right. Varnish would only have 1GB of memory to store objects.
> Linux doesn't really do paging very well so your wise to stay within
> the boundaries of physical memory.
>
> This might not be so bad if your backend if somewhat snappy. If your
> web site is news or portal like most of the 'hot' content will be the
> content linked from the front page + related content. In most cases a
> web site won't have more than 100MB of 'hot' content and such 1GB of
> cache will go a really long way.
>
> Per.




More information about the varnish-misc mailing list