Skip to content

Latest commit

History

101 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Web Frameworks Benchmark

The idea behind this benchmark is to re-evaluate results presented by Techempower's Benchmark benchmarking best & promising open-source frameworks.

Why another benchmark?

I just found Techempower's Benchmark sources overcomplicated. Also wanted to test only framework overhead, that's why testing just trivial dynamic Hello World world output.

Just to not raise a controversy, I want also to emphasize this benchmark is simple & native and completely skips some unique features of some frameworks and languages, such as Erlang's natural clustering and hot-swap capabilities.

Results

LanguageFrameworkReq/sec1MB/sec99% ms2
JavaUndertow616 54780.553.29
CKore3572 782104.333.99
Clibmicrohttpd533 62669.721.28
Gofasthttp485 18567.565.26
COnion4483 82490.902.82
JavaNetty422 58040.304.08
Nim m&s 6AsyncHTTPServer404 04043.933.98
NativeNginx5381 36843.2624.24
Gonet/http270 25334.282.52
LuaOpenResty7269 20530.2843.35
C++Crow256 55231.3212.28
RustIron178 78919.440.05 8
ErlangCowboy9163 52124.015.41
NodeHTTP112 08613.7911.98
Nim m&s10AsyncHTTPServer86 7419.431.40
Nim m&s10Jester1183 7535.991.50
RubyPuma1283 0536.026.14
D ldc2 13Vibe.d0.7.2679 60213.2846.41
D dmd 14Vibe.d0.7.2676 83912.75103.05
Nim 15AsyncHTTPServer52 8435.754.76
Nim 15Jester42 6983.055.42

1Ubuntu 14.04 LTS, Linux 3.16, Xeon E5-1650 @ 3.50GHz, 32 GB RAM
2 Latency distribution value at 99% in milliseconds (towards worst)

3Core built without SSL via using make NOTLS=1.
4 Running hello example with static path.
5 Using Nginxecho module.
6Nim using --gc:markandsweep, pre-forked processes using SO_REUSEPORT.
7OpenResty is in fact Nginx with Lua module.
8RustIron has some amazing super-stable latency in longer runs.
9Cowboy requires some low level tweaking via sysctl, see and apply sysctl.conf.
10Nim using --gc:markandsweep, single-thread only.
11Jester is some higher-level web framework for Nim.
12 Using several Ruby instances with puma -w 12.
13D language using LDC2 compiler v0.16.1 (LLVM 3.7.0).
14D language using standard DMD compiler v2.069.1.
15Nim using standard RC garbage collection, single-thread only.

NOTE: Detailed results can be found in results/.

Benchmarking details

Each web framework is expected to respond with Hello World content of type text/plain with minimum set of headers required by HTTP 1.1 specification:

$ curl -i localhost:8080
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 11
Content-Type: text/plain
Date: Tue, 24 Nov 2015 17:32:30 GMT
Hello World

Some frameworks add extra headers such as Server or Expire by default, which are not required by HTTP 1.1 specification. If possible we use some settings or tweaks to remove them as more headers (so more data) will have negative impact on performance.

Effectively this benchmark tests solely the framework overhead itself. We are not testing any database access or JSON serialization performance. We are also avoiding some extra optimizations, such as caching response memory structures which could improve performance a bit, but contradicts dynamic behavior of tested frameworks.

Conclusions

As expected Java solution - Undertow is most optimized. 2nd & 3rd places are occupied by native C frameworks - Kore and libmicrohttpd.

Finally new fasthttpGo solution takes 4th place, being very close to the top 3. Go is very flexible little language, improving productivity and it is used already by many companies to deliver some heavy-load network services.

It has to be also observed that different frameworks generated different amount of data due different HTTP headers being used.

License

This benchmark is provided under MIT license:

Copyright (c) 2015 Adam Strzelecki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Benchmarking some web frameworks

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages