移动到Azure的巨大后性能下降 [英] Huge performance drop after moving to Azure

查看:211
本文介绍了移动到Azure的巨大后性能下降的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我们正在处理一个云迁移的项目,我们做了以下修改:


  • SQL服务器2014年到SQL Azure的PaaS的


  • Redis的缓存中的[Windows移植]天青Redis的PaaS的


  • 从共享驱动器的静态文件天青文件服务


  • 实现瞬时故障处理数据库交互。


  • HttpSessionState从SQL Server更改为自定义[Redis的PaaS的]


的应用有使用同一数据库中的两个Web应用程序:


  • 一建点与网络的形式净编码的经典模式。


  • 使用点网MVC4构建的其它应用。


后,我们搬到从现有Rackspace公司环境中的应用[2每个服务器有4GB内存]到Azure和运行负载测试并获得了以下结果:


  • 该MVC4应用是分数更快。


  • 在Web窗体应用程序开始表现不佳,具有相同的负载,
    响应时间为0.46秒增加到45.8秒。


的内存使用量一样,数据库的利用率大约为30%-40%,并在 CPU近100%,在1100个并发用户的利用率(所有的web服务器)(在Rackspace公司,它曾4500个并发用户)

我们测试的应用程序的 2 D5蔚蓝的服务器的虚拟机与RAM是更高的CPU速度更快。

任何人都可以大幅度突出的性能下降(执行一个应用程序几乎一样,另外一个执行近100倍慢)怎么这么有可能吗?

注:一观察,CPU使用率,甚至停止负载测试的30分钟后保持在100%。然后,它迅速下降。


解决方案

我将第二个概念(重点),您作为投资的时间和精力,你可以在分析您的应用程序,以确定瓶颈。运行配置文件导通premises和Azure和比较,如果可能的话。

您的应用程序显然有许多移动部件和相当大的表面积...这是没有犯罪,但它确实意味着它很难确定你有没有一些可视性运行时行为问题(S)。问题应该出在你的Redis的缓存,在静态文件处理,或在会话状态加载/卸载/互动循环。或者,它可能是在其他地方。这里没有什么神奇的答案...你需要的数据。

这是说...我已经咨询了几个Azure迁移的项目,我的经验告诉我,一个方面看是更接近你的ASP.NET Web窗体code和SQL之间的相互作用。过于健谈的应用程序(那些平均每个HTTP请求多个SQL调用)和/或那些发出对数据库执行大量的逻辑或返回结果集较大的昂贵的查询,往往在公共云一样的Azure,其中$表现出业绩不佳C $ c和数据可能无法在同一位置,吵闹的邻居问题可能会影响数据库的性能,等等,这些问题是不是唯一的Web窗体应用程序或天青,但他们往往在年龄较大,旧的应用程序将加剧写有code和数据在物理上接近的假设。既然你不控制(完全)在您的code和数据住在Azure中彼此相对,可以在一个片$ P $点的情况被掩盖迁移到云时,可表面的问题。

有些细节需要考虑:


  1. 在取数据使用你的Web窗体应用程序结合的亲密样子......在实践中也容易鼓励昂贵的查询,并从数据库中大的结果集传送到应用程序,有些东西你有时可能逃脱导通premises但不是在云


  2. 再看看你的SQL配置...你不提您所使用的层(基本,标准,premium),但这种选择可能对你的整体应用性能产生很大影响(和预算!)。如果事实证明(例如)Web窗体应用程序并发出昂贵的查询,然后使用一个更高级别的可以帮助


Azure的SQL数据库层

<醇开始=3>
  • 熟悉的云本土与云能力的概念应用......一般来讲,​​只是因为你可以找到一种方法,在云中运行的应用程序并不意味着它非常适合这样做。从你的描述它听起来就像你做了一些努力,利用一些云服务,本地,所以这是一个良好的开端。但是,如果我猜(因为我们无法看到您的code)我认为你可能需要在Web一些额外的重构窗体应用程序,使其更加高效,能够更好地在一个环境中你不运行'T有100%的控制权。

  • <一个href=\"http://thenewstack.io/best-practices-for-developing-cloud-native-applications-and-microservice-architectures/\"相对=nofollow>更多关于云计算的本地

    过时,但在Azure迁移还是相关的咨询

    如果您可以给我们你在哪里看到的瓶颈更多的细节,我们可以提供更具体的建议。

    祝你好运!

    Currently we were working on a cloud migration project where we made the following changes:

    • SQL Server 2014 to Azure SQL PaaS

    • Redis cache[Windows porting] to Azure Redis PaaS

    • Static files from shared drives to Azure File Service

    • Implemented Transient Fault Handling for database interactions.

    • HttpSessionState changed from SQL Server to Custom[Redis PaaS]

    The Application had two web applications that use the same database:

    • One built in Classic model of dot net coding with web-forms.

    • The other application built using dot net MVC4.

    After we moved the applications from existing Rackspace environment[2 servers each with 4GB RAM] to Azure and ran a load test and received the following results:

    • The MVC4 application is fractionally faster.

    • The Web-Form application started performing poorly, with same load, response time increased from 0.46 seconds to 45.8 seconds.

    The memory usage is same, database utilization is around 30%-40% and the CPU utilization in nearly 100%(all the web-servers) at 1100 concurrent users(at Rackspace, it served 4500 concurrent users).

    We tested the application 2 D5 azure server VMs with RAM being higher and CPU being faster.

    Can anyone highlight how such drastic performance drop(one application performing almost same, other one performing almost 100 times slower) is possible?

    NB: One observation, the CPU utilization stays at 100% even after 30mins of stopping the load-test. Then it drops quickly.

    解决方案

    I will second the notion (emphatically) that you invest as much time and energy as you can in profiling your application to identify bottlenecks. Run profiles on-premises and in Azure and compare, if possible.

    Your application clearly has many moving parts and a reasonably large surface area... that's no crime, but it does mean that its hard to pinpoint the issue(s) you're having without some visibility into runtime behavior. The issue could lie in your Redis caching, in the static file handling, or in the session state loading/unloading/interaction cycle. Or it could be elsewhere. There's no magic answer here... you need data.

    That said... I've consulted on several Azure migration projects and my experience tells me that one area to look closer at is the interaction between your ASP.NET Web Forms code and SQL. Overly-chatty applications (ones that average multiple SQL calls per HTTP request) and/or ones that issue expensive queries that perform lots of logic on the database or return large result sets, tend to exhibit poor performance in public clouds like Azure, where code and data may not be co-located, "noisy neighbor" problems can impact database performance, etc. These issues aren't unique to Web Forms applications or Azure, but they tend to be exacerbated in older, legacy applications that were written with an assumption of code and data being physically close. Since you don't control (completely) where your code and data live in Azure relative to each other, issues that may be masked in an on-prem scenario can surface when moving to the cloud.

    Some specifics to consider:

    1. take a close look at the use of data binding in your Web Forms app... in practice it tends to encourage expensive queries and transfer of large result sets from database to application, something you might sometimes get away with on-premises but not in the cloud

    2. take another look at your SQL configuration... you don't mention what tier you're using (Basic, Standard, Premium) but this choice can have a big impact on your overall app performance (and budget!). If it turns out (for example) that your Web Forms app does issue expensive queries, then use of a higher tier may help

    Azure SQL DB tiers

    1. familiarize yourself with the notion of "cloud native" vs. "cloud capable" applications... generally speaking, just because you can find a way to run an application in the cloud doesn't mean its ideally suited to do so. From your description it sounds like you've made some effort to utilize some cloud-native services, so that's a good start. But if I had to guess (since we can't see your code) I'd think that you might need some additional refactoring in your Web Forms app to make it more efficient and better able to run in an environment you don't have 100% control over.

    More on cloud-native

    dated but still relevant advice on Azure migration

    If you can give us more details on where you see bottlenecks, we can offer more specific advice.

    Best of luck!

    这篇关于移动到Azure的巨大后性能下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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