如何Node.js的执行类似Apache? [英] How does Node.js perform compared to Apache?

查看:140
本文介绍了如何Node.js的执行类似Apache?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Node.js的是更快,更具可扩展性比Apache?是否有任何性能数字上的Apache备份的Node.js的表现为Web应用程序?

Is Node.js quicker and more scalable than Apache? Are there any performance figures to back up Node.js's performance for a web application over Apache?

更新:好吧,也许我的问题(如上图),因为我是为Node.js的如何坐在一个网络堆栈中有点困惑是混乱的。在什么情况下,我应该考虑使用Node.js的,而不是一个更传统的堆栈,如PHP,MySQL和Apache的 - 还是Node.js的发挥它在这个堆栈的一部分

UPDATE: Ok maybe my question (above) is confusing because I am a little confused as to how Node.js sits within a web stack. Under what circumstances should I consider using Node.js instead of a more traditional stack like PHP, MySQL and Apache - or does Node.js play it's part in this stack?

推荐答案

Node.js的是一个框架,特别适合无需了解如何在较低水平实现并发编写高性能Web应用程序。这是编写JavaScript应用程序使用非阻塞IO服务器端框架:通过延续到IO调用,而不是等待结果。 Node.js的提供了一个系统的API(文件系统访问,网络访问等),所有的API调用采用的延续,它运行时将其结果后执行,而不是块并将结果返回到原来的调用者。

Node.js is a framework particularly well suited for writing high performance web applications without having to understand how to implement concurrency at a low level. It is a framework for writing server-side JavaScript apps using non-blocking IO: passing continuations to IO calls rather than waiting on results. Node.js provides a system API (filesystem access, network access, etc.) where all of the API calls take a continuation which the runtime will execute later with the result, rather than block and return the result to the original caller.

您可以单独使用,如果你喜欢。但你可能想在Node.js的前一个专门的反向代理:是这样的Apache,Nginx的,lighttpd的,等等。或者,汇聚更大的应用程序,你可能希望在多个运行的Node.js应用服务器前端类似HAProxy的。

You can use by itself, if you like. But you might want a dedicated reverse proxy in front of Node.js: something like Apache, Nginx, LigHTTPD, etc. Or, for clustering a bigger app, you might want something like HAProxy in front of multiple running Node.js app servers.

这篇关于如何Node.js的执行类似Apache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆