How to Automatically Detect That Debugging Is Active in Production

By now you should know that it's best practice to keep debugging turned off on production servers. Even when debugging is restricted by IP, ColdFusion busily goes about collecting debugging information for every page request, even though it's not displayed on the screen. All this extra activity tends to slow down the server a bit, particularly if you have "Report Execution Times" selected. Under load, having debugging turned on can have a serious impact on performance. Even in development, turning on "Report Execution Times" can have a significant impact if alot of developers are sharing one dev box.

So you know you should have it turned off in production, but inevitably you're going to need to debug something in production sooner or later, and turn that evil debugging switch back on for a moment. Occasionally you're going to forget to turn it back off. Occasionally the wrong person gets access to the CFAdmin and turns it on just because they don't know any better. However it happens - chaos, anarchy, and mass confusion are likely not far behind.

Wouldn't it be nice to be able to automatically detect that debugging it turned on and send yourself a notification or alert so you can shut it back off? Oh, but you can! Here are a couple of code snippets that you can drop into your Application.cfm or Application.cfc file to fire off an alert to yourself.

Or, if you want to get a little more complicated and detect that template execution times are being calculated (maybe on a busy dev box), you can try this one:

Both of these should work in CF6 and above, but I've only tested them on CF8.

Comments (0)

How to Automatically Log Off Disconnected Remote Desktop / Terminal Services Sessions

I've frequently heard complaints about people forgetting to log off when they end a Remote Desktop session. Instead they simply close the window, leaving their session running on the server. This orphaned session becomes a problem in many cases because Windows Servers are typically only licensed for two simultaneous logged in users. Even worse, if you can't remote into the box, you may not be able to easily identify the culprit(s) who left their sessions active. This leaves you no-one to throw things at and generally a very grumpy person.

Fortunately there is a solution to this problem...

You can configure Terminal Services to terminate abandoned sessions fairly easily on Windows 2000 and 2003 servers by doing the following:

  1. On the server, go to "Start > Programs > Administrative Tools > teminal Services Configuration"
  2. Select "Connections", then right click on RDP-Tcp and select Properties
  3. Select the Sessions tab and Check the "Override user settings" checkbox.
  4. Choose the criteria under which you'd like to start killing off sessions.

That does it!

Comments (7)

High Scalability: 14 Best Practices From Yahoo

Via the High Scalability blog, the Best Practices for High Scalability article and YouTube video presentation is worth checking out. Some of it's review, but there are alot of interesting metrics and data points in the video from Yahoo's Exceptional Performance Group. You may know you need to do certain things to make a site perform well, but those metrics can help you measure the real potential impact.

Note: There are some audio problems in the first couple of minutes of the video, but wait it out, it does get better.

Comments (2)

Flex 3 Final - Run Air App and Nothing Happens

I just ran into a somewhat frustrating to debug problem with running the final release of Flex builder. I just upgraded to the final release version of Flex Builder 3 from a beta version, and I found that suddenly my AIR projects would no longer run from the IDE. When I clicked the "Run As Adobe AIR Application" button - nothing happened. No error, no nothing, it just doesn't seem to do a thing. Then I tried running the running the app in debug mode and got this error:

Process terminated without establishing connection to debugger.

Command:

"C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.0.0\bin\adl.exe"
C:\wwwroot\MyApp\bin-debug\MyApp-app.xml 
C:\wwwroot\MyApp\bin-debug 

Output from command:

invalid application descriptor: descriptor version does not match runtime version

After a little Googling around and hitting a few dead ends, I finally found the simple solution on this post on Brian Rinaldi's Blog. For any AIR apps you created in earlier versions of Flex builder, you're going to want to take a look sat the application's xml descriptor and make sure it matches the version of the AIR runtime you are developing for. Just open up the descriptor XML file and make sure that the namespace specified is "http://ns.adobe.com/air/application/1.0", not "http://ns.adobe.com/air/application/1.0.M6", which was the last beta version.

Comments (3)