ASP.Net MVC 生产性能不佳
我们有一个 MVC 3 应用程序,已部署到新建的 Windows 2008 R2 Web Edition 服务器上,但该服务器性能很差。
该应用程序已经在同一操作系统(不同的盒子)上通过了开发、质量保证和用户验收测试周期,没有出现任何性能问题。
我们可以看到服务器的唯一区别是它位于 DMZ 中,因此配置了两个网络适配器,一个用于互联网,另一个用于穿透防火墙。
我们已将各种日志记录放入应用程序中,并确认在“返回 ActionResult”之前一切正常(即约 500 毫秒)。然后需要 15 秒来呈现页面。
我们尝试在配置文件中打开 debug=false ,我不确定这里还要寻找什么,这似乎是一个环境问题。
请问有什么建议吗?我即将调查线程池大小是否会导致问题。
另外,如果它有助于页面使用多个部分视图,我已经读过其他人遇到的问题。
谢谢, 马特
We have a MVC 3 application which has been deployed onto a newly built Windows 2008 R2 Web Edition server which is performing badly.
This application has been through development, quality assurance and user acceptance testing cycles on the same operating system (different boxes) with no performance issues.
The only difference we can see with the server is that it sits in the DMZ and as such has two network adapters configured, one for the internet, and one to punch through the firewall.
We have put all sorts of logging into the application and confirmed that up until the 'return ActionResult' everything is working correctly (ie ~500ms). It then takes 15 seconds to render the page.
We have tried turning on debug=false in the config file, i'm not sure what else to look for here, it seems like an environment issue.
Any suggestions please ? I am about to investigate if the thread pool size could be causing problems.
Also, if it helps the page is using multiple partial views, i have read others having problems with them.
Thanks,
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于应用程序在其他环境中执行正常,我建议您调查以下内容:
数据库 - 您是否针对不同的数据库运行?查询执行多长时间?如果您的生产数据库有数百万条记录,而测试中只有很少的记录,那么您希望尽快发现性能问题。
网络 - 网络盒和数据库之间的延迟是多少?如果您仅仅因为网络原因而为每个数据库查询损失了 100 毫秒,那么如果您的页面触发 50 个查询,您就会损失 5 秒。我见过配置不当的路由器/负载均衡器就是这样做的。
尝试分析系统的每个组件(数据库、网络、网络盒),以找出您在哪里浪费了所有时间。尝试 http://code.google.com/p/mvc-mini-profiler/< /a>.
附言。您的产品环境中必须有
debug=false
。Since the application performs ok in other environments I would suggest you investigate following:
Database - are you running against different database? How long the queries execute? If you have non-optimized database with million records on production, and only few records in test you want find performance problems soon enough.
Network - what is the latency between web box and database? If you loose 100ms for each database query just because of network than if your page triggers 50 queries you've lost 5secs. I've seen poorly configured routers / load balancers that were doing just that.
Try profiling each component of your system (db, network, web box) in order to find out where you're wasting all that time. Try http://code.google.com/p/mvc-mini-profiler/.
PS. You MUST have
debug=false
in your prod env.