linux - Memory leak not cleared when I reload NGINX, but only on restart -


i using nginx version 1.2.5. under load serving requests, encountered memory loss. found 3 memory leaks fixed in code inherited. leaks in response handling code memory not freed if ngx_again encountered due ssl pressure.

however, prompted curious situation when memory leak happening. typically reload nginx on regular basis grab new configuration posted on hourly basis. have 1 master , 4 workers. when memory leak happening, , memory depleted on linux box, reload fail @ end of 2 days since there wasn't enough memory left start new worker , remove old one. understand, confuses me, why on every reload, since old worker removed, memory leak wouldn't masked since process removed , memory should have been returned linux. when perform nginx restart, return leaked memory. difference gather on restart master worker brought down. isn't every worker running own memory scope?

can explain me how memory handled differently in reload versus restart can explain behavior?

thank you.

here more information got, maybe can light.

i perform service nginx start

sh-4.1# service nginx status nginx (pid 19610 19609 19608 19607 19593) running... sh-4.1# ps -ef | grep nginx root 19593 1 7 16:24 ? 00:00:04 nginx: master process /usr/local/bin/nginx -c /etc/nginx/nginx.conf nobody 19607 19593 0 16:24 ? 00:00:00 nginx: worker process nobody 19608 19593 0 16:24 ? 00:00:00 nginx: worker process nobody 19609 19593 0 16:24 ? 00:00:00 nginx: worker process nobody 19610 19593 0 16:24 ? 00:00:00 nginx: worker process root 19653 19083 0 16:25 pts/1 00:00:00 grep nginx sh-4.1#

in logs, print out pid memory allocator initialized:

sh-4.1# grep 19571 * error.log:2014-06-04 16:24:36.535 +0000 [error] ngx_http_url_filtering_init(cloud_addons/ngx_http_url_filtering_module.c:603): allocating allocator: pid of process: 19571

i looked 19571 ands not exist anymore. reran , monitored processes , discovered 19571 nginx coming before master:

root 19571 19570 88 16:41 pts/1 00:00:01 /usr/local/bin/nginx -c /etc/nginx/nginx.conf

if issue reload:

service nginx reload

error.log:2014-06-04 16:27:36.103 +0000 [error] ngx_http_url_filtering_init(cloud_addons/ngx_http_url_filtering_module.c:603): allocating allocator: pid of process: 19593

this master allocating new allocator.

when issue service nginx stop, similar restart:

error.log:2014-06-04 16:31:59.682 +0000 [error] ngx_http_url_filtering_exit(cloud_addons/ngx_http_url_filtering_module.c:680): dellocating allocator: pid of process: 19593


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -