Merge pull request #4707 from OneNewLife/master

[Translated by OneNewLife]20161114 Apache Vs Nginx Vs Node.js And What It Means About The Performance Of WordPress Vs Ghost.md
This commit is contained in:
Ezio 2016-11-29 16:39:38 +08:00 committed by GitHub
commit 2c024a6ca4
2 changed files with 234 additions and 233 deletions

View File

@ -1,233 +0,0 @@
OneNewLife translating
Apache Vs Nginx Vs Node.js And What It Means About The Performance Of WordPress Vs Ghost
============================================================
![Node vs Apache vs Nginx](https://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Apache-vs-Nginx-730x430.jpg)
Ultimate battle of the giants: can the rising star Node.js prevail against the titans Apache and Nginx?
Just like you, I too have read the various kinds of opinions / facts which are scattered all over the Internet throughout all sorts of sources, some of which I consider reliable, while others, perhaps shady or doubtful.
Many of the sources I read were quite contradicting, ahm did someone say StackOverflow?[1][2], others showed a clear yet surprising results[3] thus having a crucial role in pushing me towards running my own tests and experiments.
At first, I did some thought experiments thinking I may avoid all the hassle of building and running physical tests of my own I was drowning deep in those before I even knew it.
Nonetheless, looking backwards on it, it seem that my initial thoughts were quite accurate after all and have been reaffirmed by my tests; a fact which reminds me of what I learned back in school regarding Einstein and his photoelectric effect experiments where he faced a waveparticle duality and initially concluded that the experiments were affected by his state of mind, that is, when he expected the result would be a wave then so it was and vice versa.
That said, Im pretty sure my results wont prove to be a duality anytime in the near future, although my own state of mind probably did had an effect, to some extents, on them.
### About The Comparison
One of the sources I read came up with a revolutionary way, in my view, to deal with the natural subjectiveness and personal biases an author may have.
A way which I decided to embrace as-well, thus I declare the following in advance:
Developers spend many years honing their craft. Those who reach higher levels usually make their own choice based on a host of factors. Its subjective; youll promote and defend your technology decision.
That said, the point of this comparison is not to become another “use whatever suits you, buddy” article. I will make recommendations based on my own experience, requirements and biases. Youll agree with some points and disagree with others; thats great — your comments will help others make an informed choice.
And thank you to Craig Buckler of [SitePoint][2] for re-enlightening me regarding the purpose of comparisons a purpose I tend re-forgetting as Im trying to please all visitors.
### About The Tests
All test were ran locally on an:
* Intel core i7-2600k machine of 4 cores and 8 threads.
* **[Gentoo Linux][1]** is the operating system used to run the tests.
The tool used for benchmarking: ApacheBench, Version 2.3 <$Revision: 1748469 $>.
The tests included a series of benchmarks, starting from 1,000 to 10,000 requests and a concurrency of 100 to 1,000 the results were quite surprising.
In addition, stress test to measure server function under high load was also issued.
As for the content, the main focus was about a static file containing a number of Lorem Ipsum verses with headings and an image.
[
![Lorem Ipsum and ApacheBenchmark](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark-730x411.jpg)
][3]
Lorem Ipsum and ApacheBenchmark
The reason I decided to focus on static files is because they remove all sorts of rendering factors that may have an effect on the tests, such as: the speed of a programming language interpreter, how well is an interpreter integrated with the server, etc…
Also, based on my own experience, a substantial part of the average page load time is usually being spent on static content such as images for example, therefore in order to see which server could save us the most of that precious time it seem more realistic to focus on that part.
That aside, I also wanted to test a more real case scenario where I benchmarked each server upon running a dynamic page of different CMSs (more details about that later on).
### The Servers
As Im running Gentoo Linux, you could say that either one of my HTTP servers is starting from an optimized state to begin with, since I built them using only the use-flags I actually needed. I.e there shouldnt be any unnecessary code or module loading or running in the background while I ran my tests.
[
![Apache vs Nginx vs Node.js use-flags](http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags-730x241.jpg)
][4]
Apache vs Nginx vs Node.js use-flags
### Apache
`$: curl -i http://localhost/index.html
HTTP/1.1 200 OK
Date: Sun, 30 Oct 2016 15:35:44 GMT
Server: Apache
Last-Modified: Sun, 30 Oct 2016 14:13:36 GMT
ETag: "2cf2-54015b280046d"
Accept-Ranges: bytes
Content-Length: 11506
Cache-Control: max-age=600
Expires: Sun, 30 Oct 2016 15:45:44 GMT
Vary: Accept-Encoding
Content-Type: text/html`
Apache was configured with “event mpm”.
### Nginx
`$: curl -i http://localhost/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Sun, 30 Oct 2016 14:17:30 GMT
Content-Type: text/html
Content-Length: 11506
Last-Modified: Sun, 30 Oct 2016 14:13:36 GMT
Connection: keep-alive
Keep-Alive: timeout=20
ETag: "58160010-2cf2"
Accept-Ranges: bytes`
Nginx included various tweaks, among them: “sendfile on”, “tcp_nopush on” and “tcp_nodelay on”.
### Node.js
`$: curl -i http://127.0.0.1:8080
HTTP/1.1 200 OK
Content-Length: 11506
Etag: 15
Last-Modified: Thu, 27 Oct 2016 14:09:58 GMT
Content-Type: text/html
Date: Sun, 30 Oct 2016 16:39:47 GMT
Connection: keep-alive`
The Node.js server used in the static tests was custom built from scratch, tailor made to be as lightweight and fast as possible no external modules (outside of Nodes core) were used.
### The Results
Click on the images to enlarge:
[
![Apache vs Nginx vs Node: performance under requests load (per 100 concurrent users)](http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests-730x234.jpg)
][5]
Apache vs Nginx vs Node: performance under requests load (per 100 concurrent users)
[
![Apache vs Nginx vs Node: performance under concurrent users load](http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency-730x234.jpg)
][6]
Apache vs Nginx vs Node: performance under concurrent users load (per 1,000 requests)
### Stress Testing
[
![Apache vs Nginx vs Node: time to complete 100,000 requests with concurrency of 1,000](http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg)
][7]
Apache vs Nginx vs Node: time to complete 100,000 requests with concurrency of 1,000
### What Can We Learn From The Results?
Judging by the results above, it appears that Nginx can complete the highest amount of requests in the least amount of time, in other words, **Nginx** is the fastest HTTP server.
Another thing we can learn, which is quite surprising as a matter of fact, is that Node.js can be faster than Nginx and Apache in some cases, given the right amount of concurrent users and requests.
To those who wonder, the answer is NO, when the number of requests was raised during the concurrency test then Nginx would return to a leading position.
Unlike Apache and Nginx, Node.js, especially clustered Node, seem to be indifferent to the number of concurrent users hitting it. As the chart shows, clustered Node keeps a straight line at around 0.1 seconds while both Apache and Nginx suffer a variation of about 0.2 seconds.
A conclusion that can be drawn based on the above statistics is that the smaller the site is the less it matters which server it uses. However, as the site grows larger audience, the more apparent the impact an HTTP server has.
At the bottom line, when it comes to the raw speed of each server, as its depicted by the stress test, my sense is that the most crucial factor behind the performance is not some special algorithm but what it comes down to is actually the programming language each server is running.
As both Apache and Nginx are using C language which is AOT (Ahead Of Time) compiled language, Node.js on the other hand is using JavaScript which is an interpreted / JIT (Just In Time) compiled language. This means theres additional work for the Node.js server on its way to execute a program.
This sense I base not only upon the results above but also upon further results, which youll see below, where I got pretty much the same performance parity even when using an optimized Node.js server built with the popular Express framework.
### The Bigger Picture
At the end of the day, an HTTP server is quite useless without the content it serves. Therefore when looking to compare web servers, a vital part we must take into account is the content we wish to run on top of it.
Although other function exists as well, the most widely popular use done with an HTTP server is running a website. Hence, to see the real life implications of each servers performance I decided to compare WordPress the most widely used CMS (Content Management System) in the world, with Ghost a rising star with a gimmick of using JavaScript at its core.
Will a Ghost web-page based on JavaScript alone be able to outperform a WordPress page running on top of PHP and Apache / Nginx?
Thats an interesting question since Ghost has the advantage of using a single, coherent tool for its actions no additional layers needed, whereas WordPress needs to rely on the integration between Apache / Nginx and PHP, an integration which might incur significant performance drawbacks.
Adding to that, theres also a significant performance difference between PHP and Node.js in favor of the latter, which Ill briefly talk about below, things might come out a bit differently than initially seemed.
### PHP Vs Node.js
In order to compare WordPress and Ghost we must first consider an essential component which affects both.
Essentially, WordPress is a PHP based CMS while Ghost is Node.js (JavaScript) based. Unlike PHP, Node.js enjoys the following advantages:
* Non-blocking I/O
* Event driven
* Modern, less legacy code encumbered
Since there are plenty of comparisons out there explaining and demonstrating Node.js raw speed over PHP (including PHP 7) I shall not elaborate further on the subject, Google it, I implore you.
So, given that Node.js outperforms PHP in general, will it be significant enough to make a Node.js website faster than Apache / Nginx with PHP?
### WordPress Vs Ghost
When comparing WordPress to Ghost some would say its like comparing apples to oranges and for the most part Ill agree, as WordPress is a fully fledged CMS while Ghost is basically just a blogging platform at the moment.
However, the two still share many overlapping areas where both can be used to publish thoughts to the world.
Given that premise, how can we compare the 2 while one runs on totally different code base than the other, including themes and core features.
Indeed, a scientific lab-conditioned test would be hard to devise. However, in this comparison Im interested in a more real life case scenario, where WordPress gets to keep its theme and so does Ghost. Thus, the goal here is to have both platforms web-pages similar in size as possible and let PHP and Node.js do their magic behind the scenes.
Since the results were measured against different criteria and most importantly not exact same sizes, it wouldnt be fair to display them side by side in a chart. Hence a table is used instead:
[
![Node vs Nginx vs Apache comparison table](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table-730x185.jpg)
][8]
Node vs Nginx vs Apache running WordPress & Ghost. Top 2 rows are WordPress, bottom 2 are Ghost
As you can see, despite the fact Ghost (Node.js) is loading a smaller sized page (youd be surprised how much difference can 1kB make) it still remains slower than both WordPress with Nginx and with Apache.
Also, does preempting every Node server hit with Nginx proxy that serves as a load balancer actually contributes or detracts from performance?
Well, according to the table above, if it has any effect at all then it is a detracting one which is a reasonable outcome as adding another layer should make things slower. However, the numbers above shows it just might be negligible.
But the most important thing the table above shows us is that even though Node.js is faster than PHP, the role an HTTP server has, may surpass the importance of what type of programming language a certain web platform uses.
Of course, on the other hand, if the page loaded was a lot more reliant on server-side script serving, then the results would of wind up a bit different, I suspect.
At the end of it, if a web platform really wants to beat WordPress at its own game, performance-wise that is, the conclusion rising from this comparison is itll have to have some sort of customized tool a-la PHP-FPM, that will communicate with JavaScript directly (instead of running it as a server) thus it could fully harness JS power to reach a better performance.
--------------------------------------------------------------------------------
via: https://iwf1.com/apache-vs-nginx-vs-node-js-and-what-it-means-about-the-performance-of-wordpress-vs-ghost/
作者:[Liron][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://iwf1.com/tag/linux
[1]:http://iwf1.com/5-reasons-use-gentoo-linux/
[2]:https://www.sitepoint.com/sitepoint-smackdown-php-vs-node-js/
[3]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark.jpg
[4]:http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags.jpg
[5]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests.jpg
[6]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency.jpg
[7]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg
[8]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table.jpg

View File

@ -0,0 +1,234 @@
OneNewLife translated
Apache、Nginx 与 Node.js 之争 —— WordPress 与 Ghost 的性能大对决
============================================================
![Node、Apache 与 Nginx 的对决](https://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Apache-vs-Nginx-730x430.jpg)
巨强之间的终极对决:崛起的新星 Node.js 能否战胜巨人 Apache 和 Nginx
我和你一样,都阅读过大量散布在互联网各处的意见或事实,其中有一些我认为是可靠的,而其它的可能是谣传,让人难以置信。
我读过的许多信息是相当矛盾的,有人深信 StackOverflow而其他人展示了一个清晰的令人惊讶的结果这在推动我自己去做测试来验证结论的过程中扮演了重要的角色。
起初,我做了一些思想准备,认为我可以避免自己进行测试来校验结论的麻烦——在我沉浸在这种想法之前我甚至已经知道会这样。
尽管如此,往后看的时候,似乎我最初的想法是相当准确的,并且已经再次重申我的测试。这个事实让我想起了当年我在学校学到的爱因斯坦和他的光电效应的实验,他面临着一个光的波粒二重性的问题,最初的结论是实验受到他的心理状态的影响,即当他期望结果是一个波的时候结果就会是一个波,反之亦然。
也就是说,我坚信我的结果不会在不久的将来被证明是一个二重性,虽然我的心理状态可能在某种程度上对他们有影响。
### 关于比较
在我看来,我阅读的一个来源给作者处理自然现象和个人偏见带来了一种革命性的方式。
这同时也是一种我决定接受的方式,因此我提前声明以下内容:
开发者花了很多年来磨练他们的工艺。那些达到更高水平的人通常参考很多因素来做出自己的抉择。这是主观的;你将会推崇和捍卫你的技术决策。
也就是说,这个比较点不会成为另一篇“兄弟,使用任何适合你的东西”的文章。我将会根据我的自身经验、要求和偏见提出建议。你会同意一些观点,反对他人;这是很好的——你的意见会帮助别人做出明智的选择。
感谢 Craig Buckler 的 [建站观点][2],这重新启发了我比较的意义——尝试重新忘记自我,并试图让所有的读者心悦诚服。
### 关于测试
所有的测试都在本地运行:
* 英特尔酷睿 i7-2600k四核心八线程的机器
* **[Gentoo Linux][1]** 是用于测试的操作系统
用于基准测试的工具ApacheBench2.3 版次版本1748469
测试包括一系列基准,从 1000 到 10000 个请求以及从 100 到 1000 个的并发请求——结果相当令人惊讶。
此外,我还进行了在高负载下测量服务器功能的压力测试。
至于内容,主要是一个包含一些 Lorem Ipsum 的标题和一张图片静态文件。
[![Lorem Ipsum and ApacheBenchmark](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark-730x411.jpg)
][3]
Lorem Ipsum 和 ApacheBenchmark
我决定专注于静态文件的原因是因为它们删除了可能对测试产生影响的各种渲染因素,例如:编程语言解释器的速度、解释器与服务器的集成程度等等。
此外,基于我的自身经验,平均网页加载时间的很大一部分通常用于静态内容,例如图片,因此关注哪个服务器可以节省我们加载静态内容的时间是比较现实的。
除此之外,我还想测试一个更加真实的案例,案例中我在运行不同 CMS 的动态页面(稍后将详细介绍)时对服务器进行基准测试。
### 服务器
正如我用的是 Gentoo Linux你可以说我的 HTTP 服务器在一开始就已经经过优化了,因为我在构建系统的时候只使用了我实际需要的东西。也就是说,当我运行我的测试的时候,不应该在后台运行任何不必要的代码或加载没用的模块。
[![Apache、Nginx 和 Node.js 的使用标志对比](http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags-730x241.jpg)
][4]
Apache、Nginx 和 Node.js 的使用标志对比
### Apache
```
$: curl -i http://localhost/index.html
HTTP/1.1 200 OK
Date: Sun, 30 Oct 2016 15:35:44 GMT
Server: Apache
Last-Modified: Sun, 30 Oct 2016 14:13:36 GMT
ETag: "2cf2-54015b280046d"
Accept-Ranges: bytes
Content-Length: 11506
Cache-Control: max-age=600
Expires: Sun, 30 Oct 2016 15:45:44 GMT
Vary: Accept-Encoding
Content-Type: text/html
```
Apache 配置了 “event mpm”。
### Nginx
```
$: curl -i http://localhost/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Sun, 30 Oct 2016 14:17:30 GMT
Content-Type: text/html
Content-Length: 11506
Last-Modified: Sun, 30 Oct 2016 14:13:36 GMT
Connection: keep-alive
Keep-Alive: timeout=20
ETag: "58160010-2cf2"
Accept-Ranges: bytes
```
Nginx 包括各种调整:`sendfile on`、`tcp_nopush on` 和 `tcp_nodelay on`
### Node.js
```
$: curl -i http://127.0.0.1:8080
HTTP/1.1 200 OK
Content-Length: 11506
Etag: 15
Last-Modified: Thu, 27 Oct 2016 14:09:58 GMT
Content-Type: text/html
Date: Sun, 30 Oct 2016 16:39:47 GMT
Connection: keep-alive
```
在静态测试中使用的 Node.js 服务器是从零开始定制的这样可以让它尽可能更加的轻快——没有使用外部模块Node 核心模块除外)。
### 测试结果
点击图片以放大:
[![Apache、Nginx 与 Node 的对比:请求负载能力(每 100 位并发用户)](http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests-730x234.jpg)
][5]
Apache、Nginx 与 Node 的对比:请求负载的性能(每 100 位并发用户
[![Apache、Nginx 与 Node 的对比:用户负载能力](http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency-730x234.jpg)
][6]
Apache、Nginx 与 Node 的对比:用户负载能力(每 1000 个请求)
### 压力测试
[![Apache、Nginx 与 Node 的对比:完成 1000 位用户并发的 100000 个请求耗时](http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg)
][7]
Apache、Nginx 与 Node 的对比:完成 1000 位用户并发的 100000 个请求耗时
### 我们可以从结果中得到什么?
从以上结果判断,似乎 Nginx 可以在最少的时间内完成最多请求,换句话来说,**Nginx** 是最快的 HTTP 服务器。
还有一个相当惊人的事实是在特定的用户并发数和请求数下Node.js 可以比 Nginx 和 Apache 更快。
当请求的数量在并发测试中增加的时候Nginx 将重回领先的位置,这个结果可以让那些陷入 Node.js 的遐想的人清醒一下。
和 Apache、Nginx 不同的是Node.js 似乎对用户的并发数不太敏感,尤其是在集群节点。如图所示,集群节点在 0.1 秒左右保持一条直线,而 Apache 和 Nginx 都有大约 0.2 秒的波动。
基于上述统计可以得出的结论是站点越小其使用的服务器就越重要。然而随着网站的受众越来越多HTTP 服务器的影响变得愈加明显。
当涉及到每台服务器的原始速度的底线的时候,正如压力测试所描述的,我的感觉是,性能背后最关键的因素不是一些特定的算法,但它到底是什么,实际上每台服务器所运行的编程语言。
由于 Apache 和 Nginx 都使用了 C 语言—— AOT 语言(编译型语言),而 Node.js 使用了 JavaScript ——这是一种 JIT 语言(解释型语言)。这意味着 Node.js 在执行程序的过程中还有额外的工作负担。
这意味着我不能仅仅基于上面的结果来下结论,而要做进一步校验,你会看到下面的结果,我得到几乎相同的性能奇偶性校验,即使当我使用一台经过优化的 Node.js 服务器来构建和流行的 Express 框架。
### The Bigger Picture
一天就这么过去了如果没有服务的内容HTTP 服务器是没什么用的。因此,在比较 web 服务器的时候,我们必须考虑的一个重要的部分就是我们希望在上面运行的内容。
虽然其它功能也存在,但是 HTTP 服务器最广泛的使用就是运行网站。因此,为了看到每台服务器的性能对现实生活的影响,我决定比较一下 WordPress ——世界上使用最广泛的 CMS内容管理系统和 Ghost ——内核使用了 JavaScript 的一颗冉冉升起的明星。
基于 JavaScript 的 Ghost 网页能否胜过运行在 PHP 和 Apache / Nginx 上面的 WordPress 页面?
这是一个有趣的问题,因为 Ghost 具有操作工具单一且一致的优点——无需额外的封装,而 WordPress 需要依赖 Apache / Nginx 和 PHP 之间的集成,这可能会导致显著的性能缺陷。
除此之外PHP 和 Node.js 之间还有一个显著的性能差异,这有利于后者,我将在下面简要介绍一下,可能会出现一些与初衷大相径庭的结果。
### PHP 与 Node.js 的对决
为了比较 WordPress 和 Ghost我们必须首先考虑一个影响到两者的基本组件。
基本上WordPress 是一个基于 PHP 的 CMS而 Ghost 是基于 Node.jsJavaScript的。与 PHP 不同Node.js 有以下优点:
* 非阻塞的 I/O
* 事件驱动
* 更新颖,更少的残旧代码
由于有大量的比较解释和演示了 Node.js 的原始速度超过 PHP包括 PHP 7我不会再进一步阐述这个主题请你自行用谷歌搜索相关内容。
因此,考虑到 Node.js 的性能优于 PHP一个 Node.js 的网站的速度要比 Apache / Nginx 和 PHP 的网站快吗?
### WordPress 和 Ghost 对决
当比较 WordPress 和 Ghost 时,有些人会说这就像比较苹果和橘子,大多数情况下我同意这个观点,因为 WordPress 是一个完全成熟的 CMS而 Ghost 基本上只是一个博客平台。
然而,两者仍然有共同竞争的市场,其中两者都可以用于向世界发布你的个人想法。
制定一个前提,我们怎么比较两个完全基于不同的代码来运行的平台,包括主题和核心功能。
事实上,一个科学的实验测试条件是很难设计的。然而,在这个测试中我对更接近生活的情景更感兴趣,所以 WordPress 和 Ghost 都将保留其主题。因此,这里的目标是使两个平台的网页大小尽可能相似,让 PHP 和 Node.js 在幕后斗智斗勇。
由于结果是根据不同的标准进行测量的,最重要的是尺度不一样,因此在图表中并排显示它们是不公平的。因此,我改为使用表:
[![Node、Nginx 和 Apache 性能比较表](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table-730x185.jpg)
][8]
Node、Nginx、Apache 以及运行 WordPress 和 Ghost 的比较。前两行是 WordPress底部的两行是 Ghost
正如你所见,尽管事实上 GhostNode.js正在加载一个更小的页面你可能会惊讶 1 字节可以产生这么大的差异),它仍然比同时使用 Nginx 和 Apache 的 WordPress 要慢。
此外,抢占每个 Node 服务器使用 Nginx 代理作为负载均衡器实际上会提升还是降低性能?
那么,根据上面的表格,如果说它产生什么效果的话,它造成了减益的效果——这是一个合理的结果,因为额外封装一层理所当然会使其变得更慢。当然,上面的数字也表明这可以忽略不计。
但是上表中最重要的一点是,即使 Node.js 比 PHP 快HTTP 服务器的作用也可能超过某个 web 平台使用的编程语言的重要性。
当然,另一方面,如果加载的页面更多地依赖于服务器端的脚本服务,那么我怀疑结果可能会有点不同。
最后,如果一个 web 平台真的想在自己的天地里击败 WordPress从这个比较中得出的结论就是要想性能占优必须要定制一些像 PHP-FPM 的工具,它将直接与 JavaScript 通信(而不是作为服务器来运行),因此它可以完全利用 JS 的力量来达到更好的性能。
--------------------------------------------------------------------------------
via: https://iwf1.com/apache-vs-nginx-vs-node-js-and-what-it-means-about-the-performance-of-wordpress-vs-ghost/
作者:[Liron][a]
译者:[OneNewLife](https://github.com/OneNewLife)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://iwf1.com/tag/linux
[1]:http://iwf1.com/5-reasons-use-gentoo-linux/
[2]:https://www.sitepoint.com/sitepoint-smackdown-php-vs-node-js/
[3]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark.jpg
[4]:http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags.jpg
[5]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests.jpg
[6]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency.jpg
[7]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg
[8]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table.jpg