« Previous Next »

Thread: ARR v2 Beta 2 Disk Cache Statistics

Last post 08-25-2009 4:23 PM by wonyoo. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 08-25-2009, 10:07 AM

    ARR v2 Beta 2 Disk Cache Statistics

    I have a question regarding IIS manager disk cache statistics with ARR v2 Beta 2.   

    I have a single ARR with a single node server farm in my testing scenario.

    When I look at Disk Cache Statistics under the server farm Monitoring and Managment form, I see the current cache statistics.

    When I go back to the server level and look under the Application Request Routing Cache form, the Disk Cache Statistics are always zero. 

    Is this a problem with the statistics or an error in configuration?

    Thanks in advance,  Jim

  • 08-25-2009, 10:32 AM In reply to

    • wonyoo
    • Top 50 Contributor
    • Joined on 12-15-2007, 1:46 PM
    • Posts 125

    Re: ARR v2 Beta 2 Disk Cache Statistics

    That is somewhat of a confusing user experience that we are trying to correct in post Beta2 release.

    What are you seeing is the correct behavior for ARRv2 Beta2.  ARR has two different "types" of proxy - one is at (what we call) server level and the other is at (what we call) server farm level.  When it comes to cache stats, they are completely mutually exclusive (One would think that server level is an aggregate of server farm level, but it's not.)

    So, if you only have server farm level proxy enabled (as is the case with your environment), then you will only see the stats at the server farm level monitoring and maangement (and the server level monitoring and management will always be zeros.)

    Functionally, it's all working correctly as designed (for ARRv2 Beta2) - but it is a confusing UI/user experience - which we are correcting in next release milestone.

  • 08-25-2009, 11:02 AM In reply to

    Re: ARR v2 Beta 2 Disk Cache Statistics

    Won,

    Thanks again for the quick post back. 

    I have a following questions regarding Farm level statistics and the Memory Cache Duration setting on the Caching form on the Server farm features menu. 

    I have tried a few different settings for Memory Cache duration, but have not been able to see is a request was processed from memory or disk. 

    Am I just missing a simple perfmon counter some where?

    Jim

  • 08-25-2009, 11:09 AM In reply to

    • wonyoo
    • Top 50 Contributor
    • Joined on 12-15-2007, 1:46 PM
    • Posts 125

    Re: ARR v2 Beta 2 Disk Cache Statistics

    Jim

    The memory cache is done at the kernel level.  You could have a netmon between ARR and the content server to see if you actually see the cache hit.

    A simpler way would be to type the following on an elevated command prompt (which will show you what's stored in kernel cache.)

    netsh http show cache

    If the object is "cacheable", then the Windows kernel will cache the content.  ARR leverages this feature and changes the duration when appropriate.  That said, if you have a content cached for 5 seconds and changed it to 50, the change won't impact what's already cached.  It has to be invalidated (ie. the 5 seconds must expire) before the change (50 seconds) takes effect with the next "cache-miss" request.

    Now, if you see your content in the responses from above command, you can trust us that it's being served from memory :).

    Does that help?

  • 08-25-2009, 11:23 AM In reply to

    Re: ARR v2 Beta 2 Disk Cache Statistics

    Won,

    Thanks that was great. 

    To carry over an idea from our other thread (http://forums.iis.net/t/1160295.aspx) I assume that irrespective of whether the object is cached in memory or disk, the object invalidation process with be the same.  The cached object will always be served to the requesting user first then checked for accuracy as a secondary task.

    Jim

  • 08-25-2009, 4:23 PM In reply to

    • wonyoo
    • Top 50 Contributor
    • Joined on 12-15-2007, 1:46 PM
    • Posts 125

    Re: ARR v2 Beta 2 Disk Cache Statistics

    With memory (and in conjuction with disk), it works slightly differently.  Let me see if I can clarify.

    Let's suppose that the memory cache interval is set to 5 seconds (default value.)

    The flow would be something like:

    1) Request is received by Windows server (http.sys, actually).

    2) Cache miss at the kernel

    3) Request forwarded to IIS/ARR

    4) Cache miss at the disk

    5) Request forwarded to origin and content received by IIS/ARR

    6) Content cached to disk

    7) Content cached to memory (for 5 seconds)

    (Note that this is a two tiered caching system - and not counting the extreme corner cases, what's cached in memory will almost always be a subset of what's cached on disk.)

    At T + 2 seconds

    8) Same request received by Windows

    9) Cache hit at memory (by http.sys)

    10) response sent to the client

    At T + 6 seconds (greater than the configured 5 second value)

    11) SAme request received by Windows

    12) Cache miss at memory (for memory caching, it will unload the object when it doesn't need it.  This is one of the core differences between memory caching and disk caching.  Memory is more scarce than disk - so after 5 (or configured) seconds, they are unloaded.  They may be unloaded more aggressively depending on memory consumption, etc but that's all managed by kernel.)

    13) Request forwarded to IIS/ARR

    14) Disk cache hit (and it will also check for the freshness)

    15) Content cached once again in memory (for 5 seconds - or configured value).

     

    Hope that explains.

Page 1 of 1 (6 items)
Microsoft Communities