与压力测试工具(WebLoad)和代码后面的计时器的结果有很大的不同,
失踪时间在哪里?
网络延迟?(负载不重: 17 Min的最大负载大小为80,没有其他流量)
IIS?
我如何衡量差距?
一个页面的结果(“登陆”):
WebLoad Avg = 3.1 Sec - WebLoad计时器“着陆”
代码背后= 0.05 Sec -开始请求->结束请求。
一个简单的浏览器请求= 0.5 Sec
代码背后:
protected void Application_BeginRequest(object sender, EventArgs e)
{
Stopwatch RequestTimer = new Stopwatch();
RequestTimer.Start();
HttpContext.Current.Items["RequestTimer"] = RequestTimer;
}
protected void Application_EndRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Items["RequestTimer"] != null)
{
Stopwatch RequestTimer = (Stopwatch)HttpContext.Current.Items["RequestTimer"];
RequestTimer.Stop();
Logger.SectionEnd("RequestTimer", RequestTimer, "", true); //Per Page Name
}
}-- WebLoad代码的一部分:
wlGlobals.GetFrames = false
wlHttp.Header["Host"] = host
wlHttp.Header["Proxy-Connection"] = "off"
wlHttp.Header["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7"
wlHttp.Header["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,\x2A/\x2A;q=0.8"
//wlHttp.Header["Accept-Encoding"] = "gzip,deflate,sdch"
wlHttp.Header["Accept-Language"] = "en-GB,en-US;q=0.8,en;q=0.6"
wlHttp.Header["Accept-Charset"] = "ISO-8859-1,utf-8;q=0.7,*;q=0.3"
SetTimer ("Landing")
wlHttp.Get(url)
SendTimer ("Landing")运行在.Net 4 IIS7上。
谢谢
发布于 2012-02-24 14:14:34
浏览器中观察到的代码定时器和加载时间之间的差异主要是网络时间和页面呈现时间。由于WebLoad不呈现页面,所以它将不包括该组件--仅包括网络时间。浏览器时间和WebLoad时间之间的巨大差异是值得关注的。WebLoad是否正确地模拟多个连接?与以前的浏览器相比,现代浏览器使用更多的连接(每台主机使用6-8个连接)来加载页面。当延迟较高时,这会极大地改善加载时间。如果WebLoad只使用2个连接/主机(这是大多数浏览器在2009年之前所做的),那么它可能会严重扭曲测量结果。
https://stackoverflow.com/questions/9396528
复制相似问题