bpurcell.org - CF_Accelerate Caching Admin Beta Available
Calendar
SunMonTueWedThuFriSat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing

Site Contents
Home
My Blog
ColdFusion
JRun
Flex
Wireless & Networking
Hardware & Gadgets
HDTV
Software Picks
Pictures
Contact Me
Search


My Articles & Papers
Flex Performance
Server/Client
mm.com Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate

username:
password:
 

 
Viewing Individual Entry / Main
November 10, 2004
I have had a lot of requests for the CF_Acclerate admin code and I have just been too busy to finish it. Either way I will go ahead and release it as is. Also after talking to a lot of people at MAX I promise to start posting more info on CF and Flex in the  next couple of months :-)

This version of the CF_Accerlate admin was written early on during the development of CF_Accelerate and has not had any features added since. Feel free to modify anything and send me a note with feature additions I will integrate changes in that you feel are useful

Features:

Cache Viewer

  • Lists all cached trees and lets you drill down to individual entries
  • Prune a tree at any level or an individual cached entry
  • View the contents of an individual cached entry
  • View the cache date/time, expiration date/time and the content length of a cached entry
  • Add and remove URL's to the cache auto-refresh feature (stored in WDDX file)

Cache Skimmer (Cleans expired Cache)

  • Examines all cached entries and clears out expired cache to manage memory
  • Allows you to (one-click) create a scheduled task that invokes the Skimmer every X minutes
  • Add URL's in the admin to auto-refresh with CFHTTP when the skimmer runs, this keeps the cache fresh

Cache Statistics

  • View total number of Cache entries
  • View detailed number of cache entries for each tree

To install the admin

  1. Extract the zip to your webroot I used /cacheadmin
  2. Modify the Application.cfm file to include your existing Application.cfm file, the admin needs to run in the same scopewhere CF_Accelerate is running to pick up the changes.

The skimmer is a feature that everyone using CF_Accelerate should take advantage of. I have heard complaints of CF_Acclerate hogging memory over time. That is because it does not clean itself out when the cache expires. The skimmer will go through and evaluate all the cached  entries in the tree and clean the cached key using structDelete(). This will allow you to reclaim your memory. It is a pretty simple process  to put this in place

  1. Wherever you installed the admin you will see a subdirectory /cacheadmin/skimmer/ modify the /skimmer/Application.cfm CFINCLUDE so it points to you Application.cfm of the application where you are using CF_Accelerate
  2. You can either add the scheduled task manually pointing to /cacheadmin/skimmer/pruneExpiredCache.cfm or you can use the feature in the CF_Acclerate admin to automatically add it.  If you go to the main page in the admin you will see a link on the left "Skimmer Scheduler". This will bring up a page in the right frame to add the scheduled task that will run by default every 10 minutes. Verify the URL and click the Scheduled Task button.

Thats all that is needed to keep your cache free of stale entries and free up your memory.  I hope this helps you and let me know of anything you think of adding. My time is limited so feel free to provide the code and I will integrate it.

You can dowload the latest version here.

Comments

Brandon,

Freakin' awesome. Thanks for putting this together!


The tag contains a possible (altough small) risk of filling up your memory. A intensive cfhttp loop with bogus url variables could fill up the cache very quickly so it is important when you use this tag, you check for the provided url variables given to the template and if they are valid input parameters for the template, or else those get cached too. Maybe a future feature request, to abort the caching process on executionMode "end" in case of an invalid call to the template.


M. Schopman, You could check in top of your page right before you call CF_Accerlate. If the URL parameters are outside of what you expect, pass the attribute to CF_Accerlate to not cache the page. There are probably several ways to accomplish this but it should be avoidable.

You could also override the default caching scheme and build your own unique keys that do not rely on the URL parameters.


Dear god, is there nothing this man cannot do.

For this alone, i wish to inform all that bpurcellfanclub.com will come post forth with nowwith! :)

really cool app.


Those are good options to prevent mass caching of bugs stuff also yes. For generic use you could think of aborting the cache process when you notice something is not right (like when you use a framework around the cache tag where you cannot check all variables before the cache tag has been started).

Whatever caching method you use, you'll always have to make sure these circumstances are avoided whenever possible. :) Just wanted to put that in as a sidenote for caching overall.


I've extended CF_Acclerate so that cached content can be optionally stored in the file system, rather than in shared memory. From the updated docs:

"File-based caching reduces the performance advantages of in-memory caching, but will still yield significant improvements in most cases (file IO is almost always cheaper than database access, for example) and exerts minimal impact on your application's memory requirements. CACHEDIR must be a ColdFusion-writeable directory and should be stored outside the web root if your cache contains sensitive content. It is recommended that STRIPWHITESPACE is set to 'true' when file-based caching is enabled, to minimise file IO. Note that the Application scope is still used to persist cache meta-data (scriptname and expiry)."

Version 1.4 of CF_Accelerate, which contains this update, can be downloaded at <a href="http://www.throwingbeans.org/cf_accelerate_1.4.zip">"http://www.throwingbeans.org/cf_accelerate_1.4.zip</a>. (Brandon, you're welcome to merge these changes with your distribution.)


First, I think your postings are some of the most valuable on the net, thanks for your contributions to shared wisdom.

Second, I've been trying to track down how to better manage our CF Scheduler tasks. I have a whole database engine configured in CF to support, maintain, track, notify on failure; however, the web tasks running out of CF Scheduler are manually managed. I would like to access job execution information somehow. I can't find any way to store the execution history to a database. The file log is so prehistoric.

I currently have a two pairs of apache 2.0 clusters, pointing to a cluster of two JRunx/CFMX7, each running two CFMX services ( overlapping. ). All running on SuSE Linux, 64bit xeons. I'm trying now to automate problem detection/notification in so many areas, I had expected more out of this scheduler, especially since its in all-powerful Java. :)

Well, I don't expect a response, knowing you're certainly busy. Thanks again for the great content!

Best regards, Len Nagy


I wanted to know how to structure the refreshUrls.wddx Could you post an example that contains several urls in it?

Thanks Em


 
Page Render Time:219