ColdFusion Muse

Scheduled Task Performance

So you have a template that runs fine when you are loading it into a browser but runs like a water buffalo on Percodan when it's run as a Coldfusion scheduled task? Here's a tip I saw on CF-Talk that serves as a good reminder. Take a look at the debug settings. By default, debugging includes the address (often called the "loopback" or "local" address). Coincidentally this is the very IP address that the Coldfusion Scheduler will report as the calling address (cgi.remote_addr) - meaning the template in question will generate all of that lovely debug information. This can result in an otherwise acceptable level of performance turning painfully slow. Muse rule of thumb - disable debugging in production environments. Ok... so sometimes I enable it briefly to get some information when I'm troubleshooting a specific process, but it should always be off during normal operations.

Let me add as an anti-thesis, turn on debugging in a development environment. It's surprising how many developers work without it. Personally, I spend more time looking at the debug info than the actual output. One of the first things you should do when writing a new query for example, is check it out in the debug. How many records returned? How long did it take? Can I make it better? One of Coldfusion's big advantages (in my view) is the copious amount of debug information provided for you with each request. Use it!

  • Share:


  • todd sharp's Gravatar
    Posted By
    todd sharp | 3/19/08 11:28 AM
    +1 on the 'debug is underused' statement. Can't agree more that at the very very bare minimum it should be on and used copiously.
  • JC's Gravatar
    Posted By
    JC | 3/21/08 6:08 AM
    ........ d'oh!

    Suddenly the reason why my routines that gzip log directories and robocopy them are a bit pokey makes a tad more sense. Thanks :)