From Youtube to Pilot – My Journey Into the World of FPV Drone Racing (Part 1)

It started innocently enough. A video linked on youtube showing some “pilots” gathered in the woods. An obviously well organized group, with safety crews, a well marked course, and referees. The pilots were several guys sitting in camping chairs, with goofy looking goggles on, or staring intently into small video screens.

Then the racing started, and the viewpoint shifted to the nose of the craft zipping in and out of the trees. It immediately evoked memories of the speeder bikes from Return of the Jedi, tearing in and out and around trees in the forest. The craft in the video were lit up with LEDs that made them glow brightly… even as your competitor passed above you on a fast straight, or swung wide on a turn.

Quickly, other videos started appearing up showing similar craft and activities. People were getting together to race small remote controlled ‘drones’.  I was intrigued.  These were custom built, complicated radio control models, but I felt they were within my skill set to construct and fly.

I had to do this.

First though, I had to figure out what the heck I was looking at!  I was no stranger to radio control aircraft.  People have been building planes with cameras attached to them for ages.  I knew that in the last year or three, some Makers have build ‘quadcopters’.  Small, maneuverable aircraft that could move up, down, sideways, and spin in place either autonomously or via remote control.  As I saw these being demontrated, I thought the idea was interesting, but the limited flight time, carrying capacity, and expense were just not worth getting involved in.

Then several things changed.

First, the wide availability of Lithium Polymer, or LiPO batteries. In the Radio Control world, LiPO’s had been gaining ground, and in 2013 they’d reached a density and weight where they made sense on very small, light craft.

Second, small portable HD cameras were becoming more available. By far, the best known are the GoPro Hero Cameras, but more recently, the Mobius camera has become the unit of choice. It’s small, well built, has excellent resolution, and fits well on small flying vehicles.

Last but not least is the availability of relatively inexpensive First Person View, or FPV equipment. FPV had been possible in the past, but the equipment was bulky and expensive. Modern gear can be extremely small and light, and easily installed by a new model builder.

All these things came together to produce what can only be described as a skyrocketing interest in building small, highly maneuverable ‘drones’, getting ‘behind the wheel’ of one (via goggles or video link), and going flying. Or, even more fascinating… going RACING.

I had to do it.

I watched tons of videos on Youtube. This sport is still relatively new. Most races and groups have only been flying for 6-8 months. The equipment design and processes for building and flying are still being worked out, but the basics are pretty well set. I spent my first 2-3 weeks just understanding all the parts of a drone, what was needed, how they worked, and how things came together.

Here’s the gist of it.

First, there’s a heck of a lot of weird terminology.  Here’s a good glosssary of terms to start you off.

What is commonly known as a “Racing Drone” is a 250mm (that’s corner to corner) lightweight frame with 4 brushless motors on the limbs. The motors are told what to do starting with a Flight Controller, an on board computer that provides stability to the drone, as well as takes commands from the radio receiver, and tells the motors what to do.  The Flight Controller (or “FC”) communicates with Electronic Speed Controllers (or “ESC”) – one per motor – that varies the speed of the motor based on commands from the flight controller. Powering all this is a LiPO battery that’s usually set up to provide 5-7 minutes of flight time per charge. The drone receives it’s commands via radio link using a radio receiver, which is paired to a handheld radio transmitter the pilot carries.

That describes the drone platform itself, but if you want to do FPV, you’ll also need a camera (FPV cameras are small and relatively low resolution), a video transmitter and antenna, and a video receiver and display setup.

That, in a nutshell, describes an 250mm FPV Mini Racing Drone. From this basic design, many things can be added or enhanced. Adding an HD camera is very common (the HD camera records the flying sessions for viewing later. The pilot flies just via the FPV camera) – this is where the cool videos come from. Adding other features such as a GPS receiver, a system that can interface the flight controller data with the FPV display (called an On Screen Display, or OSD) can let the pilot see realtime data from the drone as it’s flying (Altitude, speed, position, battery level, distance from pilot, even an indicator showing the pilot how to get the drone back to them). These are fun additions, but aren’t required for racing (some pilots will argue having all that junk on the OSD can just distract you from the racing).

In addition to the parts needed to build a drone, every pilot has a whole infrastructure of materials to make the flying possible. A LiPO battery charger is required. Because LiPO batteries are pretty complex, the chargers tend to be fairly involved pieces of equipment, and pilots need to understand how a LiPO works, how it’s rated, what configuration it’s in, how to charge it, etc.

Spare parts are also a requirement. It’s common to break props many times a day, so keeping spares is a necessity. Zip ties, velcro straps, spare motors, ESC’s, these are all tools in the arsenal.

But enough about that, how’d I get from “What a cool thing!” to being out and flying?

That will come in my next blog post!

Update:  check out part 2 !

 

One Week with the Chevy Volt

So a week ago I traded in my Jeep Wrangler for a Chevy Volt.  It was a hard decision, but made sense on so many levels.  I have a long commute (70 miles round trip), do other road trips, etc.  And while I’ll miss being able to bang around in the woods and romp through the mud, the Volt has been… all things are considered… pretty damned awesome!

chevy volt on charger
My 2015 Chevy Volt plugged in at the office

Lets start with the run down.  In the last week, I’ve driven about 450 miles.  In that time, I’ve burned a grand total of 2 gallons of gas.  And lets be clear, this isn’t because I drive carefully or anything – this thing is fun as heck to drive, and tearing along an on-ramp or powering around someone in traffic is a ton of fun.  This is just using basic energy management.  At night, I plug the Volt into an normal 110v outlet in my garage, which, by morning, means I have a full charge – a battery range of between 40 and 45 miles.  When I get to work, weather permitting and no one is in the parking spot near the outlet, I plug in there as well.  6 hours at work is enough to top off the battery and get me home again.

If I don’t get a chance to plug it in?  That’s okay… when the battery runs out, the Volt functions like a ‘normal’ car and runs on the engine, giving a respectable 40mpg.

That’s the basics.  Now lets get into the cool geeky stuff.

The car doesn’t look like an EV.  It’s not a Prius, it’s not a Leaf, it’s not an Insight, and it’s sure as heck not a Tesla.   On the outside, it just looks like your standard smallish sedan.  On the inside it’s modern as heck, with 2 color displays, schwoopie internal lines, and comfortable details.  I’m 6’6″ tall, and my son is 6’2.  We fit just fine, though if we’re hauling tall kids in the back seats, things can get cramped.  Having said that, even the tall kids find they have enough headroom in the back – it’s usually footspace gets a little tricky.  The trunk is certainly smaller than the Jeep (duh), but the car is a hatchback, and while I wouldn’t want to haul furniture with it, I can carry whatever project I’m working on in the back without much trouble.

Something I hear from other EV car drivers, I’ll pass on here.  If you’ve never driven an EV car, find a friend who has one, and ask to take their car for a quick drive.  There is nothing in my experience that compares with driving a modern, comfortable automobile under electric power.  It is almost silent, the acceleration is smooth and clean (and strong!!).  It’s almost impossible not to smile when pulling this car out of the garage and heading off down the road.  It feels space-age.  We may not have flying cars yet, but this sure feels like we’re getting there.

Too many people think of the Chevy Volt like a Prius or similar.  An extremely practical, un-fun car.  Let me tell you folks, this car is seriously fun to drive.  The acceleration is phenomenal when you ‘drop the hammer’ as they used to say.  According to the interwebz, the 0-60 time is 8.7 seconds, (compared with the plugin Prius at 10.5 seconds.  The Leaf zips at 7.4 seconds – it’s a much lighter car with no engine).  My Wrangler would have done that in 10.4 seconds, and burned half a gallon of gas doing it.

This brings up another point.  When I drive the Volt aggressively, I don’t feel like I’m doing damage to it, or to the environment, or anything.  I’m using more battery power, sure, but unlike a gas engine (which runs less efficiently when heavily loaded, ie burning more hydrocarbons), the Volt just runs the battery down a little more.  You can wildly vary the efficiency of an internal combustion engine based on driving style, and by efficiency I mean “how much crap you blow out your tailpipe”, but the Volt?  The only efficiency you’ll hurt is how long your battery will last until it needs a recharge.

Lets talk about some more geeky things.

onstar app
The OnStar app on my Android phone showing the status of the Volt

The Volt is an EV car.  I spend 95% of my time driving it on batteries only.  As such, I’m always looking for ways to not use the gas engine.  I’ve signed up on the ChargePoint network, which gives me a little RFID card, a mobile app, and a network of Level 2 charging stations where I can top off my battery while having some coffee.  A full Level 2 charge of the Volt takes a few hours (An hour on a level 2 charger adds about 10 miles of range to the battery).  So while electric ‘refueling’ is still a ways off, it’s nice to know I can stop off for lunch somewhere and plug in the Volt for a while while I grab a burger.

The other win is the OnStar mobile app.  While I’m skeptical of any of the ‘big manufacturer’ tools, GM’s Onstar stuff is pretty good, and their mobile app is super-handy.  From my phone I can check the status of the car – how the battery is doing, when it’ll be charged, how much gas is in it, heck, even what the tire pressures are.  More excitedly, I can remote start it.  In nasty weather, I can tell the Volt to power up and start warming the cabin.  It’ll do this purely on ‘shore power’ (drawing from the power connector, not the engine), so it’ll be nice and toasty when I’m ready to leave, without sacrificing range.

Conclusions

While I went into this change for purely practical reasons, I’ve been pleasantly surprised at how much I’m enjoying the car.  It’s performance is great, it’s comfortable, and I can’t argue with the cost of operation.  One interesting side effect… I get bothered when I’m running on gasoline.  95%of the time I’m emitting zero pollutants.  No CO2, no hydrocarbons, not even making a lot of noise.  But when that engine starts (which is nearly silent, I notice it mostly because my dashboard changes configuration), I start feeling dirty.  I’m BURNING OIL!!!  I picture a bucket of gas on fire.  Ewwww.  Then I look around at all the other cars on the road and go “They’re all doing this right now.  Why?”

Maybe it’s the shiny… maybe people are afraid of EV cars, or just don’t understand them, but for me, I wonder why there isn’t a while hogged march toward everyone using cars like this.  There are a lot of hybrid cars on the market right now, but they’re in the ‘we use an electric motor to make the gas motor use less gas’ category.  Why isn’t this sort of design more prevalent?

The Desktop Mail Client is Dead.

It’s no secret. I’ve been a rabid IMAP user for ages and ages and ages. To the point where I’ll keep shifting mail clients around to stay ‘current’.

Activity monitor showing Thunderbird using more memory than Outlook
Thunderbird was supposed to be more efficient than the bloated Outlook. Alas

My preferred poison for almost 10 years had been Thunderbird. The tool that started out as a potential replacement for Outlook, but in the end never quite had the integration of calendaring and contact management required to take on the 600lb gorilla. I made the hard choice a year ago to switch from Thunderbird to Mail.app on my Macbook, because Thunderbird performance had gotten so bad, and had blown up to such a huge memory hog, it just didn’t make sense anymore.

Continue reading “The Desktop Mail Client is Dead.”

Sorry Jekyll, I’m done with you.

logo-2xI’ve been working with Jekyll on the US Drone Racing Association site. It seemed like a nice idea. Check all your content into Github, then, when ready to do work with it, check it out, make your edits, run a local test site (that part is really nice), and when finished, check it back in. One update on the master site, and you’re done. Woo.

Yeah, see, that’s where they getcha.

Jekyll is great for very fast setups for static sites. If you never want to really change the site, such as changing themes or regularly adding blog posts quickly and efficiently, you’re probably good.

But I found the blogging process enormously painful.

  • Check the site out of github
  • Go into the _posts directory, pick an old entry, copy it to a new filename. The new filename must be yyyy-mm-dd-uniquename.markdown. This date is important because it’s used as a sort order.
  • Edit the newly created file with whatever editor you like, but the YAML Front Matter must be correct. Using YAML for structured data is already problematic, but this is supposed to be a markdown document. But, no, it’s sort of a hybrid of YAML and Markdown and HTML.
  • If you get the YAML Front Matter right, you get to write your post. Markdown is nice, but it has it’s limitations
  • Save the file, make sure you go back to your root (god knows how many times I’ve failed at this one), and do ‘jekyll serve’. Test your site locally. Swear and curse as it doesn’t work right. Repeat previous steps until right.  (Credit here.  The live preview is really nice, and it updates automatically when a file change is noticed.  I can’t fault that.)
  • git add -r
  • git commit
  • git push origin master
  • Log into your blog host
  • cd to your working directory
  • git pull origin master
  • cd sitename
  • jekyll build –destination=/var/www/yoursitename

Now, this really isn’t that horrific. Irritating, sure, but you can automate pieces of this and add some nice wrappers around it.

I wanted to theme my site. Here’s where things go sideways.  In short, you can theme a Jekyll site.

But you can only do it once.

Why? Because you don’t apply a theme to a site. You apply a site to a theme.

Sound crazy?  Lemme splain.  To theme a site, you download the theme, build it (and in Ruby land, this can be a nightmare experience. Ruby dependencies are horrific. Don’t believe me? Check out the conversation I had with a theme developer. We couldn’t get it running at all.)  But even if you do get it running, after you build a theme, you copy your existing content into the new theme directory, and commit the whole thing up to git. That’s your new site. Want to change themes? HAHHAHAHAH. You have to do this process all over again, extricating your content from your old themed site and copying it into the new theme directory structure.

Screw that.

Sorry jekyll. I’m done with you.

CONGO is going GPL.

(This announcement is also being posted on stonekeep.com)

Over the last 12 years I’ve been working hard to develop CONGO into the best convention registration system I can manage. Since 2002, CONGO has been used for many events of all sizes, registering and printing badges for tens of thousands of attendees. There have been many successes and a few bumps, but all in all it’s been a great adventure.

Several events now rely heavily on CONGO for year-to-year attendee tracking, allowing online registration, keeping up-to-date history, managing thousands of attendees, as well as the relationship CONGO has to Zambia, the scheduling system.

Continue reading “CONGO is going GPL.”

Arduino Nano “Programmer Not Responding” on a Mac

Arduino Nano v3
Arduino Nano v3

For the Staff project, I’m going to be replacing the existing Arduino Uno R3 with a smaller, more easily embedded Arduino Nano.  The Nano is a heck of a lot smaller than the Uno (makes sense – it’s meant to be permanently installed, while the Uno is a prototyping platform).  I received my Nano a few weeks ago, but immediately ran into a frustrating problem… code would compile, begin to upload, and I’d get the error “stk500_recv(): programmer not responding”

The intarwebz are full of people reporting this problem, unfortunately most are not finding answers.

I went through the usual debugging problems – changing out the USB cable I was using, checking to make sure USB drivers were correct – I could still upload and use code on my Uno, but the Nano flat out refused to accept the new code (and I did check the very common problem of not selecting the correct board in the IDE).

Finally, came across a general discussion about bootloaders, and there was a comment that sometimes these boards do not reset properly.  After some more research, I found some folks using various ‘reset button’ hacks to sort of nudge the board into accepting code.  With a lot of trial an error, I have a procedure that seems to work pretty consistently.  There’s occasional twitches, but with persistence it always loads.

Continue reading “Arduino Nano “Programmer Not Responding” on a Mac”

23andMe – A Scientific Look into Myself

European.  Whoddathunkit?
My genetic backround

A couple months ago, a friend pointed me to the website 23andMe.com.   Their mission statement is pretty straightforward.  “23andMe’s mission is to be the world’s trusted source of personal genetic information.”

Here’s how it works.

After signing up online and coughing over my $100, 23andme sent me a small kit.  Inside the kit is a little plastic tube.  All you need to do is fill part of the tube with saliva, seal it up, and mail it back to them.  It’s all postage paid, so it’s just a matter of dropping the box in the mail.

About 4 weeks later, you’ll get a piece of email saying your results are ready to be viewed.  And then things get interesting.

Continue reading “23andMe – A Scientific Look into Myself”

Notifications on all Logins on a Linux Host

Putting this one out there because I spent some time surfing various Well Known Sites and couldn’t find a complete answer.

We had a need to log whenever users logged into a production host – just a notification send to the admins saying someone was on one of the production boxes.  The other requirement was to have it be low impact – didn’t need a ton of monitoring packages installed, etc.

The result is a pair of scripts.

The first is ‘checklogin.sh’:

 #!/bin/bash
 # Nov  6 13:35:25 inf-1 sudo: dshevett : TTY=pts/0 ; PWD=/etc/munin ; USER=root ; COMMAND=/etc/init.d/munin-node restart
 TMPFILE=checklogin-$$
 AGO=`date "+%b %e %R" -d "1 min ago"`
 grep "$AGO" /var/log/auth.log | grep 'session opened for user' | grep -v CRON > /tmp/$TMPFILE
 grep "$AGO" /var/log/auth.log | grep 'sudo:'| grep -v pam >> /tmp/$TMPFILE
 cat /tmp/$TMPFILE | /tools/sysconf/scripts/mail_if_not_empty ops-notice-internal@REDACTED.com "[inf-1:checklogin.sh]"
 rm /tmp/$TMPFILE

This simply looks for some patterns within the auth.log file. The only real trick here is making a date formatted string that is ‘one minute ago’. If this script is run once a minute via a cron job, it’ll send mail within a minute of someone logging into the host.

The other script is a simple utility tool I use for most of my cron jobs called ‘mail_if_not_empty’:

 #!/bin/bash
 TMPFILE=/tmp/joboutput.$$
 TARGET=$1
 SUBJECT=$2
 cat >  $TMPFILE
 if [ -s $TMPFILE ]
 then
   mail -s $SUBJECT $TARGET < $TMPFILE
 fi
 rm $TMPFILE

Super-duper simple, it just sends mail if there's any output.  This makes sure that mail will only be generated if anything interesting happens.

Time Lapse Video at an SF Convention using Linux and a webcam

For quite a while I’ve been interested in using commodity hardware (a webcam, a small linux machine) to take time lapse videos. It didn’t seem like that complex a problem, but there were a lot of logistical and mildly technical obstacles to overcome. After a couple tests and short videos, it was time to set things up to record a four day long video at [Arisia](http://arisia.org/), in particular, a shot of the registration area.
Here’s how I did it.

Continue reading “Time Lapse Video at an SF Convention using Linux and a webcam”

Hosting a Terreria Server – The yakshaving commences

Four kids, four laptops, one minecraft worldSo the latest craze around here is Terraria. Think of it as Minecraft in 2d. Naturally, since the kids here are all Minecraft addicts, Terraria was a natural next step. Minecraft, the gateway drug for MMPORPGs.
Of course, “DAD! Can you host a Terraria server for us?” was inevitable. “Sure”, the foolish Dad says, “Where’s the Linux client?”
“Yeah, so, there’s a problem with the Linux server version of Terraria. There isn’t one.”
Awesome.
So began my descent into Windows hosting hell. I share my experiences here with you, to hopefully lesson your pain.
A server
Windows xp laptop in the server rackIn order to make this work, you naturally need a server. I had a spare Windows XP Dell 620 laptop lying around that looked like it was ready for abuse, so that was put up as my offering to the network gods. Getting said laptop into the server closet proved to be a bit of a challenge, since I was faced with some awesome challenges:
* The NIC on the laptop (or the drivers) are unstable. Occasionally it will drop the network connection, requiring a physical cable drop and reconnect. Wonderful.
* Terraria is a DirectX application. Ergo, it cannot be started via RDP (which reduces the video driver capability). I must start Terraria on the console of the laptop in the server closet before connecting to it.
* The screen on the laptop is twitchy – Occasionally the screen will blank out, and only a hard reset will restore it.
Installation
Setting up and running the Terraria server was pretty straightforward. Install Steam, download/install Terraria, start up the game, click ‘start server’. Easy, huh? Note that because it uses Steam, you need to use a unique login. My experience has been that the Steam credentials are only checked during startup – once the server is running, you can log out of steam on the server and run up a client machine on the same login.
Networking
Anyone who is familiar with firewalled hosted services should be able to set up their network appropriately. In our network environment, we host servers behind a NAT enabled firewall, and set up port-forwards to internal services. This makes the server relatively isolated from the internet at large, but allows for the server to be accessed from the outside world.
Some basic guidelines when setting up your server:
* Do not host your Windows box on the internet without a firewall. Really, just don’t do it. Windows boxes are the most often attacked, have the most vulernabilities, are the most commonly compromised.
* Running a Windows host with a ‘self hosted’ firewall is marginally better, but is still easy to run up in an ‘unsafe’ configuration without you even knowing it’s happened.
* Terraria uses port ‘31337’ for the server. Note that this port is ALSO used by the (mostly old school now) ‘Back Orifice’ application – a tool generally used to hack servers. Many firewall tools and applications may flag Terraria servers are Back Orifice servers, and disallow them
Testing the server’s available is pretty easy. Log into your Linux box out on the net (you do have one, don’t you?) and test connectivity to the server:

dbs@calypso:~$ telnet your.firewall.ip 31337
Trying 1.2.3.4...
Connected to your.firewall.ip.
Escape character is '^]'.

Hooray! Your server is ready to access! Run up Terraria on your computer, and connect to the IP address of your server (note that Terraria doesn’t support hostnames [idiotic in my opinion] – you must connect by IP). You’re in the game!
Conclusion
In so many ways, Terraria is NOT ready for prime time. The lack of a decent server mode, the requirement for DirectX for even basic operation (even in server mode) – these make hosting a server more painful than necessary. It can be done, but I don’t know how long this house of cards will last.
Oh, the game itself? Don’t know, haven’t played it, there’s no Mac version.

CONGO Update – The road to 2.1.

I’ve set a goal for myself. Have CONGO v 2.1 released by June 1st. It’s an auspicious goal to be sure, and recent career shifts have either made it more likely (more time to work on it) or less likely (new job) to have time to dedicate to coding.
But goshdarn it, I’m going to try.
congov2-eclipse-screenshot.pngWhile coding away last night at a particularly recalcitrant chunk of the new ‘Links’ system (I’ve been… instructed… by my pesky users, that ‘Friends’ is really too ‘social buzzy funtime networking’ for an event management system), I was curious how big CONGO had gotten. So a couple greps got me some quick stats:

Total lines of Java : 13,412
Total lines of XML : 5,492
Total lines of JSP : 5,543

This makes CONGO the largest application I’ve ever written completely on my own. Oh sure, I’ve worked on larger systems, but that was part of a team with other coders. This one (with some small help from 1-2 folks – accounting for around 2% of the code) is all mine.
I’m always looking for alpha and beta testers. Interested? Lemme know. Continuous build / QA testing is working, so there’s always new builds and bugs that need to be tracked.

My bosses are audiophiles.

It’s interesting working for a music distribution company – our upper management tends to the audiophile / retro-geek crew.
Witness our CEO’s office:
CEO Rig
And the CTO’s office:
CTO Rig
I do wonder at the massive old-skool speaker stacks and tube amps… in a 15×15 standard drywall office, but it does look sorta neat.

My Chumbys and Me

It’s no secret I’m a big fan of Woot and the excitement that can accompany a Woot-Off, that festival of consumerism and feeding frenzy for those susceptible to impulse buys.
A few frenzies ago included offering up a Chumby One for the attractive price of $49.
Chumby one!
I bought two.
I’d been trying to figure out various ways gaining ‘shelf-top’ access to online music resources. Back in the day, I’d picked up a Roku Soundbridge or two, but I’ve never been completely satisfied with the results. Even modern versions of these devices are in my opinion too expensive and too limited. They play music, that’s it. Even though Roku has moved on, other manufacturers are offering similar devices for $250.
Screw that.
The Chumby One is a small 450mghz Linux computer with Wifi, 64meg of RAM, and a 3.5″ color screen. It has everything I was looking for in a ‘bedside’ or ‘shelfside’ device. It can play music, it has a touchscreen that can show a wide variety of content, and it’s controllable from a centralized server. It has line-level audio out via a headphone connector, as well as internal speakers. The design allows for easy ‘bedside’ use, along with unattended modes.
The final button for me was the inclusion of a powered USB port on the back. This means I now had an easy charging station nearby for my iPhone, without taking up another power outlet and the accompanying cable mess.
I love the variety of apps, both the whimsical (David Letterman’s Top 10) and the useful (A constantly updated weather / traffic / time / date page that shows ‘local status’ in real time) – all while happily playing Radioparadise for me.
And. Heck. They’re cute.

The Blog is Resurrected… for now.

Well that was no fun.
For a while, I was in a funk because the Planet-Geek.com site was not posting ANY of my articles. And when I logged into the maintenance pages, I couldn’t see any of my articles for the last year.
Now, the site has something like 1600 articles on it. I was pretty cranky at the possibility of losing all my content. But the database itself seemed okay, and I could see entries in it. Just new content was not showing up.
Tonight I decided to sit down and figure out WTF was wrong with it.. It took about half an hour to determine the root of the problem…
I was logging into the wrong site.
We migrated the blogs off msb to msb2 a year or so ago, but I never a) removed the old bookmark in my shortcuts, and b) never updated the maintenance page to point to the correct toolset.
So I was editing the old site.
Boy do I feel like a dork.

Performance Tuning with Trac

I’ve been using Trac for managing all the bugs enhancements in CONGO for the last 3 years or so. For the most part, it’s been pretty useful, though I haven’t been thrilled with some performance problems I was having.
Most notably, a simple page load would take 4-5 seconds to come back.
I thought the initial problem was due to the older (v0.11) version I was running. But after a painful SVN crash and rebuild, and taking that opportunity to upgrade to 0.12 and move to a faster host, the performance problems were still there.
When reading Trac performance blogs, the first thing everyone says is “For gods sake, make sure you’re running mod_python!!!” Well, I was. So that wasn’t it.
I found the answer in an older blog post that mentioned the Chrome elements in Trac were rendered on the fly via Python. This didn’t make sense, as they were primarily static elements.
So why not cache them?
A quick tweak to the vhost configuration:

<LocationMatch /[^/]+/chrome>
Order allow,deny
Allow from all
ExpiresDefault "now plus 12 hours"
</LocationMatch>

(which, by the way, necessitated adding mod_expires in apache), and a restart, and my load times went from 6.6 seconds:

172.16.1.1 – – [13/Feb/2011:22:58:13 -0500] “GET
/chrome/site/stonekeep-ball-logo.gif HTTP/1.1” 200 6660
“http://trac.stonekeep.com/” “Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62
Version/11.01”

down to zilch due to caching:

172.16.1.1 – – [14/Feb/2011:08:15:51 -0500] “GET
/chrome/site/stonekeep-ball-logo.gif HTTP/1.1” 304 –
“http://trac.stonekeep.com/wiki/WikiStart” “Mozilla/5.0 (Macintosh; U; Intel Mac OS X
10_6_6; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4”

Win!!!