[Looking for Charlie's main web site?]

Understanding (and monitoring) the CF template cache

Note: This blog post is from 2006. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
Adobe CF team member Ashwin has posted an entry offering some useful insights into the inner workings of the CF template cache. More detail from Adobe folks is of course always welcome. Thanks, Aswin.

I've posted a comment there about how to measure and report on whether and when template cache misses occur. (Again, read his post for more on what a means.)

I would have posted it as a trackback from here, but I don't see how to do that in BlogCFC. So instead, I'm pointing you to it this way. :-)

To save you the trouble, if you just want to know how to measure it, here's what I wrote:

Thanks, Ashwin. More detail from Adobe folks is of course always welcome.

But I do think it's useful to point out also how one can measure and report on whether and when template cache misses occur. There are at least two.

First, it's reported in the command-line CFSTAT tool as CP/Sec (for cache pops per second), and reports both a current and highwater mark. (Of course, you must enable CFSTAT support in the CF Admin, and the cfstat is in the cfusion/bin or cfusionmx/bin.)

It's also reported in the Windows Performance Monitor, by way of the ColdFusion/ColdFusion MX "performance object" counter called "Cache Pops/Sec" (again, assuming that you've enabled Perfmon support in the CF Admin).

With perfmon's ability to create logs and alerts, it should be easy for someone to create a mechanism to track if you ever have a non-zero value, which would suggest increasing the template cache size.

I meant also to mention that there is an old but still useful Allaire technote offering some more insight into caching, including using CFSTAT and more.

For more content like this from Charlie Arehart: Need more help with problems?
  • If you may prefer direct help, rather than digging around here/elsewhere or via comments, he can help via his online consulting services
  • See that page for more on how he can help a) over the web, safely and securely, b) usually very quickly, c) teaching you along the way, and d) with satisfaction guaranteed
Related Blog Entries

As an update to this, it turns out that since CFMX 6, CF no longer reports the cache pops stat in either CFSTAT or Perfmon. What a bummer. We had it prior to 6, but not since. See the comments in the blog entry linked to above, for more discussion.

At least if one is on CF8 Enterprise or Developer edition, there is info in the CF8 monitor that can report (via Statistics > Request Statistics > Template Cache Status) both how large the template cache is, and what the hit ratio is.

It's not quite the same as the CFSTAT or perfmon reporting, but at least one could use the CF Admin API (on CF8 Enterprise or Developer) to access the info programatically to report/log/alert on it.
# Posted By Charlie Arehart | 3/22/08 10:41 AM
Copyright ©2020 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the html in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting