Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

The "cfcache" “cfcache” tag in Coldfusion 9 can help with load spikes related to traffic.  This can add complexity to a site and should only be used if necessary (do not over optimize!).

...

In my very rudimentary tests it made a simple page that queries a database run faster (3.4 ms per request vs. 6.1 ms per request).  For spikes like an announcement this could be a pretty big win.  The best optimization is to convert to a static HTML page or using SSI, but that isn't isn’t always possible.  A static page was similar to the performance of using cfcache (3.5 ms).

There could be other issues with using cfcache (exhaust memory, bad cache hits, etc...etc…), but it could be a good back pocket option and one to explore.

Here's Here’s the example code that I did:

...

% ab -c 50 -n 5000  "vanilla cfm site"

...

unmigrated-wiki-markup

Time per request:              6.194 \ [ms\] (mean, across all concurrent requests)

...

 (using cfcache)

<cfcache

    timespan="#createTimeSpan(0,0,10,0)#">

...

% ab -c 50 -n 5000 "cfcache page"

...

Time per request:       Wiki MarkupTime per request:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.400 \ [ms\] (mean, across all concurrent requests)

...

(static HTML)

testcf9-vhost

<pre>

To be, or not to be, ...pre> …pre>

% ab -c 50 -n 5000 "static html page"

...

Time per request:       Wiki MarkupTime per request:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.573 \ [ms\] (mean, across all concurrent requests)

...