天天看點

web緩存伺服器性能比較 nuster vs nginx vs varnish測試環境系統參數配置檔案檢查http頭大小Benchmark結果Raw output

簡單比較了 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