简体   繁体   English

Windows Azure中的Node.js可伸缩性问题

[英]Node.js scalability problems in Windows Azure

For an academic essay I'm comparing Asp.Net and Node.Js web application deployed in windows azure. 对于一篇学术论文,我将比较在Windows Azure中部署的Asp.Net和Node.Js Web应用程序。

I'm testing and measuring a request that calls a rest service that just hold for 7 seconds and response the request after it. 我正在测试和测量一个请求,该请求将调用一个仅保持7秒钟的rest服务,并在之后响应该请求。 The idea is measure how Node.Js and Asp.Net will behave in this situation. 这个想法是衡量Node.Js和Asp.Net在这种情况下的行为。

node.js is very fast in load tests with 250 users when I test in my own computer. 当我在自己的计算机上进行测试时,node.js在250个用户的负载测试中非常快。 The average of time response is around of 7 seconds, just the time of rest call response. 时间响应的平均时间约为7秒钟,仅为休息呼叫响应的时间。 Asp.Net is around 1-2 seconds slower. Asp.Net大约慢1-2秒。

When I do the same test with these app deployed in Azure, the results change a lot. 当我对部署在Azure中的这些应用程序进行相同的测试时,结果会发生很大变化。 While Asp.Net keep almost same results, Node.JS takes more than 100 seconds to respond with the same test, and it doesn't matter the size of cloud service. 尽管Asp.Net保持几乎相同的结果,但是Node.JS花费100多秒才能响应相同的测试,并且云服务的大小无关紧要。

here is the function that calls the URL that hold for 7 seconds: 这是调用保留7秒的URL的函数:

function sleep(response, request) {
    var currentQuery = url.parse(request.url).query;
    var time = querystring.parse(currentQuery).time;

    var options = {
        host: 'whatever.cloudapp.net',
        port: 80,
        path: '/?sleep=' + time,
        method: 'GET'
    };

    http.request(options, function () {
        response.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
        response.write('response ok.');
        response.end();
    }).end();

Anyone knows whats is happening? 有人知道发生了什么吗? Why node.js seems to be not scalable with I/O bounds when deployed in windows azure? 为什么在Windows Azure中部署node.js似乎无法通过I / O边界进行扩展?

Thanks in advanced 提前致谢

The performance difference between CS and WA is not normal, not with these numbers you refer to. CS和WA之间的性能差异不是正常现象,与您引用的这些数字不同。 But it is very hard to give the exact answer why it happens. 但是很难给出确切原因的确切答案。 It may be "noisy neighborhood", may be the long time to run for a first time (that may be solved for WA with Always On in settings, and with Cloud Services a little longer, but it can be solved), because there is the idle timeout, and CS WebRole, for example, will recycle after, as far as i remember, 20 minutes of idle. 它可能是“嘈杂的邻居”,可能是第一次运行很长的时间(在设置为Always On的情况下通过WA可以解决WA,而在使用Cloud Services的情况下可以解决更长的时间,但可以解决),因为闲置超时,例如,据我记得,CS WebRole将在闲置20分钟后回收。

The simplest way to eliminate the possibility that it can be the intermittent issue is to redeploy the CS to the different region using the large VM in the beginning. 消除可能是间歇性问题的可能性的最简单方法是,在一开始使用大型VM将CS重新部署到不同的区域。

I suspect that the performance difference reason may be in the different nature of CS and WA - CS is more like a VM that will spin out when you deploy the solution, and WA likely not. 我怀疑性能差异的原因可能是CS和WA不同性质-CS更像是在部署解决方案时将分拆出来的VM,而WA可能不会。

If you have the opportunity, you may analyze what is going on, using the official performance CS guidance . 如果有机会,您可以使用官方性能CS指南分析正在发生的事情。

And i would try to test the new Service Fabric offering instead of the classic CS, as that may gives some interesting insights into the cloud offerings. 我将尝试测试新的Service Fabric产品而不是经典的CS,因为这可能会提供一些有关云产品的有趣见解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM