高性能 Web 缓存服务器 nuster 1.7.9.4 发布

2018-02-05 08:35:33 +08:00
 sajesemuy

nuster 1.7.9.4 已发布,本次更新主要修复了一个 url 中?位置不一样而 key 一样的 bug。

nuster 是一个基于 HAProxy 的高性能缓存服务器。nuster 完全兼容 HAProxy,并且利用 HAProxy 的 ACL 功能来提供非常细致的缓存规则。特性包括

性能:

非常快, 单进程模式下是 nginx 的 3 倍,多进程下 nginx 的 2 倍,varnish 的 3 倍。详见性能比较

本次更新

3708 次点击
所在节点    分享创造
19 条回复
est
2018-02-05 09:07:00 +08:00
nginx 没开启 proxy 的 http/1.1。。。性能很低。。。。
shuizhengqi
2018-02-05 09:44:54 +08:00
...这 是当成 了发布平台吗
sajesemuy
2018-02-05 10:11:49 +08:00
@est 没开启 proxy 是指?
sajesemuy
2018-02-05 10:12:11 +08:00
@shuizhengqi 不好意思,请多担待:)
suconghou
2018-02-05 10:17:59 +08:00
@sajesemuy 你没发现 release 的代码编译后,-v 查看 版本写的还是老版本吗
sajesemuy
2018-02-05 10:21:59 +08:00
@suconghou 感谢
est
2018-02-05 10:43:19 +08:00
@sajesemuy

proxy_http_version 1.1;
proxy_set_header Connection "";
sajesemuy
2018-02-05 10:56:57 +08:00
@est 这个是设置 nginx 和 upstream 的,因为 cache 已经在 nginx 里,所以并不会有区别。
nginx 和客户端之间是 1.1,keep-alive。
est
2018-02-05 11:22:40 +08:00
@sajesemuy 你先改下试试呢?
sajesemuy
2018-02-05 11:45:14 +08:00
@est 不需要啊,这个参数就是这个意思
sajesemuy
2018-02-05 11:55:10 +08:00
好吧,实践检验一下

不设置
=======
```
#proxy_http_version 1.1;
#proxy_set_header Connection "";
```
curl -i http://10.0.10.13:8083/INSTALL
```
HTTP/1.1 200 OK
Server: nginx
Connection: keep-alive
```
可见 nginx 发给后端的请求为 http1.0
```
10.0.10.13 - - [05/Feb/2018:12:50:18 JST] "GET /INSTALL HTTP/1.0" 200 916
- -> /INSTALL
```
设置
===
```
proxy_http_version 1.1;
proxy_set_header Connection "";
```
nginx 发给后端的请求为 http1.1
```
10.0.10.13 - - [05/Feb/2018:12:51:14 JST] "GET /INSTALL HTTP/1.1" 200 916
- -> /INSTALL
```
wrk 比较
======
```
wrk -c 1000 -d 30 -t 100 http://10.0.10.13:8083/INSTALL
Running 30s test @ http://10.0.10.13:8083/INSTALL
100 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.34ms 10.90ms 225.76ms 92.30%
Req/Sec 1.04k 446.52 6.22k 61.21%
3069181 requests in 30.10s, 3.28GB read
Requests/sec: 101967.40
Transfer/sec: 111.44MB

wrk -c 1000 -d 30 -t 100 http://10.0.10.13:8083/INSTALL
Running 30s test @ http://10.0.10.13:8083/INSTALL
100 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 12.97ms 15.53ms 363.39ms 90.47%
Req/Sec 1.06k 614.42 14.93k 63.68%
3042735 requests in 30.10s, 3.25GB read
Requests/sec: 101089.02
Transfer/sec: 110.48MB
```

可见并无明显差别
est
2018-02-05 11:55:54 +08:00
@sajesemuy 赞实践!
sajesemuy
2018-02-05 11:56:51 +08:00
@est 见上一条:)

回复不能用 markdown 么^^
Showfom
2018-02-05 14:42:40 +08:00
@sajesemuy 不能
yytsjq
2018-02-05 14:57:43 +08:00
不知道楼主对比测试过 OpenResty 的 srcache 缓存模块吗?

我现在用的是 srcache+lua-resty-redis+redis 做的 WordPress 页面缓存

https://github.com/openresty/srcache-nginx-module
https://github.com/openresty/lua-resty-redis
sajesemuy
2018-02-05 15:21:13 +08:00
@Showfom 什么不能
sajesemuy
2018-02-05 15:28:55 +08:00
@yytsjq 没有测试过,srcache 是存在外部 memcache 或者 redis,应该会有消耗。我是内置了一个性能差不多和 redis 相当的 hashtable,估计会比 srcache 快。
sajesemuy
2018-02-05 15:29:20 +08:00
@Showfom 哦,markdown 啊,谢谢:)
sajesemuy
2018-02-05 19:53:17 +08:00
@yytsjq 做了一下测试,性能上 nuster 是 srcache+memcached 的三倍

测试环境,软件硬件,内核参数,配置文件见
https://www.v2ex.com/t/427703
或者
https://github.com/jiangwenyuan/nuster/wiki/Performance-benchmark:-nuster-vs-nginx-vs-varnish

srcache 的配置和官网一致。


openresty+srcache 结果

wrk -c 1000 -d 30 -t 100 http://10.0.10.13:8083/helloworld
Running 30s test @ http://10.0.10.13:8083/helloworld
100 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 9.52ms 8.42ms 239.68ms 85.90%
Req/Sec 1.24k 152.67 2.72k 71.13%
3725352 requests in 30.10s, 859.77MB read
Requests/sec: 123765.07
Transfer/sec: 28.56MB


nuster 结果

wrk -c 1000 -d 30 -t 100 http://10.0.10.13:8081/helloworld
Running 30s test @ http://10.0.10.13:8081/helloworld
100 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.33ms 1.95ms 205.90ms 79.42%
Req/Sec 3.04k 330.76 5.29k 69.99%
9101575 requests in 30.10s, 2.09GB read
Requests/sec: 302383.66
Transfer/sec: 71.23MB

nuster 的 RPS 差不多是 openresty+srcache 的三倍

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/428475

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX