Skip to content

Commit 295b49c

Browse files
committed
add test results for http pipelining
1 parent 0555f14 commit 295b49c

8 files changed

+94
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This benchmark suite aims to compare the performance of Go web frameworks. It is
88
* [go-json-rest](https://github.com/ant0ine/go-json-rest)
99
* [beego](https://github.com/astaxie/beego)
1010
* [pat](https://github.com/bmizerany/pat)
11+
* [fasthttprouter](https://github.com/buaazp/fasthttprouter)
1112
* [lion](https://github.com/celrenheit/lion)
1213
* [httptreemux](https://github.com/dimfeld/httptreemux)
1314
* [baa](https://github.com/go-baa/baa)
@@ -26,6 +27,7 @@ This benchmark suite aims to compare the performance of Go web frameworks. It is
2627
* [denco](https://github.com/naoina/denco)
2728
* [traffic](https://github.com/pilu/traffic)
2829
* [ace](https://github.com/plimble/ace)
30+
* [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing)
2931
* [go-tigertonic](https://github.com/rcrowley/go-tigertonic)
3032
* [fasthttp](https://github.com/valyala/fasthttp)
3133
* [r2router](https://github.com/vanng822/r2router)
@@ -76,11 +78,19 @@ The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in ha
7678

7779
the concurrency clients are 5000.
7880

81+
If we enable http pipelining, test result as below:
82+
83+
![](benchmark-pipelining.png)
84+
7985
## Concurrency Test
8086
In 30 ms processing time, the tets result for 100, 1000, 5000 clients is:
8187

8288
![](concurrency.png)
8389

90+
If we enable http pipelining, test result as below:
91+
92+
![](concurrency-pipelining.png)
93+
8494

8595
## Usage
8696
You should install this package first if you want to run this test.

benchmark-pipelining.png

186 KB
Loading

concurrency-pipeline.csv

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
,default,ace,beego,bone,denco,echov1,echov2standard,echov2fasthttp,fasthttp-raw,fasthttprouter,fasthttp-routing,gin,gocraftWeb,goji,gojiv2,gojsonrest,gorestful,gorilla,httprouter,httptreemux,iris,lars,lion,macaron,martini,pat,possum,r2router,tango,tiger,traffic,vulcan
2+
100,3161.13,3161.89,3161.59,3161.28,3161.50,3163.39,3163.40,3164.20,3164.02,3164.76,3164.35,3162.06,3160.37,3163.45,3163.25,3161.30,3160.10,3163.48,3161.84,3160.71,3161.42,3163.19,3163.17,3161.57,3160.05,3164.02,3160.54,3163.26,3162.24,3159.82,3162.38,3163.43
3+
1000,31146.99,31472.24,31134.50,31729.66,31824.19,31309.81,31134.10,32110.60,32465.45,32129.95,32274.55,31223.20,31267.06,31558.49,31226.64,30029.61,28710.91,30597.79,31717.97,31508.89,32368.72,31340.91,31472.64,30269.43,29192.89,31492.83,8147.84,31413.27,30676.01,31407.60,30105.54,31649.04
4+
5000,40627.33,39773.98,37526.89,41095.73,40750.56,39909.33,37495.96,47996.25,50764.31,50586.13,49330.14,40551.81,38820.33,39780.32,39356.36,35800.81,30984.00,36456.73,41081.94,40818.19,50252.25,40148.48,39965.68,34145.97,31153.06,40622.01,7470.44,40475.32,39218.17,40306.88,35275.02,39825.30

concurrency-pipelining.png

199 KB
Loading

gowebbenchmark

110 KB
Binary file not shown.

pipeline.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
init = function(args)
2+
request_uri = args[1]
3+
depth = tonumber(args[2]) or 1
4+
5+
local r = {}
6+
for i=1,depth do
7+
r[i] = wrk.format(nil, request_uri)
8+
end
9+
req = table.concat(r)
10+
end
11+
12+
request = function()
13+
return req
14+
end

processtime-pipeline.csv

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
,default,ace,beego,bone,denco,echov1,echov2standard,echov2fasthttp,fasthttp-raw,fasthttprouter,fasthttp-routing,gin,gocraftWeb,goji,gojiv2,gojsonrest,gorestful,gorilla,httprouter,httptreemux,iris,lars,lion,macaron,martini,pat,possum,r2router,tango,tiger,traffic,vulcan
2+
0 ms,56209.18,56499.11,53682.20,55969.43,56802.11,56389.74,53488.19,73539.30,81247.44,79848.91,78965.86,56511.92,53263.02,55615.37,54905.21,49133.91,40988.64,42997.39,57134.47,57125.05,80788.17,55854.34,55706.72,47648.44,44383.84,56107.85,8163.91,55135.89,54009.36,55953.30,48953.91,54731.46
3+
10 ms,41124.92,41131.96,39262.96,42268.56,42204.96,40765.24,38467.86,50117.57,53820.56,53615.32,52520.89,41183.71,40437.30,41482.08,40622.01,36607.02,31387.63,38072.55,42256.79,42187.51,52710.27,40915.90,41235.27,35365.07,31433.11,41346.92,7334.86,41115.42,40204.45,42009.34,35704.62,41958.55
4+
100 ms,36274.03,36378.16,33714.97,36119.24,36879.70,36590.27,34851.82,40737.59,43775.60,43836.07,43001.61,36819.89,35271.39,36042.02,35370.96,33061.78,29074.59,33380.61,37147.74,36548.25,42555.25,36634.58,36198.69,31623.85,29325.58,36302.92,7914.56,36446.33,34636.22,36656.70,30766.26,34853.41
5+
500 ms,9353.76,9260.53,9114.39,9071.59,8851.15,9222.46,9008.54,9463.38,9566.96,9206.27,9273.83,9061.50,9105.43,9400.36,9169.56,8552.99,8727.92,9383.51,9340.12,9414.51,9258.38,8952.44,9433.87,9223.87,9342.47,9055.95,9191.68,8906.47,9145.63,8924.63,8997.46,8634.23

test-pipelining.sh

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
server_bin_name="gowebbenchmark"
4+
5+
web_frameworks=( "default" "ace" "beego" "bone" "denco" "echov1" "echov2standard" "echov2fasthttp" "fasthttp-raw" "fasthttprouter" "fasthttp-routing" "gin" "gocraftWeb" "goji" "gojiv2" "gojsonrest" "gorestful" "gorilla" "httprouter" "httptreemux" "iris" "lars" "lion" "macaron" "martini" "pat" "possum" "r2router" "tango" "tiger" "traffic" "vulcan" )
6+
length=${#web_frameworks[@]}
7+
8+
test_result=()
9+
10+
test_web_framework()
11+
{
12+
echo "testing web framework: $2"
13+
./$server_bin_name $2 $3 &
14+
sleep 2
15+
16+
throughput=`wrk -t16 -c$4 -d30s http://127.0.0.1:8080/hello -s pipeline.lua| grep Requests/sec | awk '{print $2}'`
17+
echo "throughput: $throughput requests/second"
18+
test_result[$1]=$throughput
19+
20+
pkill -9 $server_bin_name
21+
sleep 2
22+
echo "finsihed testing $2"
23+
echo
24+
}
25+
26+
test_all()
27+
{
28+
echo "###################################"
29+
echo " "
30+
echo " ProcessingTime $1ms "
31+
echo " Concurrency $2 "
32+
echo " "
33+
echo "###################################"
34+
for ((i=0; i<$length; i++))
35+
do
36+
test_web_framework $i ${web_frameworks[$i]} $1 $2
37+
done
38+
}
39+
40+
41+
pkill -9 $server_bin_name
42+
43+
echo ","$(IFS=$','; echo "${web_frameworks[*]}" ) > processtime-pipeline.csv
44+
test_all 0 5000
45+
echo "0 ms,"$(IFS=$','; echo "${test_result[*]}" ) >> processtime-pipeline.csv
46+
test_all 10 5000
47+
echo "10 ms,"$(IFS=$','; echo "${test_result[*]}" ) >> processtime-pipeline.csv
48+
test_all 100 5000
49+
echo "100 ms,"$(IFS=$','; echo "${test_result[*]}" ) >> processtime-pipeline.csv
50+
test_all 500 5000
51+
echo "500 ms,"$(IFS=$','; echo "${test_result[*]}" ) >> processtime-pipeline.csv
52+
53+
54+
55+
echo ","$(IFS=$','; echo "${web_frameworks[*]}" ) > concurrency-pipeline.csv
56+
test_all 30 100
57+
echo "100,"$(IFS=$','; echo "${test_result[*]}" ) >> concurrency-pipeline.csv
58+
test_all 30 1000
59+
echo "1000,"$(IFS=$','; echo "${test_result[*]}" ) >> concurrency-pipeline.csv
60+
test_all 30 5000
61+
echo "5000,"$(IFS=$','; echo "${test_result[*]}" ) >> concurrency-pipeline.csv

0 commit comments

Comments
 (0)