减少 Rails 乘客线程数

减少 Rails 乘客线程数

我的主机帐户限制为 300 个进程。当我打开我的铁路应用程序时,它立即占用了 100 个进程。有人知道如何减少“乘客核心”和乘客进程数吗?

这是我的 nginx 配置:

env GEM_HOME=/home/user/gems;
worker_processes  1;

events {
    worker_connections  256;        # default 1024
}

http {
    access_log  /home/user/logs/user/access_myapp.log  combined;
    error_log   /home/user/logs/user/error_myapp.log   crit;

    include         mime.types;
    passenger_root  /home/user/gems/gems/passenger-5.0.30;
    passenger_ruby  /home/user/bin/ruby;
    sendfile        on;

    passenger_max_instances_per_app  1;
    rails_spawn_method               conservative;
    passenger_max_pool_size 1;      # default 2

    server {
        listen             xxx;
        passenger_enabled  on;
        root               /home/user/myapp/public;
        server_name        localhost;
        rails_env          production;

        location ~* ^/assets/ {
            gzip_static on;
            expires max;
            add_header Cache-Control public;

            add_header Last-Modified "";
            add_header ETag "";
            break;
        }

    }
}

这是 ps 列表的输出:http://pastebin.com/0DcrmxC4

谢谢

相关内容