varnish constant hdd write

Hank A. Paulson hap at spamproof.nospammail.net
Wed Jun 9 19:34:21 CEST 2010


You can cut it pretty close on the memory if you are using the box just for 
varnish - 400,178,190 connections with just 735 MB of 11996 MB memory free :)

[root at varn198 ~]# varnishstat -1 | egrep "n_object|client_conn"
client_conn         400178190        68.82 Client connections accepted
n_object               345931          .   N struct object
n_objecthead           345933          .   N struct objecthead

[root at varn198 ~]# fgrep malloc /etc/sysconfig/varnish
              -s malloc,11100M \

[root at varn198 ~]# free -m
              total       used       free     shared    buffers     cached
Mem:         11996      11727        269          0        243        223
-/+ buffers/cache:      11260        735
Swap:            0          0          0

[root at varn198 ~]# uname -a
Linux varn198 2.6.32.10-90.fc12.x86_64 #1 SMP Tue Mar 23 09:47:08 UTC 2010 
x86_64 x86_64 x86_64 GNU/Linux

[root at varn198 ~]# w
  00:20:33 up 67 days,  7:23,  1 user,  load average: 0.00, 0.00, 0.00

On 6/9/10 2:13 AM, Alex F wrote:
> 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.
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list