Skip to main content
September 2, 2009
Question

Question about template caching

  • September 2, 2009
  • 2 replies
  • 894 views

Hi all,

We are trying to reduce the amount of network IO on our file server and we can see that a very large amount of this is coming from our webservers reading Coldfusion source code. We were under the impression that Coldfusion compiled and cached the source code in memory and we were not expecting to see this amount of traffic.

We did some reading up on the subject and it looks like Coldfusion does indeed compile and cache the source code but the way it does this is very configurable. I read the articles http://blogs.sanmathi.org/ashwin/2006/07/12/tangling-with-the-template-cache/ and http://www.adobe.com/devnet/server_archive/articles/server_caching_cf.html which explain how if the maximum number of cached templates is too small then the cache will remove old templates when new ones are requested which would lead to additional file access. We do have a very large number of .cfm files so this sounded like a plausible problem.

However, after checking cfstat for the 'cache pop' rate (as indicated in the above article) it is saying that it is -1.

I can't find any information on what -1 means and it wasn't what I was expecting! Does anyone know?

Thanks

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    September 4, 2009

    However, after checking cfstat for the 'cache pop' rate (as indicated in the above article) it is saying that it is -1.

    I can't find any information on what -1 means and it wasn't what I was expecting! Does anyone know?

    I don't know, but can guess. I think -1 is just the default initial value of cache-pops per second (CP/sec), and that it is distinct from the threshold value 0. I see a clue in the documentation,

    If the cache becomes full, the cache is forced to purge templates on a first in first out basis to accommodate new requests. As a result, the next time the purged template is called, it must be recompiled. This purging is referred to as a cache pop [CP] and can be seen when monitoring CFSTAT. If ever CP/Sec is greater than 0, Allaire recommends that the "Template Cache Size" setting be increased.

    An initial value of -1 is -60 CP/minute. That implies, by the time you're  worrying about increasing the template cache size,  that is, by the time the reading is 0, Coldfusion is purging the templates at a rate that exceeds 60 pops per minute.

    Inspiring
    September 2, 2009

    We are trying to reduce the amount of network IO on our file server

    This doesn't really answer your question, but I would be really hesitant about storing your CF files anywhere other than on the machine that's serving them (ie: on the server's local HDDs).  One doesn't really want the overhead/bottleneck of all the access checking shennigans that comes as part of having files on network storage.

    --

    Adam

    September 3, 2009

    I know what you are saying but we have 18 web servers in our load balancer to handle the traffic. Having 18 local versions of the source code would be a nightmare to manage.

    Inspiring
    September 3, 2009

    In situations like these, the (performance) impact to my users always trumps how much of a pain in the butt something might be for me to implement.

    Updating code across multiple servers only impacts me, and only fairly infrequently (ie: when it's time to do a release).  The performance hit of serving the files across the wire impacts everyone, on every mouse click.

    But still, if the users aren't perceiving the performance degradation, then NP I guess.

    And equally, far be it for me to be telling you how to run your system.  I'm simply offering my position on said situation.

    --

    Adam