Neptune 2020-01-03
vim /usr/local/nginx/conf/nginx.conf #修改 ,做负载 worker_processes 2; worker_cpu_affinity 01 10; #再重启服务 service nginx stop service nginx start #查看进程 ps aux | grep nginx
gzip on; #开启gzip压缩功能 gzip_min_length 1k; #压缩阈值 gzip_buffers 4 16k; #buffer 大小为4个16k缓冲区大小 gzip_http_version 1.1; #压缩版本 gzip_comp_level 6; #压缩比率,最小为1,处理速度快,传输速度慢, 9最大压缩比,处理速度慢,传输速度快 gzip_types text/plain application/x-javascript text/css image/jpg image/jepg image/png image/gif application/xml text/javascript application/x-http-php #application/javascript application/json; gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件,支持正则,表示ie6以下不启用gzip gzip_vary on; #选择支持very header 可以让前端的缓存服务器缓存经过gzip压缩页面
vim /usr/local/nginx/conf/nginx.conf //开启 gzip on; //在下面添加 gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 6; gzip_types text/plain application/x-javascript text/css image/jpg image/jepg image/png image/gif application/xml text/javascript application/x-http-php application/javascript application/json; gzip_disable "MSIE [1-6]\."; gzip_vary on; //重启服务 service nginx restart
vim php-fpm.conf pid = run/php-fpm.pid pm = dynamic pm.max_children=20 //static模式下空闲进程数上限,大于下面的值; pm.start_servers = 5 //动态方式默认开启的进程数,在最小和最大之间 pm.min_spare_servers = 2 //动态方式下最少空闲进程数 pm.max_spare_servers = 8 //动态方式下最大空闲进程数