简单的用 h2load测试了nuster和nginx的http/2下的缓存性能,结果显示RPS(每秒请求数)nuster差不多是nginx的3倍

https://github.com/jiangwenyu...

data size CONN nuster nginx
12(hello world) 1000 338924 110419

测试环境

服务器

两台linux服务器:一台测试服务器server129, 一台缓存服务器server130.

Server port app
10.0.0.129 wrk
10.0.0.129 8080 nginx, origin web server
10.0.0.130 8081 nuster, all cores
10.0.0.130 8083 nginx, all cores

硬件

  • Intel(R) Xeon(R) CPU X5650 @ 2.67GHz(12 cores)
  • RAM 32GB
  • 1Gbps ethernet card

软件

  • CentOS: 7.4.1708 (Core)
  • h2load: nghttp2/1.30.0
  • nginx: nginx/1.14.0
  • nuster: nuster/1.8.8.2

系统设置

/etc/sysctl.conf

fs.file-max                    = 9999999
fs.nr_open                     = 9999999
net.core.netdev_max_backlog    = 4096
net.core.rmem_max              = 16777216
net.core.somaxconn             = 65535
net.core.wmem_max              = 16777216
net.ipv4.ip_forward            = 0
net.ipv4.ip_local_port_range   = 1025       65535
net.ipv4.tcp_fin_timeout       = 30
net.ipv4.tcp_keepalive_time    = 30
net.ipv4.tcp_max_syn_backlog   = 20480
net.ipv4.tcp_max_tw_buckets    = 400000
net.ipv4.tcp_no_metrics_save   = 1
net.ipv4.tcp_syn_retries       = 2
net.ipv4.tcp_synack_retries    = 2
net.ipv4.tcp_tw_recycle        = 1
net.ipv4.tcp_tw_reuse          = 1
net.ipv4.tcp_timestamps        = 1
vm.min_free_kbytes             = 65536
vm.overcommit_memory           = 1

/etc/security/limits.conf

* soft nofile 1000000
* hard nofile 1000000
* soft nproc  1000000
* hard nproc  1000000

配置文件

nuster, all cores

globalmaxconn 1000000nuster cache on data-size 1gdaemonnbproc 12tune.maxaccept -1tune.ssl.default-dh-param 2048tune.h2.max-concurrent-streams 1000
defaultsretries 3maxconn 1000000option redispatchoption dontlognulltimeout client  300stimeout connect 300stimeout server  300shttp-reuse always
frontend web1bind *:8081 ssl crt asdf.pem alpn h2,http/1.1mode httpdefault_backend app1
backend app1balance roundrobinmode httpnuster cache onnuster rule all ttl 0server a2 10.0.0.129:8080

nginx, all cores

user  nginx;
worker_processes  auto;
worker_rlimit_nofile 1000000;
error_log  /var/log/nginx/errorall.log warn;
pid        /var/run/nginxall.pid;
events {worker_connections  1000000;use epoll;multi_accept on;
}
http {include                     /etc/nginx/mime.types;default_type                application/octet-stream;access_log                  off;sendfile                    on;server_tokens               off;keepalive_timeout           300;keepalive_requests          100000;tcp_nopush                  on;tcp_nodelay                 on;client_body_buffer_size     128k;client_header_buffer_size   1m;large_client_header_buffers 4 4k;output_buffers              1 32k;postpone_output             1460;open_file_cache             max=200000 inactive=20s;open_file_cache_valid       30s;open_file_cache_min_uses    2;open_file_cache_errors      on;proxy_cache_path /tmp/cache_all levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;server {listen 8083 ssl http2;ssl on;ssl_session_cache shared:SSL:5m;ssl_session_timeout 1h;http2_max_concurrent_streams 1000;http2_max_requests 10000000;ssl_certificate     a.pem;ssl_certificate_key a.key;location / {proxy_pass        http://10.0.0.129:8080/;proxy_cache       STATIC;proxy_cache_valid any 1d;}}
}

测试

nuster

$ h2load -n 10000000 -c 1000 -m 1000 -t 1000 https://10.0.0.130:8081/helloworldfinished in 29.51s, 338924.15 req/s, 48.81MB/s
requests: 10000000 total, 10000000 started, 10000000 done, 10000000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 10000000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 1.41GB (1510024000) total, 1.13GB (1210000000) headers (space savings 34.24%), 114.44MB (120000000) datamin         max         mean         sd        +/- sd
time for request:    14.51ms       3.21s       2.53s    500.02ms    74.50%
time for connect:    61.12ms       1.26s    672.73ms    332.30ms    63.50%
time to 1st byte:    95.03ms       3.74s       2.68s    777.51ms    74.00%
req/s           :     339.11      459.68      358.92       17.35    76.20%

nginx

$ h2load -n 10000000 -c 1000 -m 1000 -t 1000 https://10.0.0.130:8083/helloworldfinished in 90.56s, 110419.16 req/s, 15.62MB/s
requests: 10000000 total, 10000000 started, 10000000 done, 10000000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 10000000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 1.38GB (1482955210) total, 1.10GB (1182906210) headers (space savings 35.01%), 114.44MB (120000000) datamin         max         mean         sd        +/- sd
time for request:     3.98ms      14.65s       5.14s       3.67s    70.30%
time for connect:    69.96ms       6.74s       1.35s       1.08s    88.90%
time to 1st byte:   114.92ms      15.46s       5.67s       4.06s    63.40%
req/s           :     110.43     5143.28      378.40      590.47    92.50%

web 缓存服务器 HTTP2 性能测试: nuster vs nginx相关推荐

  1. web缓存服务器性能比较 nuster vs nginx vs varnish

    简单比较了web缓存服务器nuster, nginx和varnish的缓存性能,结果显示nuster的RPS(每秒请求数)单进程模式下大概是nginx的3倍,多进程下是nginx的2倍,varnish ...

  2. 将nginx同时作为负载均衡和Web缓存服务器

    Nginx从0.7.48版本开始,支持了类似Squid的缓存功能.这个缓存是把URL及相关组合当作Key,用md5编码哈希后保存在硬盘上,所以它可以支持任意URL链接,同时也支持404/301/302 ...

  3. nginx 作为Web缓存服务器

    [实验环境] 系统:Centos6.4 IP: 192.168.56.120 设置服务器的文件描述符 如果后面配置nginx的时候,需要调大worker_connections 这个参数,则需要对系统 ...

  4. 案例:Nginx作为Web缓存服务器应用

    从0.7.48版本开始,nginx支持类似Squid的缓存功能.nginx的Web缓存服务主要由proxy_cache相关命令集和fastcgi_cache相关命令集构成,前者用于反向代理时对后端内容 ...

  5. ROS 软路由配合squid WEB缓存服务器中实现行为管理

    公司使用的ROS 软路由 和Cisco 交换机,划分的Vlan网络,路由器是ROS,在部署行为管理时,只能用端口镜像,但效果,表现比较一般,不能过滤内容,且公司终端数据比较多,网络出口压力日渐增大,需 ...

  6. Nginx的Web缓存服务及清除缓存

    这一篇记录一下Nginx作为Web服务器缓存,减少对应用服务器请求次数 ,各位看到此博客的小伙伴,如有不对的地方请及时通过私信我或者评论此博客的方式指出,以免误人子弟.多谢! Nginx作为Web缓存 ...

  7. 五、cookie和web缓存

    一.cookie 因为HTTP是无状态的,但是网站希望可以识别用户和与用户交互的内容,因此,大多数网站都用了cookie来跟踪用户,来管理用户的状态.示意图如下 cookie有四个部分组成:1.HTT ...

  8. 面向站长和网站管理员的Web缓存加速指南

    2019独角兽企业重金招聘Python工程师标准>>> 原文(英文)地址: http://www.mnot.net/cache_docs/  版权声明:署名-非商业性使用-禁止演绎 ...

  9. 研究员发现70个web缓存投毒漏洞,获奖4万美元

     聚焦源代码安全,网罗国内外最新资讯! 编译:代码卫士 虽然web 缓存投毒漏洞为人熟知,但仍然会突然出现在网络.安全研究员 Iustin Ladunca (Youstin) 对很多网站展开大规模研究 ...

最新文章

  1. python乘法口诀代码-浅析一句python代码成生九九乘法表
  2. 提高数据中心空间使用率,助力数字新基建
  3. python中执行sql语句_Python执行sql语句
  4. shell脚本spawn_如何使用child_process.spawn将Python / Ruby / PHP Shell脚本与Node.js集成
  5. C语言学习及项目开发所遇问题总集(一)---Mr.Zhang
  6. ubuntu 20.04双系统安装_win10上跑Ubuntu不用虚拟机不用双系统!
  7. python图像数据是几维数据_python实现读取类别频数数据画水平条形图案例
  8. vm虚拟机修改物理时间_GPU虚拟机创建时间深度优化
  9. 【联合路由频谱分配】多跳认知无线电网络中的联合路由和动态频谱分配的matlab仿真与分析
  10. C语言文本输入中文乱码问题
  11. sqlnet.ora
  12. 01-选择属于自己的相机
  13. wordcloud:利用fontawesome字体绘制图标词云图
  14. USA gov data from Bitly
  15. Pycharm中用Appium框架编写第一个自动化脚本
  16. 移动端高清、多屏幕适配方案
  17. 一种时空无监督的事故检测方法
  18. python 工业软件开发_记一次工业软件开发经历
  19. JDK9下载、安装和配置环境变量图解
  20. debian armhf mysql_Debian for ARM

热门文章

  1. CSS布局中应用BFC的例子
  2. [转]bss,data,rodata,text
  3. 巧用ftp命令(一)--利用ftp分发ssh密钥
  4. Google金山词霸体验小记
  5. [流媒体]Android 播放HLS/RTSP的原生类库 MediaPlayer
  6. Windows下Apache架站务实
  7. 你是否理解js的Object与Function与原型链
  8. thinkphp5部署于Linux中nginx多站点解决方案
  9. (转)【重磅】无监督学习生成式对抗网络突破,OpenAI 5大项目落地
  10. 用Angular制作单页应用视图切换动画