I don't see duplication of the data on 2 servers as a problem, unless
you expect the data to be updated by users during the execution of the
application. Then it becomes a big problem, as you try to keep the
servers in synch. Using session wouldn't help solve that problem either.
I don't know any specific performance documentation, but I'm pretty sure
you would not want to use the State Server for application wide data,
since it would cause the data to be repeated and stored individually for
each user session.
Remember, you usually only want to cache data results when it more
expensive to retrieve them from the original source. If you start
making a bunch of trips to retrieve the cached data, or use a lot of
memory for it (copying the same values to every session on every
server), you are probably hurting yourself more than helping.
I would not be afraid to make a single call to populate the ASP.NET
cache on each server on a web farm.
kanones wrote:
Thanks for the reply. The data is not user specific so I was leaning towards
application cache but I was concerned because of the web farm architecture
and hence the data being duplicated on the servers. Have you run across any
documentaion on performance metrics for this? Is State Server ONLY for
session/user specific data?
Thanks
Kan
"Joshua Flanagan" wrote:
It depends on how the data is used. Is it common to all users, or is
different data retrieved for each user?
If it is common to all users, using the ASP.NET Cache is probably the
best option. Yes, it will be retrieved once for each server in a farm,
but that is a pretty low cost to pay.
If the data is specific to each user, you should probably use
out-of-process Session. You can configure session to use the Session
State service or SQL Server in your web.config file. Programmatically,
you just use the Session object like you normally do. With
out-of-process session, it wont matter which server in the web cluster
the user is on; their data will be available.
Joshua Flanagan
http://flimflan.com/blog
kanones wrote:
I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?
Any help on this matter is greatly appreciated.