high memory usage with malloc and file backends configured

Dridi Boukelmoune dridi at varni.sh
Mon Jul 10 16:35:44 CEST 2017


> From what you're saying file method still uses resident memory for each
> object, so with my configuration (20G malloc, 75G file) i would need 95G RAM
> if all storage is used? (without swap being used)

Not RAM, virtual memory. But yes, this is the idea.

> If this is the case i'm curious what the use cases are for file vs only
> malloc.

Basically, malloc storage relies on the underlying allocator (preferably
jemalloc) to acquire memory, whereas file storage has its own allocator
looking for space inside the designated "area" (the 75GB file that was
mapped in memory). If you over-commit memory, it may be subject to
swap for malloc, and the OS page cache/disk buffer for file.

Depending on your workloads or the shape and distribution of your
responses, one might perform better than the other. You can also have
more than one (like you did) for various reasons. And finally, you may
get more memory from the Transient storage (you didn't paste the
stats) that is used for uncacheable or shortlived objects.

Dridi



More information about the varnish-misc mailing list