天天看点

web缓存服务器性能比较 nuster vs nginx vs varnish测试环境系统参数配置文件检查http头大小Benchmark结果Raw output

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

<code>/helloworld</code> url包含 <code>hello world</code>文字的结果.

data size

CONN

nuster, 1core

nuster, 12cores

nginx, 1core

nginx, 12cores

varnish

12(hello world)

1000

95359

357013

33454

214217

133094

两台linux服务器, server129装有origin web server,

cache服务器nuster/nginx/varnish 装在 server130.

Server

port

app

10.0.0.129

wrk

8080

nginx, origin web server

10.0.0.130

nuster, 1 core

8081

nuster, all cores, private cache

8082

nginx, 1 core

8083

nginx, all cores

8084

varnish, all cores

origin web server: set <code>server_tokens off;</code> to make http header <code>server</code> same.

Intel(R) Xeon(R) CPU X5650 @ 2.67GHz(12 cores)

RAM 32GB

1Gbps ethernet card

CentOS: 7.4.1708 (Core)

wrk: 4.0.2-2-g91655b5

varnish: (varnish-4.1.8 revision d266ac5c6)

nginx: nginx/1.12.2

nuster: nuster/1.7.9.1

所有http头都是一样的

Note that HAProxy removes <code>Connection: Keep-Alive</code> header when its <code>HTTP/1.1</code>

while nginx/varnish do not, so I added <code>Connectio1: keep-aliv1</code> to make the size same.

See nuster config file above

64bytes

93667

305103

33383

215343

124683

128bytes

84304

265004

36143

215078

128820

256bytes

93123

206207

35372

209608

132182

512bytes

88505

146042

36898

146537

129780

1k bytes

89328

90866

36034

91497

87772

1 core

没有用满所有带宽

nuster 差不多是 nginx的3倍

12 cores

没沾满前nuster是nginx的2倍,varnish的3倍

沾满时基本差不多

I did the test again with <code>wrk</code> on server130 using 127.0.0.1 since I do not have a 10Gbps network

75655

212769

30996

136844

115928

76425

206016

30724

136409

108380

76389

205109

30931

135853

107382

73539

198264

30797

135899

107158

74279

202554

30839

135819

107200

70507

174769

30823

134808

109379

5000

51561

185230

ERROR

125309

111711

49981

180164

125238

108115

50603

178029

125181

107825

49655

172111

125268

106837

50629

176659

125118

108167

51007

150375

125323

107596

nuster is almost 2 times faster than nginx and varnish

error occurs with nginx-1core when the connections is 5000