I currently have a problem with varnish 7.0.3
I’m using varnish in front of Magento. Right now I have a problem with memory leak with the varnish Transient storage.
From what I see on the internet there is a problem with the the libjemalloc2 version "libjemalloc2/jammy,now 5.2.1-4ubuntu1" regarding this, and they say that 5.3.0 solved this issue.
How can I upgrade the libjemalloc2 to 5.3.0? I’m using Ubuntu 22.04 and everything was installed using apt package manager.
2
Answers
Please check Varnish 6 LTS /w CentOS 8 not respecting memory limits?
It is happening the same to me. I'm using ubuntu 22.04 LTS that has jemalloc 5.2.1 .
The varnish.service now looks like this:
My vcl looks like this:
My current storage usage acording to varnishstat:
My process is now consuming 1.3g according to "top" command.
The problem is that I don't see the transient memory every going down, and it reaches the limit of the defined total transient memory, according to the varnishstat. If I put a bigger limit it reaches it in the space of a day and never goes down. Also the total memory of the varnish process end up being bigger that the limits I put on it.
Several times it just consumes all the server memory and ends up using swap, until it reaches its limit.
At that point the OS kills the varnish process.
The Varnish Core Developer group is not aware of any real memory leak regarding jemalloc. Can you describe the symptoms of this leak?
Transient storage is a very particular storage engine in Varnish. By default it’s unlimited and ensures that short-lived and uncacheable content is held while being processed by the client.
Transient storage memory grows a lot faster than it shrinks and potential jemalloc tuning could optimize some of the wasted memory.
Is there anything in particular you can share to support your problem? Because it’s entirely possible that it’s a feature and not a bug.