Tuesday, August 16, 2011

Tips for bit-torrent clients in the cloud

Specifically, I use Transmission as the bit-torrent client, installed on free Amazon EC2 Ubuntu Linux.  There's no monitor in the cloud so I'm using the so called headless mode, or no GUI mode, or command line mode.

Actually the Transmission daemon runs forever, and except for the configuration, you never need to deal with it.  You can use the web interface via the browser on your desktop.

First you must configure Transmission on EC2 by editing the settings text file.  First you have to set the seeding ratio.  Many trackers require the ratio to be at least 1:1.  You must upload the same bytes that you download.  But still you can upload a lot more than you download.  This can be quite costly in EC2.

Transmission only honor the upload ratio AFTER download is completed.  Because EC2 is very fast, your download is fast but your upload is even faster, which can be by a few times if all your peers are slow.  So by the time your movie download is finished, you may have already uploaded 10 times the size of the movie.  You have to limit your upload speed.  100 kb/s seems to be decent.  If you set it too low, it will affect your download rates.

The download rate depend very much on the time of the day.  You save time when everybody in your region go to sleep.  The bit-torrent download could be a few times faster, and the download from EC2 to your computer could be twice.  But you don't save anything, except for time.

The free EC2 only comes with about 8GB of storage.  The BT client will hang because of out of storage space if somebody put together the whole season of TV shows.  On the web interface, you select the torrent and then select the file tab.  Just check the files you want first to be somewhat less than 8GB.  When you finish downloading, you pause Transmission.  Then you use remote copy or other mean to transfer the files to your desktop.  Then you delete the files on EC2.  Then you resume the torrent.  It's strange that Transmission behave exactly as if you haven't deleted the completed files.

You want to decide if you still want the movie file while the torrent is active.  VLC can read partially download files.  But it will be rather complicated when the file is on EC2.

When the download is completed, you want to decide if you want the movie and download in full to your desktop.  You can use a command line video editor to cut out a few minutes at random.  You can download these and watch before you decide.  You can use a command line video player to generate snap shot galleries for you to download and preview.

But it's simpler to just download the movie file using scp or similar.  Once you started downloading, most of the Linux movie players can play the partial files.  Even better, unlike bit-torrent partial files with pieces arriving in random order, you start playing the movie at the beginning while the rest is being downloaded.  This is like some sort of streaming.  If you are picky about movies, you may save bandwidth equal to the size of the movie.

No comments: