Memory issue

Maxim Dounin mdounin at mdounin.ru
Thu Apr 6 17:05:31 UTC 2017


Hello!

On Thu, Apr 06, 2017 at 11:32:45AM -0400, JohnCarne wrote:

> cpanel stat generation cause thet nginx makes a lot of reload to grab new
> file descriptor... no issue on that
> 
> Issue is nginx, I show you situation now with 2.58% used for 1 work, which
> is same value for others, but gloably, nginx uses now 2.58%, this number is
> increasing slowly at the rythm of nginx reloads asked...
> 
> 
> [root at web1 ~]# ps alx | grep nginx
> 5    99  711213  913692  20   0 3917936 3397132 ep_pol S ?          0:22
> nginx: worker process
> 5    99  711224  913692  20   0 3918128 3397300 ep_pol S ?          0:24
> nginx: worker process
> 5    99  711229  913692  20   0 3918392 3397456 ep_pol S ?          0:26
> nginx: worker process
> 5    99  711238  913692  20   0 3918128 3397228 ep_pol S ?          0:20
> nginx: worker process
> 5    99  711245  913692  20   0 3917936 3397144 ep_pol S ?          0:23
> nginx: worker process
> 5    99  711248  913692  20   0 3918096 3397296 ep_pol S ?          0:18
> nginx: worker process
> 5    99  711252  913692  20   0 3918392 3397392 ep_pol S ?          0:21
> nginx: worker process
> 5    99  711255  913692  20   0 3918128 3397132 -   R    ?          0:19
> nginx: worker process
> 5    99  711257  913692  20   0 3917580 3394632 ep_pol S ?          0:00
> nginx: cache manager process
> 0     0  767011  766950  20   0 112652   956 pipe_w S+   pts/2      0:00
> grep --color=auto nginx
> 5     0  913692       1  20   0 3917576 3396176 sigsus Ss ?        74:26
> nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

Ok, so nginx master process grown to 3+ GB, and all workers are 
mostly identical.  So the memory is certainly consumed by the 
master process.  This may or may not be normal, depending on the 
configuration used.

If you think that memory is consumed on configuration reloads, you 
may want to provide "ps alx | grep nginx" after restarting nginx 
(it is expected to be small), after one configuration reload (it 
is expected to be larger due to another copy of the configuration 
allocated) and after multiple configuration reloads (this will 
demonstrate increased memory consumption, if any).

Note well: leaking memory on configuration reloads is a more or 
less typical problem with various 3rd party modules.  IIRC, 
various versions of modsecurity were previously reported doing 
this.  As previously suggested, try without 3rd party modules to 
see if it helps.

> Output of nginx -T is taking 100's of pages, i can't pu it here...

Well, not a problem.  It simply limits possibility of others to help 
you.  Anyway, I suspect your problem is 3rd party modules, and I 
don't think there is a room to investigate further before testing 
if the problem persists without 3rd party modules.

[...]

> Indeed, we are all tired to do 3 upgrades /month

Note that the way you are asking others to help you is not likely 
to attract many volunteers.

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx mailing list