Skip to content

ngx_memory_leak_killer can graceful restart a working process that exceeds the upper limit of memory usage.

License

Notifications You must be signed in to change notification settings

chikuwait/ngx_memory_leak_killer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

ngx_memory_leak_killer

ngx_memory_leak_killer can graceful restart a working process that exceeds the upper limit of memory usage. Thanks to nginx-hello-world-module and ngx_bumpylife.

Configuration

  • Enable "memory_leak_killer"
  • Set the upper limit of memory usage in kilobytes
http {
    memory_leak_killer on;
    memory_leak_killer_limit 5000; #5MB
    ...
}

Install

  • use nginx configure option
./configure --add-module=/path/to/ngx_memory_leak_killer

Example

$ ./work/sbin/nginx

$ ps auwxf |grep nginx
ubuntu   23505  0.0  0.0  16464   384 ?        Ss   08:46   0:00 nginx: master process ./work/sbin/nginx
ubuntu   23506  0.0  0.0  16908  1936 ?        S    08:46   0:00  \_ nginx: worker process

$ curl localhost:8080/memory
leak memory(+2MB)

$ ps auwxf |grep nginx
ubuntu   23505  0.0  0.0  16464   384 ?        Ss   08:46   0:00 nginx: master process ./work/sbin/nginx
ubuntu   23506  0.0  0.0  18864  4744 ?        S    08:46   0:00  \_ nginx: worker process

$ curl localhost:8080/memory
leak memory(+2MB)

$ ps auwxf |grep nginx
ubuntu   23505  0.0  0.0  16464   384 ?        Ss   08:46   0:00 nginx: master process ./work/sbin/nginx
ubuntu   23506  0.0  0.0  20820  6640 ?        S    08:46   0:00  \_ nginx: worker process

$ curl localhost:8080/memory
leak memory(+2MB)

$ ps auwxf |grep nginx
ubuntu   23505  0.0  0.0  16464   384 ?        Ss   08:46   0:00 nginx: master process ./work/sbin/nginx
ubuntu   23519  0.0  0.0  16908  1936 ?        S    08:46   0:00  \_ nginx: worker process





LICENSE

See LICENSE.

About

ngx_memory_leak_killer can graceful restart a working process that exceeds the upper limit of memory usage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published