linux – node.js vs IIS 7.5性能
发布时间:2020-12-13 23:23:09 所属栏目:Linux 来源:网络整理
导读:设置: EC2上的2台机器,型号为m3.xlarge. 第一个用ubuntu服务器. 第二个是win2008r2. ubuntu上的node.js使用基本示例返回对任何请求的字符串响应. asp.net httphandler返回相同的响应. 使用https://github.com/newsapps/beeswithmachineguns 我使用10台机器
设置:
EC2上的2台机器,型号为m3.xlarge. 第一个用ubuntu服务器. 第二个是win2008r2. ubuntu上的node.js使用基本示例返回对任何请求的字符串响应. asp.net httphandler返回相同的响应. 使用https://github.com/newsapps/beeswithmachineguns 的NodeJS: Complete requests: 200000 Requests per second: 5605.170000 [#/sec] (mean) Time per request: 358.071900 [ms] (mean) 50% response time: 31.000000 [ms] (mean) 90% response time: 239.300000 [ms] (mean) IIS: Complete requests: 200000 Requests per second: 9263.810000 [#/sec] (mean) Time per request: 215.992900 [ms] (mean) 50% response time: 214.000000 [ms] (mean) 90% response time: 244.000000 [ms] (mean) nodeJS代码是: http.createServer(function (request,response) { response.writeHead(200,{'Content-Type': 'text/plain'}); response.end('Some responsen'); }).listen(80); httphandler代码是: context.Response.Write("Some responsen" + Guid.NewGuid().ToString("N")); 我认为节点js会快得多,我做错了吗? 编辑: 在使用集群模块后,我从节点js每秒获得16685个请求 解决方法
m3.xlarge实例有几个cpu核心,而node.js是单线程的.您可以尝试对
node.js cluster module进行基准测试,看看是否使用了更多的CPU帮助.并且,由于node.js是全新的,请确保使用最新的稳定系列(在编写本文时为0.8.x).
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |