This is a creation in Article, where the information may have evolved or changed.
Statement: The test framework here is a very common framework, do not go with some wonderful but the so-called performance of the framework of a very high contrast
As we use a large number of iris and Nginx in the Project two Web framework (pure Go language implementation, 0 memory copy), but also heard a lot of people ask go HTTP performance contrast Nginx, contrast nodejs exactly how, in view of this, today we will do a Web framework performance real competition.
Test environment diagram:
Here's a comparison of 4 frames from multiple dimensions: Nginx vs nginx-php-fpm vs Iris vs Nodejs-express
First, Nginx
Concurrency Stress test 100-100k
The first sketch is the number of requests processed per second under different concurrency pressures
The second one is the amount of data that is being throughput per second
The third is 99.9%, the average, the standard variance of the delay statistics, you can see that 0.01% of the request delay in 2 seconds or so
Four is single-threaded statistics
(These figures will not be explained later, please compare yourself)
This graph is a comparison of soccket errors and the total number of requests, and the ratio here is 100k/3.5m
Second, NGINX-PHP-FPM
Third, Iris (Golang)
Iv. Express-nodejs
Summarize:
Because other evaluations tend to compare to one of the slowest frames of go-the standard library, this contrasts with another commonly used fastest frame iris.
As can be seen from the above figure, Iris and nginx speed, request delay, throughput, socket error rate are similar, in terms of delay iris performance even better, nginx maximum 2 seconds, iris 0.2-0.3 seconds
The concurrency of the nginx-php is good, but the error rate increases significantly when the concurrency exceeds hundreds of
Express this result I do not know why, maybe there is no tuning reason? (none of the four frameworks are tuned)
Finally, compared to two times the development difficulty, Iris because it is based on go, so very very very simple, and two times the development efficiency is very high, nginx can do something with LUA, but always not directly in the same language convenient, and with LUA may have some flaws; Express is unclear, No comment, but the GO Network programming model should be much simpler than the callback method.