![](/img/trans.png)
[英]Is Nginx + php-fpm is suppose be much faster than Apache + mod-php
[英]why php-fpm (nginx) takes much RAM memory?
我的服務器詳細信息在屏幕截圖中,該屏幕截圖是AWS Amazon EC2的最佳專用服務器。
但是有一件事,我注意到php-fpm占用內存10.9 GB,占總數的70%。 這樣不應該占用太多內存。 我在nginx.conf文件中做錯了什么嗎?
user nginx;
worker_processes 8;
worker_rlimit_nofile 100000;
pid /var/run/nginx.pid;
events {
worker_connections 3000;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/fastcgi.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
open_file_cache max=20000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
tcp_nodelay on;
# keepalive_requests 300;
# reset_timedout_connection on;
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
gzip on;
gzip_min_length 256;
gzip_comp_level 3;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
}
我發現降低它的一種方法是,在php-fpm配置文件中將pm = dynamic的值更改為pm = ondemand。 對於php 7,路徑為/etc/php-fpm.d/www.conf。 不要忘記更改后重新啟動php-fpm。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.