HighTechTalks DotNet Forums  

ASP.Net caching in web garden scenario

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss ASP.Net caching in web garden scenario in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
mk
 
Posts: n/a

Default ASP.Net caching in web garden scenario - 04-15-2005 , 05:47 PM






if we configure an ASP.Net application pool with more than one worker process
(web garden), they do not share session object, application object or ASP.net
intrinsic cache object. If I want all these processes to share one single
cache, is it possible to configure at all some way or the other?

My problem is I am using Application (HttpApplicationState) object for
caching. And if this not going to be shared across worker processes in an
application pool, then when I have to invalidate some entries in cache as the
data is not valid any more, I cannot delete entries in all caches at one
time. Only the worker process that handled the request would clear its cache
entries and the rest of the processes still have invalid data.



What is the best way handling this scenario?



Reply With Quote
  #2  
Old   
Alvin Bruney [MVP - ASP.NET]
 
Posts: n/a

Default Re: ASP.Net caching in web garden scenario - 04-15-2005 , 07:51 PM






You can implement a notification system that basically notifies all the
cache objects in the garden to refresh themselves. I've seen this
implemented, but it was prone to failure.

If you architecture is that complicated, you need to move cache to a
database or a queue system

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"mk" <mk (AT) discussions (DOT) microsoft.com> wrote

Quote:
if we configure an ASP.Net application pool with more than one worker
process
(web garden), they do not share session object, application object or
ASP.net
intrinsic cache object. If I want all these processes to share one single
cache, is it possible to configure at all some way or the other?

My problem is I am using Application (HttpApplicationState) object for
caching. And if this not going to be shared across worker processes in an
application pool, then when I have to invalidate some entries in cache as
the
data is not valid any more, I cannot delete entries in all caches at one
time. Only the worker process that handled the request would clear its
cache
entries and the rest of the processes still have invalid data.



What is the best way handling this scenario?





Reply With Quote
  #3  
Old   
Brock Allen
 
Posts: n/a

Default Re: ASP.Net caching in web garden scenario - 04-16-2005 , 07:29 AM



The problem is that each application in IIS is a seperate AppDomain in .NET
and objects in .NET are scoped to AppDomains, meaning an object (or a cache
object, for example) can't span the AppDomain boundary. You'll have to build
your own custom cache.

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



Quote:
if we configure an ASP.Net application pool with more than one worker
process (web garden), they do not share session object, application
object or ASP.net intrinsic cache object. If I want all these
processes to share one single cache, is it possible to configure at
all some way or the other?

My problem is I am using Application (HttpApplicationState) object for
caching. And if this not going to be shared across worker processes in
an application pool, then when I have to invalidate some entries in
cache as the data is not valid any more, I cannot delete entries in
all caches at one time. Only the worker process that handled the
request would clear its cache entries and the rest of the processes
still have invalid data.

What is the best way handling this scenario?





Reply With Quote
  #4  
Old   
mk
 
Posts: n/a

Default Re: ASP.Net caching in web garden scenario - 04-18-2005 , 09:20 PM



Thanks for your time!

I am thinking about creating a CacheDependecy (some file) at the web server
root level so that all worker processes can access.

And in my code, I am planning to cache all my objects in ASP.Net cache
rather than application cache and add that file as a cache dependency for all
cache objects. And to clear all cache entires, I will change the timestamp of
the file at web server level and hoping it would clear all the entries in all
caches (in all worker processes).

Is this design going to work and if it works are there any known flaws with
this design?

Thanks,
MK


"Alvin Bruney [MVP - ASP.NET]" wrote:

Quote:
You can implement a notification system that basically notifies all the
cache objects in the garden to refresh themselves. I've seen this
implemented, but it was prone to failure.

If you architecture is that complicated, you need to move cache to a
database or a queue system

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"mk" <mk (AT) discussions (DOT) microsoft.com> wrote in message
news:2C0DE4C6-C207-4F30-8446-82C3F8086CE7 (AT) microsoft (DOT) com...
if we configure an ASP.Net application pool with more than one worker
process
(web garden), they do not share session object, application object or
ASP.net
intrinsic cache object. If I want all these processes to share one single
cache, is it possible to configure at all some way or the other?

My problem is I am using Application (HttpApplicationState) object for
caching. And if this not going to be shared across worker processes in an
application pool, then when I have to invalidate some entries in cache as
the
data is not valid any more, I cannot delete entries in all caches at one
time. Only the worker process that handled the request would clear its
cache
entries and the rest of the processes still have invalid data.



What is the best way handling this scenario?






Reply With Quote
  #5  
Old   
mmtltd
 
Posts: n/a

Default Re: ASP.Net caching in web garden scenario - 11-15-2005 , 07:26 AM




Hi - I'm thinking about the same design as we have two web servers
sharing session state but not caching. It is exactly the same problem -
it's mainly invalidating caches that we need a solution for for instance
if data gets modified one server will still hold a cached old copy.

Did you get anywhere with this design?



--
mmtltd
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.