ASP.NET 网站在生产服务器上的性能下降 [英] ASP.NET Website Slow Performance on production server

查看:26
本文介绍了ASP.NET 网站在生产服务器上的性能下降的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我的 ASP.NET 网站在我的生产服务器上运行速度比在我的开发服务器上慢.

My problem is that my ASP.NET website is running slower on my production server comparatively on my development server.

在我的开发环境中执行 120 毫秒的页面需要 400 毫秒才能在服务器上执行.我已经使用探查器监视了 SQL 服务器,并且在服务器上运行需要 400 毫秒的页面上运行的查询只需要大约 50 毫秒即可完成 - 所以我确信我的问题不在于 SQL 服务器.

A page that executes in 120ms in my development environment takes 400ms to execute on the server. I've monitored the SQL server with the profiler and the query being run on the page taking 400ms on the server only takes around 50ms to finish - so I've convinced myself that my problem does not lie with the SQL server.

我的开发机器是带有 6GB RAM 的 Intel I7,生产服务器是带有 16GB 内存的 2x AMD Quad Core.

My development machine is an Intel I7 with 6GB RAM, the production server is a 2x AMD Quad Core with 16GB ram.

推荐答案

您可以考虑提高网站性能的一些要点.

There are some point you can consider for performance improvment of your website.

  1. 设置调试=假
  2. 除非需要,否则关闭跟踪
  3. 如果不需要,请关闭会话状态.ASP.NET 自动管理会话状态.但是,如果您不需要 Sessions,禁用它将有助于提高性能
  4. 在不需要时禁用 ViewState.
  5. 避免频繁往返数据库
  6. 避免抛出异常.异常是处理应用程序逻辑中发生的错误的好方法.然而,抛出异常是一种代价高昂的资源,必须避免.使用特定的异常并尽可能少地使用以避免资源开销
  7. 使用缓存来提高应用程序的性能.
  8. 使用 finally 方法杀死资源

使用本网站衡量您的网站性能http://www.websiteoptimization.com/services/analyze/
http://www.websitepulse.com/

measure your website performance using this website http://www.websiteoptimization.com/services/analyze/
http://www.websitepulse.com/

这篇关于ASP.NET 网站在生产服务器上的性能下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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