Lesson 4: Monitoring Cache Performance

Lesson 4: Monitoring Cache Performance

To use caching effectively, you must balance three factors:

  • Available memory

  • Frequency of requests for specific items

  • Volatility of those requested items

To enable you to weigh these factors, ASP.NET provides caching performance counters that you can use to monitor how items are served from the cache. In this lesson, you ll learn how to use the Microsoft Management Console (MMC) Performance Logs and Alerts snap-in to monitor how effectively caching is used within your application.

After this lesson, you will be able to

  • Monitor an application s use of caching for Web forms and user controls

  • Monitor an application s use of caching for application data

  • Use the Turnover Rate counter to flag inefficient use of caching

Estimated lesson time: 5 minutes

Using the Performance Monitor

You can use the Performance Logs and Alerts snap-in to view the number of cache entries, the number of cache hits, and the ratio of requests served from the cache at the application level. These performance counters can help you evaluate the effectiveness of your caching policy.

For information about starting and using the Performance Logs and Alerts snap-in, see Lesson 3 in Chapter 9, Building and Deploying Web Applications. ASP.NET provides cache performance counters for individual Web applications. To monitor the cache performance counters for a Web application:

  1. From the Performance Logs and Alerts snap-in, click the + (Add) button. The snap-in displays the Add Counters dialog box, as shown in Figure 12-1.

    figure 12-1 adding cache performance counters for an application

    Figure 12-1. Adding cache performance counters for an application

  2. From the Performance Object list, select ASP.NET Applications, and then select the cache counters from the counters list and the application to monitor from the instances list.

  3. Click Add to add the selected cache counters to the monitor.

  4. Click Close when you have finished adding counters to the snap-in.

Choosing Cache Performance Counters

ASP.NET provides three categories of cache performance counters:

  • Cache Total counters

    Return statistics that combine cached Web forms, user controls, application data, and internal use of the cache by ASP.NET.

  • Cache API counters

    Return statistics representing application data stored in the Cache object.

  • Output Cache counters

    Return statistics representing Web forms and user controls stored in the cache.

Table 12-6 describes the individual performance counters available for each of these three categories.

Table 12-6. Cache Counters

Counter

Description

Entries

Number of items that are currently cached

Hits

Number of requests served from the cache

Misses

Number of requests for cached items that could not be served from the cache

Hit Ratio

Number of hits divided by the number of misses

Turnover Rate

Number of new entries plus the number of removed entries per second

You can use the preceding counters to determine whether an application uses caching effectively. For example, if there are a lot of entries in the output cache, but the hit ratio is very small, your application might be caching Web forms that are not frequently used. If the turnover rate is very high, your server might want to reduce the number of items you store in the cache, make the period they are stored in the cache longer, or increase the memory available on your server.



MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[.  .. ]0-315
MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[. .. ]0-315
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net