ColdFusion Muse

Checking the Size of the Spool Directory on Windows

Mark Kruger November 11, 2008 12:51 PM Hosting and Networking, Coldfusion Troubleshooting Comments (2)

If you ever send out a few tens of thousands of messages using CF you know the spool directory can get pretty crowded. If you are like me you sometimes want to keep an eye on it as those messages clear out to make sure there is nothing funky going on. If you use Windows Explorer this can be a maddening experience. Windows doesn't just retrieve a count of files. It retrieves the entire file list and meta data and it redraws the explorer window. When you have 50k messages in the spool folder it can take 10 to 30 seconds just for Windows to refresh the count so you can know how many were added or deleted to the folder.

Instead, I use a little tool called "t4edirsize" from tools 4 Ever. I have a "show spool" batch file on my servers that looks like this:


t4edirsize.exe d:\cfusion8\mail\spool
The output gives me all sorts of information including the number of files in the directory - but it usually only takes 50-200 milliseconds to run. Tools 4 ever command line tools along with Sys-Internals tools (now owned by Microsoft) like "pslist" and "pskill" are essential to your arsenal as a troubleshooter.

  • Share:


  • jc's Gravatar
    Posted By
    jc | 11/11/08 11:14 AM
    I usually set mine to pause for X seconds after Y messages if I'm doing more than a couple thousand. Of course, I also usually get the networking guy to stop outgoing email from my server until the whole thing has left the spool so if something DOES go wrong and I have to resend the message, there's no overlap.

    the maddening thing for me is how CF won't try to resend messages on its own, when so, so often they fail for silly, short-term reasons like a brief network hiccup. I have a script that runs nightly and tries to resend anything under 14 days old and then archives them off after 14 so I can look at them, but it'd be nice if CF at least had a ---try to send a message again in 10 minutes if it fails--- option built in...

    Hmm... my message appears to be a hack attempt. I don't even have any source code in here.
  • jc's Gravatar
    Posted By
    jc | 11/11/08 11:15 AM
    "try to send a message again in 10 minutes if it fails"

    It seems to have choked on that. Will it do so again?