Nginx 1.12.1 Memory Consumption
Matthew Smith
matthew.smith at acquia.com
Mon Mar 19 14:38:30 UTC 2018
Hello,
The host has 30G total memory. Nginx usage is being measured by summing the
Pss values from /proc/$pid/smaps for all worker processes.
Do you have any suggestions for differentiating between the two issues that
might prevent memory from being returned to the system?
Thanks!
On Thu, Mar 15, 2018 at 1:06 PM Peter Booth <peter_booth at me.com> wrote:
> Two questions:
>
> 1. how are you measuring memory consumption?
> 2. How much physical memory do you have on your host?
>
>
> Assuming that you are running on Linux, can you use pidstat -r -t -u -v
> -w -C “nginx”
> to confirm the process’s memory consumption,
>
> and cat /var/meminfo to view a detailed description of how memory is
> being used onto entire host.
>
>
> On Mar 14, 2018, at 1:05 PM, Matthew Smith <matthew.smith at acquia.com>
> wrote:
>
> Hello,
>
> I have encountered what I consider to be an interesting behavior. We have
> Nginx 1.12.1 configured to do SSL termination as well as reverse proxy.
> Whenever there is a traffic spike (300 req/s > 1000 req/s, 3k active
> connections > 20k active connections), there is a corresponding spike in
> Nginx memory consumption. In this case 500M > 8G across 10 worker
> processes. What is interesting is that Nginx never seems to release this
> memory after the traffic returns to normal. Is this expected? What is Nginx
> using this memory for? Is there a configuration that will rotate the
> workers based on some metric in order to return memory to the system?
>
> Requests per second:
>
> https://www.dropbox.com/s/cl2yqdxgqk2fn89/Screenshot%202018-03-14%2012.38.10.png?dl=0
>
> Active connections:
>
> https://www.dropbox.com/s/s3j4oux77op3svo/Screenshot%202018-03-14%2012.44.14.png?dl=0
>
> Total Nginx memory usage:
>
> https://www.dropbox.com/s/ihp5zxky2mgd2hr/Screenshot%202018-03-14%2012.44.43.png?dl=0
>
> Thanks,
>
> Matt
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180319/6751b7a8/attachment-0001.html>
More information about the nginx
mailing list