我为一家运行依赖于httpd +乘客的红宝石应用程序的公司工作。
我注意到如果ruby应用程序中存在内存泄漏,Linux OOM管理器将永远不会终止使用所有内存的乘客进程,因为Passenger Core进程将其oom_adj值更改为-17(禁用)从中分出的杀戮过程。
我已经确认httpd与oom_adj == 0
一起运行,但是从httpd运行的乘客核心以oom_adj == -17
运行。我现在已经多次为乘客阅读配置文档,但找不到允许我将值更改回0的配置选项。
Passenger核心运行的是oom_adj -17故意,还是我发现了一个bug?
还有办法配置Phusion Passenger运行所需的oom_adj值吗?
sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2018-04-24 21:37:12 UTC; 26s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 31269 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 31280 (httpd)
Status: "Total requests: 4; Current requests/sec: 0.3; Current traffic: 1.2KB/sec"
CGroup: /system.slice/httpd.service
├─31280 /usr/sbin/httpd -DFOREGROUND
├─31307 Passenger watchdog
├─31310 Passenger core
├─31330 /usr/sbin/httpd -DFOREGROUND
├─31331 /usr/sbin/httpd -DFOREGROUND
├─31332 /usr/sbin/httpd -DFOREGROUND
├─31333 /usr/sbin/httpd -DFOREGROUND
├─31334 /usr/sbin/httpd -DFOREGROUND
├─31345 Passenger AppPreloader: /srv/websites/{{ domain }}/current
├─31415 /usr/sbin/httpd -DFOREGROUND
├─31434 Passenger RubyApp: /srv/websites/{{ domain }}/current (production)
├─31444 Passenger RubyApp: /srv/websites/{{ domain }}/current (production)
├─31458 Passenger RubyApp: /srv/websites/{{ domain }}/current (production)
└─31515 Passenger RubyApp: /srv/websites/{{ domain }}/current (production)
cat /proc/31280/oom_adj
0
cat /proc/31310/oom_adj
-17
cat /proc/31434/oom_adj
-17