Resident memory not released

R, Rajkumar (Raj) rajkumaradass at avaya.com
Mon Aug 5 12:55:39 UTC 2019


I'm also facing this problem of memory not being released in Kubernetes, but we are using alpine image which includes musl library.  Could you please provide your thoughts in this case.

thanks,
raj

-----Original Message-----
From: nginx <nginx-bounces at nginx.org> On Behalf Of fredr
Sent: Monday, August 5, 2019 4:43 PM
To: nginx at nginx.org
Subject: Re: Resident memory not released

I guess you are right. The main reason I want to scale on memory rather than number of connections, is that we wouldn't have to calculate how many connections a node can handle. Eg, if we change the memory size of each node, we also have to update the automatic scaling metric, or lets say there is a new version of nginx that uses less memory per connection, then we would have to re-calibrate the scaling.

I did read up a bit on the MALLOC_CHECK_ variable, and it sound like that should not be used in production, as it reduces the overall performance.

I've also tried to compile jemalloc and load that via the LD_PRELOAD environment variable. That seems to work pretty good, memory is released/reclaimed as I would expect, but only when running nginx as root.
Not sure why it doesn't work when starting nginx as an other user though.

But I think I'll do as you suggested and scale it on number of connections for now. I'm a bit out of my depth here :) 


Peter Booth via nginx Wrote:
-------------------------------------------------------
> I’m wondering if you are overthinking this. You said that the memory 
> was reused when the workload increased again. Linux memory management 
> is unintuitive. What would happen if you used a different metric, say 
> # active connections, as your autoscaling metric? It sounds like this 
> would behave “better”.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285025,285109#msg-285109

_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


More information about the nginx mailing list