nginx和php-fpm配置优化

php-fpm:
1. 多pool
2. pm = dynamic/static
     pm.max_children = 300
     pm.start_servers = 20
     pm.min_spare_servers = 5
     pm.max_spare_servers = 35
3.pm.max_requests = 1000
4.rlimit_files = 1024
5.listen.backlog = 2048 和listen:/path/to/socket


nginx:
1. gzip
2. upstream和socket
3. backlog
4. fastcgi:cache和timeout
5. worker_cpu_affinity 和 worker_processes
6. worker_connections  102400; #设置单个工作进程最大连接数102400
    accept_mutex on;
    multi_accept on;
    use epoll;
7. worker_rlimit_nofile 65535;

你可能感兴趣的:(php)