Varnish over memory allocation

Alex Wakefield AlexWakefield at fastmail.com.au
Mon May 25 06:26:17 UTC 2020


Hi all,

I currently have multiple Varnish 6.0.5 (varnish-6.0.5 revision 3065ccaacc4bb537fb976a524bd808db42c5fe40) instances deployed to production with Varnish modules (0.15.0) installed that consistently go over their memory allocation by several gigabytes.

These instances live on 32GB VMs (Ubuntu 18.04) but are tuned to only use 24GB of memory to allow enough overhead for fragmentation and other processes on the machine. If left alone they grow until OOM killer kicks in and kills them off. Currently they're sitting at 30GB of memory used with ~1,942,200 objects in cache according to MAIN.n_object.

In terms of traffic we serve standard HTTP traffic for several quite large websites but images and other binary objects are not stored in cache.

I understand that per 100,000 objects there is ~100MB of fragmentation/overhead so is this amount of memory over-usage to be expected? Is there any tuning I can do to try to reduce this overhead or is the answer to reduce the amount of objects in memory?

We purge assets via XKey tags that are on our pages and some standard bans via purge. All our bans are lurker friendly though, we only hover ~30-50 active bans at any time. XKey purges are a combination of soft and hard purges.

Any advice would be fantastic! Let me know if there is any further information I can provide.

Regards,
Alex


More information about the varnish-misc mailing list