Go, Nginx, PHP, Nodejs who can win the top of the Forbidden Mountains

Source: Internet
Author: User
Tags socket error
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.