473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Which session state is best to use

I am running with Sql Server and am curious if I should use in-process,
State Server, or SQL Server.

By default, I assume I am using in-process (I could be wrong here, however).
I am not actually defining it in my web.config.

I was thinking about moving to Sql Server mode, but am not sure what I would
gain or lose by changing.

One thing I was curious about, was if this would make it easier to figure
out who was using our system at any particular time (their sessions haven't
timed out yet).

Thanks,

Tom
Nov 19 '05 #1
4 1577
There is no right answer for this, rather there are recommendations based on
your requirements. If you move to sql server session, you incur a
performance penalty but you also get to use session in webfarms and gardens.
In proc is the default mode by the way, as defined in the web config file.

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP15.phx.gbl...
I am running with Sql Server and am curious if I should use in-process,
State Server, or SQL Server.

By default, I assume I am using in-process (I could be wrong here,
however). I am not actually defining it in my web.config.

I was thinking about moving to Sql Server mode, but am not sure what I
would gain or lose by changing.

One thing I was curious about, was if this would make it easier to figure
out who was using our system at any particular time (their sessions
haven't timed out yet).

Thanks,

Tom

Nov 19 '05 #2
Two things:

1) I'd suggest not using Session state at all if you can avoid it. This isn't
always possible, but you avoid some types of problems later on if you can.

2) If you are going to use it, then don't accept the default of InProc. The
primary reason is that your worker process and/or AppDomain (essentially
the two different hosting environments) recycle very often (more than you'd
think) and as a side effect your in memory state (read: InProc Session State)
will be lost. It's odd, IMO, that this is even an option in ASP.NET. So,
in short: never use InProc Session State and configure it to be out of process.

-Brock
http://staff.develop.com/ballen
I am running with Sql Server and am curious if I should use
in-process, State Server, or SQL Server.

By default, I assume I am using in-process (I could be wrong here,
however). I am not actually defining it in my web.config.

I was thinking about moving to Sql Server mode, but am not sure what I
would gain or lose by changing.

One thing I was curious about, was if this would make it easier to
figure out who was using our system at any particular time (their
sessions haven't timed out yet).

Thanks,

Tom


Nov 19 '05 #3
>It's odd, IMO, that this is even an option in ASP.NET. So, in short: never
use InProc Session State and configure it to be out of process. It's not odd. Recycling application promotes greater stability and immunity
towards errant processes leaking memory among other things. There is a
reason why inProc is the default mode, because it works best for a large
number of applications. If you recommend switching modes, you should have a
sound reason and thoroughly understand the consequences such as performance
degradation occuring when session passes thru the
serialization/deserialization layer.

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:66********************@msnews.microsoft.com.. . Two things:

1) I'd suggest not using Session state at all if you can avoid it. This
isn't always possible, but you avoid some types of problems later on if
you can.

2) If you are going to use it, then don't accept the default of InProc.
The primary reason is that your worker process and/or AppDomain
(essentially the two different hosting environments) recycle very often
(more than you'd think) and as a side effect your in memory state (read:
InProc Session State) will be lost. It's odd, IMO, that this is even an
option in ASP.NET. So, in short: never use InProc Session State and
configure it to be out of process.

-Brock
http://staff.develop.com/ballen
I am running with Sql Server and am curious if I should use
in-process, State Server, or SQL Server.

By default, I assume I am using in-process (I could be wrong here,
however). I am not actually defining it in my web.config.

I was thinking about moving to Sql Server mode, but am not sure what I
would gain or lose by changing.

One thing I was curious about, was if this would make it easier to
figure out who was using our system at any particular time (their
sessions haven't timed out yet).

Thanks,

Tom


Nov 19 '05 #4
> It's not odd. Recycling application promotes greater stability and
immunity towards errant processes leaking memory among other things.
Yes, of course. And that's why this is a welcome feature.
There is a reason why inProc is the default mode, because it works
best for a large number of applications. If you recommend switching
modes, you should have a sound reason and thoroughly understand the
consequences such as performance degradation occuring when session
passes thru the serialization/deserialization layer.


I think the vast majority people don't "thoroughly understand the consequences"
of leaving session state at InProc. The AppDomain/worker process recycle
a heck of a lot more than people realize and if your app relies upon session
state, then the robustness of keeping the data out of proc is the price to
be paid. As I said in my earlier post, I recommend avoiding session state
all together if possible.

But the reality is that most performance problems come from bad SQL and inefficient
trips to the database. Of course there is overhead to the StateServer Service
but if you're using InProc session state, then you'd only be making a cross
process call, as the StateServer Service would/should be configured on the
same machine. The overhead of the local access to the StateServer is dwarfed
by the network latency of hitting the DB.

As with anything, understand what you're doing. As far as performance, correctness
comes first. Don't optimize until you've profiled.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: grw | last post by:
Im trying to find why my hosted server won't maintain session state. Its not a web farm (not load balanced), its all the same server An application requires a session to be set and then recalled...
5
by: LL | last post by:
Hi, Where is the best place to check the session's object, if it's null, then redirect the user to login page? put into every page's load event? Thanks.
3
by: Leon | last post by:
Is it a good idea to load a user username/email and password into session state if you will be validating information against those credential through-out the use of the web application? or is it...
2
by: adam | last post by:
Having spent nearly 2 years in win forms land the inevitable request came for me to "do some web pages". So being new to this bit of .net and having had a look around I can't see where the best...
7
by: Seth | last post by:
I have noticed that the id of my session object changes when I switch from a non-secure to a secure connection. What I'm trying to do: I have a cookie that is built on the non-secure side of...
8
by: karahan celikel | last post by:
I realized that when SqlServer mode is used for session management Session_End event is not fired in global.asax. What can I do if I want to do something when a user's session end? Thanks
4
by: Daniel | last post by:
Hi I am having a problem sharing session between SSL and non-SSL asp.net pages I have F5 BigIP with sticky sessions working fine, but the problem is tha sticky session applies at the port level...
1
by: Carl Gilbert | last post by:
Hi I would like to know that best way of adding data to the session state object. I have a page with a series of links such as: designs.aspx?categoryID=1 designs.aspx?categoryID=2 When I...
2
by: LarryTheSoftwareGuy | last post by:
Folks, Would love some suggestions re what design patterns to use for this situation. I need to create a simple FSM. A certain login scenario will behave differently based on the following:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.