Tuesday, April 21, 2015

Moving uTorrent seeds (bencode)

DRAFT (incomplete)

Introduction:

One of the major pains of trying to seed a bittorrent client (in this case, I will be sticking to a uTorrent client) is moving a seed.  There are a number of use-cases where this problem comes up:


  • You need to move the machine where a torrent is being seeded
  • You want to change which hard drive or folder location of a seed
  • You would like to create additional seeds
Creating the new seeds is actual fairly easy... but it is time consuming.  You can either just copy the files being seeded and recreate the torrent (although that is a problem if you want to stick with a single torrent), or you can copy the files and the torrent itself and let the torrent client validate the torrent file.

The Problem:

The problem with either approach is that it takes a fair amount of time (especially if the size of the torrent or number of torrent is large).

So, this approach allows you to 'resume' a torrent on a different machine or different file path.  By using this approach, a lot of time can be saved.  For example, the specific needs I had included the following:


  • I had a number of large virtual machines that I needed to distribute to many machines in a short period of time
  • I wanted to compute / create the torrent files early in the process 
  • I wanted to be able to duplicate the seeding machine across a number of machines
When I created the initial set of torrent files, it took many hours.  With that time invested, I did not want to repeat that time consuming process for each torrent seed that I deployed.

The 'time' that is required is sort of like computing (or validating) an md5 checksum.  These are rather computationally intense and are slow especially if there are multiple running at the same time on a single machine.

The Solution:

When a uTorrent client starts, it looks at a local configuration file to see what it needs to resume.  When it resumes a torrent, it trusts that the seeds it previously had running (perhaps before a system reboot) was valid and requires not further validation... so the process is rather fast.

The 'trick' is to leverage this resume process to allow the loading of these seeds without going the full blown (time consuming) validation process.

The Details:

No comments:

Post a Comment