Orange is my favorite color

My apps use a variety of frameworks which offer a lot of rapid development and agility but they also come at the cost of slower startup times. For a Coldspring-based app with a large service layer, you could easily run into timeouts when initially loading the application. Here’s a simple function to temporarily extend the processing timeout during initialization using CFTHREAD and the Admin API:

<cffunction name="extendRequestTimeoutDuringInit" output="false" access="public" returntype="any">

  <cfthread action="run" name="delayRequestTimeoutDuringInit">
    <cfset thread.adminapi = createObject("component", "cfide.adminapi.administrator") />
    <cfset thread.adminapi.login('mysecretpassword') />
    <cfset thread.runtime = createObject("component", "cfide.adminapi.runtime") />
    <cfset thread.timeout = thread.runtime.getRuntimeProperty("TimeoutRequestTimeLimit") />
    <cflog file="application" text="Extending RequestTimeout to #2*thread.timeout# seconds" />
    <cfset thread.runtime.setRuntimeProperty("TimeoutRequestTimeLimit", 2*thread.timeout) />
    <cfset sleep(2 * thread.timeout * 1000) />
    <cfset thread.runtime.setRuntimeProperty("TimeoutRequestTimeLimit", thread.timeout) />
    <cflog file="application" text="Restored RequestTimeout to #thread.timeout# seconds" />


I call this in Server.cfc when my instance starts up but you could also call it from any reinit routine in OnRequestStart or OnApplicationStart. Previously when we pushed code, the first user request would kick off the initialization process while other requests queued. Many of those first requests would exceed our page timeout setting of 60 seconds. Running the above function uses a background thread to double the timeout and later reset it once the application has initialized so users no longer see timeout/error screens.

Fitness and motorsport are two important parts of my life and a significant portion of my training is to improve my capability on a race weekend. I’ve read books, spent a weekend at the Porsche Human Performance center at Silverstone and built a gym in my garage. But one of the challenges for auto racing is that there are not many sport-specific exercises that can prepare you for the experience of actually driving. What do we need to deal with in the car?

  • High temperatures (made worse by wearing the equivalent of an oven mitt and helmet for safety)
  • Endurance stamina (30 minutes – 3 hours at a time)
  • High G-loads
  • Noxious fumes such as carbon monoxide
  • Sustained loud noise upwards of 100db
  • Awareness and “butt sensitivity” key to extracting maximum performance from car

Very few sports require the sustained concentration and focus (with life and wallet-threatening consequences) as motorsport but we can’t just do a hundred deadlifts, swim a mile or practice some yoga and call it good. All of those things would help but none of them alone will really prepare us to deal with the above. There are motorsport-specific trainers out there, Jim Leo’s PitFit in Indy probably amongst the best in the States, but most of us don’t live in Indy so what can we do?

Build Something!

Auto racing steering wheel exercise for motorsport fitness

I’m a small guy – 5′8″ and 140# – so strength is something I have to work at. Hours behind the wheel in a 25-hour endurance race with big sticky slicks could tire me out if I’m not in shape so I wanted a tool for my home gym. I have a one-car garage so it had to be modular and not take up a lot of space. I sketched a design that could attach to my Rogue Fitness half-rack and called my friend Tony Colicchio at TC Design Motorsports to make it a reality.

With a spare Mazda Miata steering column, a $25 “race wheel” from Ebay and a J-Cup from Rogue Fitness, Tony (who is also a big fitness junkie) built the perfect arm and shoulder exercise tool for replicating the experience behind the wheel. I can load it up with weight and do sets of turning the wheel left 90 degrees, holding for a count of 5, then turning right 90 degrees and repeating. When I’m done, it just hangs on the wall. You could achieve similar effects with just a plate weight but I find that this more closely taxes my arms and shoulders as when I’m racing. It also replicates the hand position required.

Auto racing steering wheel exercise for fitness

The old race seat is something I use with iRacing (another training tool) and is definitely overkill but there’s no question it puts me in precisely the right position. I frequently race a Mazda and have received a lot of support from Mazda Motorsports so the steering column is a subtle nod of thanks.

Check out another of my DIY projects: Racecar cool shirt system.

I’ve written a handful of times on observing and tuning the JVM using tools such as Jstat. I recently upgraded our servers to Java 8 and found that my Jstat script could no longer find the process no matter what I tried.

It turns out there is a bug from JDK 1.7 u75 onwards that is present at least through JDK 1.8 u60 which prevents Jstat, when run as root, from introspecting JREs running as other users.

To solve, simply run jstat as the user who owns the JRE process. You can pass the username to sudo when running jstat like:

sudo -u nobody jstat -gcutil -t <pid> 1s 30

And you’ll be treated to your output again. In my case, I have two server instances running so I like to see their output side by side at the console. Here’s my script for doing that using /usr/bin/paste and some console redirection trickery:

The username can be figured out from the process but this was a quick fix for the above bug.

I’ve been modernizing our development environment and started with the work by Bill Rawlinson to create a portable ColdFusion Docker image. If you’re new to Docker and the benefits of containerization, read up why Docker is dominating 2015. We have Docker Compose running a stack with ColdFusion, Nginx, Postgres, ActiveMQ and Redis all linked together and the entire setup can be started with one command:

docker-compose up -d

I’m simultaneously moving from a Windows machine to a Mac and I’ve been really missing the console logging for watching application activity and errors. It’s easy when installed locally to tail the coldfusion-out.log file but once containerized you don’t have that luxury (without using docker exec to log in to the running container which is a bad practice). The issue is on Linux, ColdFusion has no option to log to stdout like on Windows. As a result, the docker logs command can’t see the output from ColdFusion once the container is running.

It turns out there is a very simple and very elegant way to force ColdFusion, or any app which wants to daemonize and write to log files, to write to stdout. From this ServerFault thread referencing the Nginx Dockerfile, you can symlink the coldfusion-out.log file to /dev/stdout:

ln -sf /dev/stdout /opt/coldfusion10/cfusion/logs/coldfusion-out.log

My Dockerfile for ColdFusion has these two lines:

# redirect logs so `docker logs -f <container>` works
RUN ln -sf /dev/stdout /opt/coldfusion10/cfusion/logs/coldfusion-out.log
RUN ln -sf /dev/stderr /opt/coldfusion10/cfusion/logs/coldfusion-err.log

Now the logs can be collected and observed in a centralized location using Docker best practices.