IIS服务占用内存无法及时释放问题
IIS服务启动后,随着客户端的不断访问,内存的占用会增大,但当客户端不访问(晚上的时候),内存占用依然很大(单指IIS服务),没有自动释放,等转天每个客户端再次访问的时候,速度会非常慢,只有通过重新启动机器的方法释放内存,这样客户端访问的速度就会快上来。
操作系统为Windows 2000 Advance Server,IIS5.0,内存512MB,DELL服务器。
问题点数:100、回复次数:6Top
1 楼net_lover(【孟子E章】)回复于 2004-09-03 15:57:03 得分 30
It's all because of a bug in IIS4 and 5 obviously, this is the reason why session on end never fires or fires randomly in cases, it's called the Session_OnEnd bug although its directly related to random session timout read what you should do to avoid its side effects:
1-don't do any actions in the session on end since it never gets fired.. in most cases thus it will not be reliable
2- Don't EVER NEVER..EVER (I'll say it once more NEVEEEeeeR) store connections, large arrays, objects in session variables.. span a connection outside the boubdaries of a page..
3-and the most important: DON'T LEAVE A CONNECTION OPEN!! close all connections and clean them : Conn.close:Set Conn = nothing.. deinitialise also ALL created objects in scripts and components, Set ObjName= nothing to free memory resources..
The problem is when you don't do one of the last 2 points.. the server resources are exauhsted (memory) and it crashes on a timely basis.. since the session data stays loaded in the memory..
(this bug was also detected in IIS5 but is a lot less frequent/ I'll say rare)
You might not doing all this.. so check if the hosted website on the server are mis-codedTop
2 楼net_lover(【孟子E章】)回复于 2004-09-03 15:58:59 得分 0
http://support.microsoft.com/default.aspx?scid=kb;EN-US;254142Top
3 楼chentyoung(阿勇)回复于 2004-09-03 16:43:49 得分 0
在注册表中有个TTL设置,它是用来定义保留在高速缓存中的时间长度
ObjectCacheTLL REG_DWORDTop
4 楼chentyoung(阿勇)回复于 2004-09-03 16:49:02 得分 20
晕.我还没写完就发上去啦.
那值是从0秒到30秒
可以用较低的TTL来防止系统内存被用于缓存大量短暂对象
位置在.
HKEY_LOCAL_MACHINES\SYSETM
\CurrentControlset
\Serivces
\Inetinfo
\Parameters
请楼主改注册表时备分好.,万一出事了,那我可帮不上忙了.Top
5 楼aspczlover(你的骄傲...)回复于 2004-09-03 18:10:46 得分 20
IIS的性能优化
http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=173479Top
6 楼mackyliu(才子-54caizi.com)回复于 2004-09-03 18:14:56 得分 30
跟代码有很大的关系。。。。。例如session不释放。。。
假设一个网站访问量比较大,单个用户如有3个session,没及时释放,多好的服务器,不用多久就垮了。。。Top




