新 vps 上的高内存使用率 nginx(反向代理)
High memory usage nginx (reverse proxy) on new vps
我最近设置了一个新的 vps (Cent OS7),带有 custombuild 2.0,带有 nginx 反向代理的 Apache 2.4,php-fpm 5.6(和 7),mpm worker,MariaDB 10.1, mod_security 和 csf.
出于某种原因,Nginx 使用 675mb 内存 (http://prntscr.com/91bu6t),服务器上只有 1 (1mb) 个网站和 1 个主要由图片组成的轻型 (300mb) 网站。
当我重新启动 nginx 时,一段时间后内存使用量仍然约为 175mb,再次回到 +/- 675mb。
我认为这不正常。配置文件似乎没问题。
我在 nginx 日志中看不到太多,除了这些行返回:
2015/11/10 21:20:41 [notice] 24971#0: ModSecurity for nginx
(STABLE)/2.9.0 (http://www.modsecurity.org/) configured. 2015/11/10
21:20:41 [notice] 24971#0: ModSecurity: APR compiled version="1.5.2";
loaded version="1.5.2" 2015/11/10 21:20:41 [notice] 24971#0:
ModSecurity: PCRE compiled version="8.20 "; loaded version="8.20
2011-10-21" 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: LIBXML
compiled version="2.9.2" 2015/11/10 21:20:41 [notice] 24971#0:
ModSecurity: Status engine is currently disabled, enable it by set
SecStatusEngine to On.
这些行是否表示存在问题? (Google 并没有让我变得更聪明..)
主要是,为什么服务器上的 nginx 内存使用率如此之高?怎么办?
谢谢!
仅根据管理面板的输出很难判断,但可能是服务器/nginx 正在缓存大量内存以提高性能。如果您有 shell 访问权限,则可以使用 top
命令等查看更多详细信息。
如果缓存是这种情况,那没有任何问题,它只是优化了内存使用与磁盘使用。
我最近设置了一个新的 vps (Cent OS7),带有 custombuild 2.0,带有 nginx 反向代理的 Apache 2.4,php-fpm 5.6(和 7),mpm worker,MariaDB 10.1, mod_security 和 csf.
出于某种原因,Nginx 使用 675mb 内存 (http://prntscr.com/91bu6t),服务器上只有 1 (1mb) 个网站和 1 个主要由图片组成的轻型 (300mb) 网站。 当我重新启动 nginx 时,一段时间后内存使用量仍然约为 175mb,再次回到 +/- 675mb。 我认为这不正常。配置文件似乎没问题。 我在 nginx 日志中看不到太多,除了这些行返回:
2015/11/10 21:20:41 [notice] 24971#0: ModSecurity for nginx (STABLE)/2.9.0 (http://www.modsecurity.org/) configured. 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: APR compiled version="1.5.2"; loaded version="1.5.2" 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: PCRE compiled version="8.20 "; loaded version="8.20 2011-10-21" 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: LIBXML compiled version="2.9.2" 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On.
这些行是否表示存在问题? (Google 并没有让我变得更聪明..)
主要是,为什么服务器上的 nginx 内存使用率如此之高?怎么办?
谢谢!
仅根据管理面板的输出很难判断,但可能是服务器/nginx 正在缓存大量内存以提高性能。如果您有 shell 访问权限,则可以使用 top
命令等查看更多详细信息。
如果缓存是这种情况,那没有任何问题,它只是优化了内存使用与磁盘使用。