当前位置: 首页 > Linux

Web缓存服务器HTTP2性能测试:nustervsnginx

时间:2023-04-06 20:12:53 Linux

简单使用h2load测试http/2下nuster和nginx的缓存性能,结果显示nuster的RPS(requestspersecond)几乎是nginx的三倍https://github.com/jiangwenyu...数据大小CONNnusternginx12(helloworld)1000338924110419测试环境服务器两台linux服务器:一台测试服务器server129,一台缓存服务器server130.Serverportapp10.0.0.129wrk10.0.0.1298080nginx,originwebserver10.0.0.1308081nuster,allcores10.0.0.83nginx80all硬件Intel(R)Xeon(R)CPUX5650@2.67GHz(12核)RAM32GB1Gbps以太网卡软件CentOS:7.4.1708(核心)h2load:nghttp2/1.30.0nginx:nginx/1.14.0nuster:nuster/1.8。8.2系统设置/etc/sysctl.confs.file-max=9999999fs.nr_open=9999999net.core.netdev_max_backlog=4096net.core.rmem_max=16777216net.core.somaxconn=65535net.core.wmem_max=16777216net.ipforward=0ipv4.ip_local_local_=102565535net.ipv4.tcp_fin_timeout=30net.ipv4.tcp_keepalive_time=30net.ipv4.tcp_max_syn_backlog=20480net.ipv4.tcp_max_tw_buckets=400000net.ipv4.tcp_no_metrics_save=1net.ipv4.tcp_syn_retries=2net.ipv4.tcp_synack_retries=2net.ipv4.tcp_tw_recycle=1net.ipv4.tcp_tw_reuse=1net.ipv4.tcp_timestamps=1vm.min_free_kbytes=65536vm.overcommit_memory=1/etc/security/limits.conf*softnofile1000000*hardnofile1000000*softnproc1000000*hardnproc1000000配置文件nuster,allcoresglobalmaxconn1000000nustercacheondata-size1gdaemonnbproc12tune.maxaccept-1tune.ssl.default-dh-param2048tune.h2.max-concurrent-streams1000defaultsretries3maxconn1000000optionredispatchoptiondontlognulltimeoutclient300stimeoutconnect300s超时服务器300shttp-reusealwaysfrontendweb1bind*:8081sslcrtasdf.pemalpnh2,http/1.1模式httpdefault_backendapp1backendapp1balanceroundrobin模式httpnustercacheonnuster规则所有ttl0服务器a210.0.0.129:8080nginx,所有coresusernginx;worker_processesauto;worker_rlimit_nofile1000000;error_log/var/log/nginx/errorall.logwarn;pid/var/run/nginxall.pid;events{worker_connections1000000;使用epoll;multi_accepton;}http{include/etc/nginx/mime.types;default_type应用程序/八位字节流;access_log关闭;发送文件;服务器令牌关闭;keepalive_timeout300;keepalive_requests100000;tcp_nopush上;tcp_nodelayon;client_body_buffer_size128k;client_header_buffer_size1m;large_client_header_buffers44k;输出缓冲区132k;推迟输出1460;open_file_cachemax=200000inactive=20s;open_file_cache_valid30s;open_file_cache_min_uses2;open_file_cache_errors开启;代理缓存_path/tmp/cache_alllevels=1:2keys_zone=STATIC:10minactive=24hmax_size=1g;服务器{听8083sslhttp2;SSL开启;ssl_session_cache共享:SSL:5m;ssl_session_timeout1h;http2_max_concurrent_streams1000;http2_max_requests10000000;ssl_certificatea.pem;ssl_certificate_keya.key;位置/{proxy_passhttp://10.0.0.129:8080/;代理缓存静态;proxy_cache_valid任意1d;}}}测试nuster$h2load-n10000000-c1000-m1000-t1000https://10.0.0.130:8081/helloworld在29.51秒内完成,338924.15请求/秒,48.81MB/请求:总计10000000,开始100,00010000000次完成,10000000次成功,0次失败,0次错误,0次超时状态代码:100000002xx、03xx、04xx、05xx流量:总计1.41GB(1510024000),1.13GB(1210000000)标头(节省空间%),44.244(120000000)dataminmaxmeansd+/-sdtimeforrequest:14.51ms3.21s2.53s500.02ms74.50%timeforconnect:61.12ms1.26s672.73ms332.30ms63.50%timeto1stbyte:95.03ms3.74s2.68s777.51ms74.00%req/s:339.11459.68358.9217.3576.20%nginx$h2load-n10000000-c1000-m1000-t1000https://10.0.0.130:8083/helloworld在90.56秒内完成,110419.16请求/秒,15.62MB/s请求:总计10000000,10000000成功,10000000完成,00失败,0个错误,0个超时状态代码:100000002xx、03xx、04xx、05xx流量:总计1.38GB(1482955210),1.10GB(1182906210)标头(节省空间35.01%),114.44MB(120000000)数据最小值最大值sd+/-请求的sdtime:3.98ms14.65s5.14s3.67s70.30%连接时间:69.96ms6.74s1.35s1.08s88.90%到第一个字节的时间:114.92ms15.46s5.67s4.06s63.40%请求/秒:110.435143.28378.40590.4792.50%

猜你喜欢