点赞
评论
收藏
分享
举报
nginx 1万高并发配置
发表于2020-08-28 10:26

浏览 1.2k

系统层优化
系统 socket 层优化
echo 65535 > /proc/sys/net/core/somaxconn   准许最大链接数
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle  快速回收链接
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse     重用链接
echo 0 > /proc/sys/net/ipv4/tcp_syncookies   关闭洪水抵御
系统文件层优化
ulimit -n 65535

nginx 配置层优化
nginx socket层优化 
worker_connections  10240;
nginx 层打开文件数优化
worker_rlimit_nofile 20000;

ab -n 500000 -c 20000  http://192.168.1.52/index.html
Server Software:        nginx/1.10.2
Server Hostname:        192.168.1.52
Server Port:            80

Document Path:          /index.html
Document Length:        3698 bytes

Concurrency Level:      10000
Time taken for tests:   50.253 seconds
Complete requests:      500000
Failed requests:        0
Write errors:           0
Total transferred:      1986528972 bytes
HTML transferred:       1868307258 bytes
Requests per second:    9949.62 [#/sec] (mean)
Time per request:       1005.064 [ms] (mean)
Time per request:       0.101 [ms] (mean, across all concurrent requests)
Transfer rate:          38603.91 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  450 101.8    448    1408
Processing:   153  543 199.3    510    2093
Waiting:        0  400 181.5    361    2016
Total:        475  993 173.4    971    2382

Percentage of the requests served within a certain time (ms)
  50%    971
  66%    997
  75%   1015
  80%   1030
  90%   1086
  95%   1156
  98%   1540
  99%   1922
 100%   2382 (longest request)

硬件配置 vm i5 4核 1G内存

已修改于2023-03-06 02:25
创作不易,留下一份鼓励
守望

暂无个人介绍

关注



写下您的评论
发表评论
全部评论(0)

按点赞数排序

按时间排序

关于作者
守望
这家伙很懒还未留下介绍~
89
文章
0
问答
17
粉丝
相关文章
目录一、安装1.1yum安装1.2编译安装二、配置文件详解三、相关配置实例3.1、站点基本配置3.2、root与alias3.3、location的匹配规则3.4、Nginx四层访问控制3.5、Nginx账户认证功能3.6、自定义错误页面3.7、自定义访问日志3.8、检测文件是否存在3.9、长连接配置3.10、作为下载服务器配置3.11、作为上传服务器3.12、隐藏NginxServer版本信息3.13、其它配置项四、高级应用4.1、状态页配置4.2、变量使用4.3、压缩功能4.4、https配置4.5、关于favicon.ico4.6、rewrite指令4.7、代理功能4.8、负载均衡4.9、FastCGI配置五、系统参数优化正文一、安装1.1yum安装(1)配置好yum源与epel源#本地光盘yum源 [development] name=dvdbaserepo baseurl=file:///mnt/cdrom/ enabled=1 gpgcheck=1 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7 #
点赞 5
浏览 8.9k
服务器配置:系统:windows server 2019cpu:Intel(R) Xeon(R) CPU E5-2696 v4 @ 2.20GHz * 2内存:88GB磁盘:180TB带宽:200MB
点赞 0
浏览 1.2k
【版本更新】NGINX Ingress Controller 版本更新到 3.4.2,新版本现已支持 NGINX Plus R31, Helm Chart 也已更新到了 3.4.2 最新版本。访问 NGINX 中文官方开源社区(nginx.org.cn)了解详情。
点赞 2
浏览 623