b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

swf加速 nginx优化压力测试(4)

电脑杂谈  发布时间:2018-02-14 01:42:38  来源:网络整理

[root@CXW nginx-1.10.2]# vim /usr/src/nginx1.10/conf/nginx.conf

技术分享图片

[root@CXW nginx-1.10.2]# /usr/src/nginx1.10/sbin/nginx -s reload 
[root@CXW nginx-1.10.2]#  ps -aux | grep nginx | grep -v grep
root      7935  0.0  0.1  46008  1924 ?        Ss   17:24   0:00 nginx: master process nginx
www       8355  0.0  0.1  48520  2072 ?        S    17:39   0:00 nginx: worker process

Nginx运行CPU亲和力

比如4核配置

worker_processes 4;

worker_cpu_affinity0001 0010 0100 1000

比如8核配置

worker_processes 8;

worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

worker_processes最多开启8个,8个以上性能提升不会再提升了,而且稳定性变得更低,所以8个进程够用了。

Nginx最多可以打开文件数

worker_rlimit_nofile 65535;

这个指令是指当一个nginx进程打开的最多文件描述符数目,理论值应该是最多打开文件数(ulimit -n)与nginx进程数相除,但是nginx分配请求并不是那么均匀,所以最好与ulimit -n的值保持一致。

注:

文件资源限制的配置可以在/etc/security/limits.conf设置,针对root/user等各个用户或者*代表所有用户来设置。

* soft nofile 65535

* hard nofile 65535

(3)开启高效传输模式

http {
include mime.types;
default_type application/octet-stream;
……
sendfile on;
tcp_nopush on;
……

Include mime.types; //媒体类型,include只是一个在当前文件中包含另一个文件内容的指令


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-76432-4.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...