This is an ode to Dirk Engling’s OpenTracker.
It’s a BitTorrent tracker.
It’s what powered The Pirate Bay in 2007–2009.
I’ve been using it to power the downloads on http://driverpacks.net since the end of November 2010. >6 years. It facilitated 9839566 downloads since December 1, 2010 until today. That’s almost 10 million downloads!
It’s one of the most stable pieces of software I ever encountered. I compiled it in 2010, it never once crashed.
wim@ajax:~$ ls -al /data/opentracker total 456 drwxr-xr-x 3 wim wim 4096 Feb 11 01:02 . drwxr-x--x 10 root wim 4096 Mar 8 2012 .. -rwxr-xr-x 1 wim wim 84824 Nov 29 2010 opentracker -rw-r--r-- 1 wim wim 3538 Nov 29 2010 opentracker.conf drwxr-xr-x 4 wim wim 4096 Nov 19 2010 src -rw-r--r-- 1 wim wim 243611 Nov 19 2010 src.tgz -rwxrwxrwx 1 wim wim 14022 Dec 24 2012 whitelist
The simplicity is fantastic. Getting up and running is fantastically simple:
git clone git://erdgeist.org/opentracker .; make; ./opentracker and you’re up and running. Let me quote a bit from its homepage, to show that it goes the extra mile to make users successful:
opentracker can be run by just typing
./opentracker. This will make opentracker bind to
0.0.0.0:6969and happily serve all torrents presented to it. If ran as root, opentracker will immediately chroot to
.and drop all priviliges after binding to whatever tcp or udp ports it is requested.
Emphasis mine. And I can’t emphasize my emphasis enough.
Performance & efficiency
All the while handling dozens of requests per second,
opentracker causes less load than background processes of the OS. Let me again quote a bit from its homepage:
opentracker can easily serve multiple thousands of requests on a standard plastic WLAN-router, limited only by your kernels capabilities ;)
That’s also what it said in 2010. I didn’t test it on a “plastic WLAN-router”, but everything I’ve seen confirms it.
Its defaults are sane, but what if you want to have a whitelist?
- Uncomment the
#FEATURES+=-DWANT_ACCESSLIST_WHITEline in the
- Create a file called
whitelist, with one torrent hash per line.
Have a need to update this whitelist, for example a new release of your software to distribute? Of course you don’t want to reboot your
opentracker instance and lose all current state. It’s got you covered:
- Append a line to
- Send the
SIGHUPUNIX signal to make
opentrackerreload its whitelist1.
I’ve been in the process of moving off of my current (super reliable, but also expensive) hosting. There are plenty of specialized HTTP server hosts2 and even
rsync hosts3. Thanks to their standardization and consequent scale, they can offer very low prices.
But I also needed to continue to run my own BitTorrent tracker. There are no hosts that offer that. I don’t want to rely on another tracker, because I want there to be zero affiliation with illegal files. This is a BitTorrent tracker that does not allow anything to be shared: it only allows the software releases made by http://driverpacks.net to be downloaded.
So, I found the cheapest VPS I could find, with the least amount of resources. For USD $13.504, I got a VPS with 128 MB RAM, 12 GB of storage and 500 GB of monthly traffic. Then I set it up:
ssh‘d onto it.
rsync‘d over the files from my current server (alternatively:
@reboot /data/opentracker/opentracker -f /data/opentracker/opentracker.confto my
- removed the
tracker.driverpacks.net, and instead made it an
Arecord pointing to my new VPS.
http://tracker.driverpacks.net:6969/stats?mode=tpbs&format=txton both the new and the old server, to verify traffic was moving over to my new cheap
opentrackerVPS as the DNS changes propagated
.torrentfiles for certain files uploaded to Drupal
- append to the OpenTracker
- parse the statistics provided by the OpenTracker instance
You can see the live stats at http://driverpacks.net/stats.
opentracker is the sort of simple, elegant software design that makes it a pleasure to use. And considering the low commit frequency over the past decade, with many of those commits being nitpick fixes, it also seems its simplicity also leads to excellent maintainability. It involves the HTTP and BitTorrent protocols, yet only relies on a single I/O library, and its source code is very readable. Not only that, but it’s also highly scalable.
It’s the sort of software many of us aspire to write.
Finally, its license. A glorious license indeed.
The beerware license is very open, close to public domain, but insists on honoring the original author by just not claiming that the code is yours. Instead assume that someone writing Open Source Software in the domain you’re obviously interested in would be a nice match for having a beer with.
So, just keep the name and contact details intact and if you ever meet the author in person, just have an appropriate brand of sparkling beverage choice together. The conversation will be worth the time for both of you.
Dirk, if you read this: I’d love to buy you sparkling beverages some time :)