all groups > asp.net caching > january 2005 >
You're in the

asp.net caching

group:

Session problems in IIS6/Windows2003


Session problems in IIS6/Windows2003 dwenwa NO[at]SPAM companyabc.com
1/21/2005 9:39:02 AM
asp.net caching:
Hi,

I have an ASP.NET application functioning properly on Windows 2000 server
and built using Visual Studio 2003. The application saves in the Session
Object DataView objects, instances of Classes, and the ViewState - as well as
name=variable combinations. The SessionState is defined as InProc.

We are upgrading our servers to Windows 2003 server. As I start testing the
application on Windows 2003 server, I am noticing that the server is dropping
certain Session objects intermittently. However, the "ASP.NET_SessionId" is
consistently the same throughout one browser session.

This is a single server not clustered.

I have read through other postings where the recommendation is to use
StateServer for the SessionState. The work involved with serializing all of
the objects would be quite an effort. I am thinking the whole caching model
of my application would need to be redesigned in order to fit in a new model.

1. Are there any known bugs in IIS6/Windows 2003 with Session that exhibit
this behavior?
2. Assuming no bugs are reported. Because IIS was rewritten in IIS6, did
the caching model change for Session to cause this problem with my
application?
3. Assuming a workaround is needed, which of the caching models would you
recommend?

Your input is greatly appreciated. Thank you.

Re: Session problems in IIS6/Windows2003 Ben Strackany
1/21/2005 12:32:20 PM
Check the number of processes for your Application Pools. If your app pools
are using more than one process, you might "randomly" loose session objects.

For more info:
http://www.developmentnow.com/blog/2005/01/randomly-loosing-session-state-on-iis.aspx

--
Ben Strackany
www.developmentnow.com


"dwenwa@companyabc.com" <dwenwacompanyabccom@discussions.microsoft.com>
[quoted text, click to view]

Re: Session problems in IIS6/Windows2003 dwenwa NO[at]SPAM companyabc.com
1/21/2005 12:57:05 PM
Ben,

Thank you for getting back to me so quickly. I checked the configuration of
the application pool. Under the "web garden" section of the Performance tab,
it says "Maximum number of worker processes = 1".

One additional item to note. I have two websites and eight virtual
directories configured in this application pool.

Dave

[quoted text, click to view]
RE: Session problems in IIS6/Windows2003 annie3
1/21/2005 1:07:01 PM


[quoted text, click to view]
Re: Session problems in IIS6/Windows2003 dwenwa NO[at]SPAM companyabc.com
1/25/2005 7:45:05 AM
Ben,

I am such an idiot. I ran some tests displaying a value from the Session
object. It would appear, disappear, then reappear. So the Session object
was not getting reset. The behavior implied that it existed in a particular
section of memory managed by a worker process.

After closer examination, I found that I was looking at the properties of
the wrong application pool in my initial response. The application pool
configured for the website was set to 5 worker processes.

This explains the behavior I saw. Depending how many times I click the
refresh button, I would get a different worker process. When I hit the
worker process with the Session object, it would appear. Otherwise it would
the value for the Session object would not appear.

Setting the worker processes to 1 resolved the problem. Obviously using a
different SessionState like SQL Server or StateServer would also have
resolved the problem. But I didn't want to go through and serialize all of
my objects before saving them.

Is there any way that this little tip can be added to online help for a
future release? It's isn't documented anywhere.

Thank you for your assistance.

Dave




[quoted text, click to view]
Re: Session problems in IIS6/Windows2003 Ben Strackany
2/7/2005 1:25:33 PM
Hi Dave, glad to hear my tip helped.

As far as it being online somewhere, I think it's buried somewhere in MSDN
about the Cache or Session object. Not sure if it's in IISfaq, tho.

--
Ben Strackany
www.developmentnow.com


"dwenwa@companyabc.com" <dwenwacompanyabccom@discussions.microsoft.com>
[quoted text, click to view]

AddThis Social Bookmark Button