Wednesday, March 28, 2012

Strange caching behaviour with ASP.net 2.0

Last month we upgraded our production server from .net 1.1 to 2.0. We have
seen some odd behaviour that we do not know how to fix.
It seems that Cache is reset or cleared. We have 2 or 3 global entries in
the the cache with the NotRemovable flag set. I have set up a callback that
writes an entry to the event log to see if the Cache is cleared. It appears
that it is. This happens (randomly) several times a day. I changed our globa
l
entries to use Application state however this just seemed to amplify the
problem.
Could this be a bug with 2.0 or does a server setting need changing
somewhere (it is a windows 2003 server)?
I do not know if the cache is being reset, causing the application to crash,
or something is causing the application to crash, resulting in the cache
being reset (I have added the LegacyUnhandledExceptionPolicy enabled="true"
attribute to the web.config with no joy)
At the same time that an entry is written to say the cache has been cleared,
the performance monitor registers requests /second at 286,000,000
If anyone has experienced similar issues, can shed some light or point me in
the right direction it would be greatly appreciated.
Kind Regards,
Darrencheck the event log for asp.net recycle events. maybe you app is using too
much memeory. you should never count on a cache persistance, the fetch logic
should always handle cache empty case.
-- bruce (sqlwork.com)
"Darren Newton" <Darren Newton@.discussions.microsoft.com> wrote in message
news:2DD4A241-C2B7-44EE-9CF2-06B9BDC65B21@.microsoft.com...
> Last month we upgraded our production server from .net 1.1 to 2.0. We have
> seen some odd behaviour that we do not know how to fix.
> It seems that Cache is reset or cleared. We have 2 or 3 global entries in
> the the cache with the NotRemovable flag set. I have set up a callback
> that
> writes an entry to the event log to see if the Cache is cleared. It
> appears
> that it is. This happens (randomly) several times a day. I changed our
> global
> entries to use Application state however this just seemed to amplify the
> problem.
> Could this be a bug with 2.0 or does a server setting need changing
> somewhere (it is a windows 2003 server)?
> I do not know if the cache is being reset, causing the application to
> crash,
> or something is causing the application to crash, resulting in the cache
> being reset (I have added the LegacyUnhandledExceptionPolicy
> enabled="true"
> attribute to the web.config with no joy)
> At the same time that an entry is written to say the cache has been
> cleared,
> the performance monitor registers requests /second at 286,000,000
> If anyone has experienced similar issues, can shed some light or point me
> in
> the right direction it would be greatly appreciated.
> Kind Regards,
> Darren
>
Thanks for your reply.
The logic always checks if the cache item exists and repopulates if
necessary. The code worked fine in 1.1 and didn't change when we moved to
2.0. The cache doesn't appear to be repopulating - if an exception occurs th
e
details are e-mailed to us. The details we receive would suggest that the
cache is empty.
I have been looking through the event log but there is nothing to suggest
asp.net is being recycled.
"bruce barker (sqlwork.com)" wrote:

> check the event log for asp.net recycle events. maybe you app is using too
> much memeory. you should never count on a cache persistance, the fetch log
ic
> should always handle cache empty case.
> -- bruce (sqlwork.com)
> "Darren Newton" <Darren Newton@.discussions.microsoft.com> wrote in message
> news:2DD4A241-C2B7-44EE-9CF2-06B9BDC65B21@.microsoft.com...
>
>

0 comments:

Post a Comment