dty97501 2014-12-23 05:24
浏览 340

为什么php-fpm(nginx)占用大量内存?

My server detail is in screenshot which is best dedicated server from AWS Amazon EC2. enter image description here

But one thing i notice that php-fpm take memory 10.9 GB which is 70% of total. it shouldn't be take much memory like that. am i doing some thing wrong in nginx.conf file ?

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;

}

  • 写回答

1条回答 默认 最新

  • dousao6313 2019-01-27 10:22
    关注

    One way I found to make it a little bit down, Change the value of pm = dynamic to pm=ondemand in the php-fpm config file. For php 7 the path is /etc/php-fpm.d/www.conf. Don't forget to restart php-fpm after change.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料