17 March 2008

Brother, can you spare a meg'?

I started a website, gotbsd.net. It's for getting FreeBSD and PC-BSD and FreeSBIE ISO's via BitTorrent. It's been a lot of fun.

I was inspired to start it because the Project had shut down their official torrent site and I thought there was a need and desire for a dedicated BSD torrent site. FreeBSD has since started a new, official torrent site. However, there's still a need for good torrents for PC-BSD and FreeSBIE.

But, as you may have guessed from the title of this post, that little bit of background is to introduce my earnest request for help. Torrents need seeders to be successful. BitTorrent is a peer-to-peer protocol and its great strength comes from having many people who are downloading the files also uploading the files at the same time (through their presumably under-utilized uplink). It's a great system, but it requires, at the very least, a few dedicated seeders to get things started. (A seeder is a client that has the entire file and is only uploading pieces of the file to others.) Ideally, everyone who downloads a file via BitTorrent will just leave their client connected to be a pure seeder for some time after their download has completed. Some people do that and some don't. Regardless of that, however, it's very, very useful for a torrent to have some dedicated seeders -- people who will leave their client connected and seeding for a long period of time. (To learn more about BitTorrent check the FAQ at gotbsd.net.)

The PC-BSD and FreeSBIE torrents at gotbsd.net are in dire need of seeders. It's easy to be a seeder. (... And fun too!) All you have to do is get a BitTorrent client program, point it at one of the torrents, and then, after the download is complete, leave it running. It will continue to upload the file to new peers who join that torrent to download the file.

Some people might be concerned that this will slow down their other traffic. That's not really true. There's two things you need to do to ensure that your seeding doesn't interfere with any of your other traffic. First, use the bandwidth limiting feature of your client program. (I've never seen a BitTorrent client that doesn't have this feature.) You just determine what your maximum upload speed is and then set your maximum upload speed for the torrent client to around 80% of that. I use this system and for normal web-browsing, etc., there's no noticeable difference in speed. The reason for this is that normal browsing is almost entirely downloading: small requests going out, followed by large files and images coming back. Of course, if you do notice any slowing of your typical traffic, then ratchet it back to a lower percentage. You're in control.

There are, of course, other kinds of traffic where even tiny delays in any direction will have an impact on the application. I'm thinking primarily of on-line gaming. I play on-line games myself sometimes and all I do is stop the torrent client before I begin gaming and then start it again when I finish. Zero impact.

For anyone who's still skeptical or doesn't like the idea of having to fiddle with stopping and starting some program before gaming, I've got one more suggestion to help make seeding easy and completely painless. You use the scheduling feature in some clients to have the seeding stop during the evening when you're on-line and then start again late at night when you're sleeping and/or during the day when you're at work/school. (µtorrent and Azureus have scheduling. If you know of others, leave a comment.)

Personally, I use a client that doesn't have scheduling and when I am gaming this is what I do: First, I have a start up script that runs my console-based client (rtorrent at net-p2p/rtorrent) inside of gnu screen (at sysutils/screen). It's located in the directory "/usr/local/etc/rc.d/" so that it starts automatically on boot. This is the script:
case "$1" in
start)
/usr/local/bin/screen -wipe
sleep 0.5
cd /home/torguy
/usr/local/bin/screen -d -m su -m torguy -c "nice /usr/local/bin/rtorrent -p 16789-16789 FreeSBIE-2.0.1-RELEASE.iso.torrent PCBSD1.5-x64-CD1.iso.torrent PCBSD1.5-x64-CD2.iso.torrent PCBSD1.5-x86-CD1.iso.torrent PCBSD1.5-x86-CD2.iso.torrent" && echo -n ' rtorrent'
;;
stop)
killall rtorrent && echo -n ' rtorrent'
;;
esac

Notice that I'm forcing the local port number ("-p 16789-16789"). The purpose of that is to keep the BitTorrent on one known port that I can then open in my firewall. This isn't strictly necessary, but it's recommended and very helpful.

So, when I'm ready to start gaming I run this as root:
/usr/local/etc/rc.d/screen-rtor.sh stop

Then I immediately run this as root so that it will restart on its own later if I forget:
{ sleep 7200 ; /usr/local/etc/rc.d/screen-rtor.sh start ; } &

(That's bash/sh syntax.) This also has the advantage of reminding me if I've been gaming too long! Because after two hours, I will suddenly have a big problem. :) Also, if you're going to do this with rtorrent, you'll probably want to set some variables with your default BW limits in the ".rtorrentrc" file in the running user's home directory (in my case "~torguy/"). See the man page for rtorrent.

I sure hope you can help me and the BSD community by being a seeder for one or more of these torrents. Look for the PC-BSD and FreeSBIE torrent links on gotbsd.net. Don't let your unused bandwidth go to waste! Your small contribution together with others' can help people get their BSD faster than ever.

Labels: