The grace config eat the memory greatly

姚伟斌 nbubingo at
Fri Mar 30 11:05:45 CEST 2012

Hello, folks,

Yesterday, I encountered the similar problem in varnish-3.0.2 with
this ticket:

At first, we just configure  the memory to 1G "-s

And we specify the response grace time in VCL to be 30 minutes:
set beresp.grace =30m;

Our object cache time is very short:
set beresp.ttl = 5s;

Half an hour later, the total resident memory is about 3.7 G. It's 3
times more than the configured size.

Then I checked all the responses in my servers.  I thought maybe some
responses are too tiny at first time and It just wasted the index
object memory. But most of the HTTP responses are about 100K pages.

After that, I tested with the grace time:
When I remove the grace time, it's about up to 130M.
When I specify the grace time to 5 minutes, it's about up to 1G.
When I specify the grace time to 10 minutes, it's about up to 1.8G.

I think the response grace time greatly impacts the varnish resident
memory size. I don't know if it's a bug or feature. But it do eat too
much memory than the configured size.

Hope this mail can help someone.

More information about the varnish-misc mailing list