会话超时和页面响应时间
我正在对 ASP.NET 应用程序进行负载测试。 负载测试模拟 500 个用户在网站上进行搜索并浏览结果。我观察到,会话超时限制(在 web.config 中)减少得越多,页面响应时间就越好。 例如,超时时间为 10 分钟,我得到的平均响应时间为 8.35 秒。 如果超时时间为 3 分钟,则同一页面的平均响应时间为 3.98 秒。 会话存储在“InProc”中。 我认为“不再使用但仍然活动”会话使用的内存可能是原因。但是,即使超时为 10 时使用了更多内存,仍然有大量可用内存(大约 2.7Gb)。 有什么想法吗?
I'm load testing an asp.net app.
The load test is simulating 500 user doing searchs on the site and browsing the results. I'm observing that the more I reduce the session timeout limit (in web.config) the better the page response time.
For exemple, with a timeout at 10 minutes, I got an average response time of 8.35 seconds.
With a timout at 3 minutes, the average response time for the same page is 3,98 seconds.
The session in stored "InProc".
I supposed the memory used by the "no more used but still actives" sessions may be in cause. But, even if there is more memory used when the timeout is at 10, there is still plenty of memory available (about 2.7Gb).
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来您确实没有按照预期使用会话。您是否考虑过使用一种可用的缓存机制(无论是通过下层缓存还是进程内缓存)而不是使用会话变量?这是最好的起点:
http:// msdn.microsoft.com/en-us/library/xsbfdd8c%28v=vs.71%29.aspx
还强烈建议您在不需要的地方在页面或控件级别禁用视图状态。如果您使用视图状态解码器,例如:
http://ashishware.com/ViewStatePeeker.shtml
..您会对它存储的无用垃圾数量感到震惊!
It really sounds like you're not using session as it's intended. Have you considered rather than using session variables, you might be better off using one of the caching mechanisms available, whether that's through downlevel or in-proc caching? Here's the best place to start:
http://msdn.microsoft.com/en-us/library/xsbfdd8c%28v=vs.71%29.aspx
Its also strongly recommended that you disable viewstate at either the page or control level wherever its not needed. If you use a view state decoder such as:
http://ashishware.com/ViewStatePeeker.shtml
..you'll be horrified by the amount of useless junk it stores!
VU 执行的测试用例需要多长时间?如果它们花费的时间没有较短的会话超时(<3 分钟)那么长,或者它们花费的时间比两者都长(>10 分钟),那么更改该超时似乎应该没有效果。
测试用例是否包含注销?或者 VU 是否简单地放弃会话(关闭浏览器等)?
How long are the testcases that the VUs are executing? If they are not taking as long as the shorter session timeout (<3 min), or they are taking longer than both of them (>10 min), then it would seem that changing that timeout should have no effect.
Does the testcase contain a logout? Or do the VUs simply abandon the session (close browser, etc)?
就我而言,即使状态服务器与 Web 服务器位于同一台物理计算机上,在进程外 (StateServer) 存储会话状态也极大地提高了性能。
For my case, storing the session state out-of-process (StateServer) greatly improved performance, even if the state server is on the same physical machine than the web server.