一个搜索aspx页面返回速度慢 [英] A search aspx page return slow

查看:223
本文介绍了一个搜索aspx页面返回速度慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net网站,有一个searchResult.aspx,它运行的SQL脚本来检索MS SQL Server数据库中的数据,然后把数据转换成HTML格式,该网站已经部署在IIS7。 5服务器。我已经实现静态和动态融为一体pression,这意味着所有的JS,CSS和aspx页面已经融为一体pressed之前呈现给浏览器。

I have a asp.net website, there is a searchResult.aspx, it runs a sql script to retrieve data from MS SQL server database, and then put the data into a HTML format, the website has been deployed in IIS7.5 Server. I have implemented both static and dynamic compression, that means all my js, css and aspx page have been compressed before rendered to browser.

不幸的是,searchResult.aspx回报很慢,如果搜索一个大词,如传记,它花费平均超过10秒返回。我用萤火虫网跟踪它,阻塞,DNS查找,连接和发送都以不超过10ms多,但等待接管10秒。所以我加了一些code到功能的Page_Load的开始和结束(对象发件人,EventArgs e)和HTML也body元素的开头和结尾,象下面这样:

Unfortunately the searchResult.aspx return very slow, if search for a big word, like biography, it averagely takes more than 10 seconds to return. and I used firebug Net to trace it, the blocking, DNS Lookup, Connecting and Sending all take no more than 10ms, but the Waiting takes over 10 seconds. So I added some code to the beginning and end of function Page_Load(object sender, EventArgs e) and also the begining and end of HTML body element, like below:

   protected Stopwatch stopwatch = new Stopwatch();
   protected void Page_Load(object sender, EventArgs e)
    {
        stopwatch.Start();
        ....
        stopwatch.Stop();
        timeForSearch = stopwatch.Elapsed.Milliseconds;
     }


    <body>
      <%
       stopwatch.Reset();
        stopwatch.Start();
       %>
       ....


      <%stopwatch.Stop();%>
 <%=timeForSearch%>+<%=stopwatch.Elapsed.Milliseconds%>=<%=stopwatch.Elapsed.Milliseconds + timeForSearch%>

好吧,通常timeForSearch和填充aspx页面的时间是完全1秒,但为什么页面需要10秒以上来加载,任何帮助将AP preciated它。

Ok, usually the timeForSearch and time for filling aspx page are totally 1 second, but why the page takes over 10 seconds to load, any help will be appreciated it.

感谢回答,ASPX页面已经被gzip为8.2KB。不是一个大文件

thanks for replying, the aspx page has been gzip to 8.2KB. not a big file

推荐答案

我想也许我固定它,我禁用IIS日志,则搜索页面可在3至5秒内被加载,它似乎提高了不少。但我还在想,禁用IIS日志是一个不错的选择。

I thought maybe I fixed it, I disable the IIS log, then the search page can be loaded within 3 to 5 seconds, it seems improve a lot. But I am still thinking about that disabling IIS log is a good choice.

这篇关于一个搜索aspx页面返回速度慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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