Bit Torrent

Discussion in 'General' started by jeff putnam, Feb 21, 2012.

  1. jeff putnam New Member

    It occurs to me that (with some work) you could use something like bit torrent to distribute images (as a poor mans alternative to multicast). Advantages are that blocks could come in in any order (so machines would not have to boot in lockstep), and all machines might contribute to uploading blocks so the network IO would be spread out over multiple machines (though the total network capacity is still the same).

    Disadvantages are that the software becomes rather more complex and there would be no real boost to speed if machines tend to be imaged one at a time.
  2. Catsrules Member

    That would be cool.

    One of the schools I worked for, had a program called LanDesk, and it would do p2p for deploying windows and also updates. They would have the main server, that gets the updates, then sends it to a few clients, then other clients would connect to those few clients and then it would just grow from there.

    But we had a few problems, like one time we where deploying windows on every computer at a school, and one of the first computers, that got the information from the main server, got a corrupted copy, then sent it on the all of the other clients. We ended up having to redo everything again.
    But that would be fixed if they just did a CRC check on all of the files. I think that is what the normal bit torrent does.
  3. micko New Member

    Bit-torrent is generally a better solution than Multicast, simply because it's easier to use and has greater flexibility.
    There are some good python torrent clients available now.

    Is there anyone who can tell me how I could write a torrent client into the boot image so clients can receive their image over torrent?
    I'm trying to image about 50 lab PC's at once that are on the same vlan.
  4. Gilou Member

    the actual mechanism in init.gz using partimage would have no idea how to download using bittorent (it mounts the NFS, and uses partimage over it directly). If you want to use bittorrent, you need some space to save the image before dumping it to the disk.. That's a not trivial thing to do given how the process is done currently, I'm afraid :(

    Though it would be awesome.. Like.. Let's check the size of the image, let's check if we have size_of_image_decompressed + size_of_image, deploy using bittorent on the extra space, dump the image, then remove the temp partition and extend the main one.. Not trivial, but interesting ;)
    Also, it would probably be slower, as you need to write all the image twice.. on the disk..
    The upload process gets around it by splitting the image inside the RAM (and would thus be heavily faster on a 64 bits kernel) before sending the chunks out there, but bittorrent wouldn't be able to do that (or you'd have to force the upload to be sequential, and find a way to dump the part of the file that is properly downloaded, but then that reduces the impact of bittorrent because everyone starts downloading the same part of the image file, rather than distributing randomly over the chunks..).
    Jaymes Driver likes this.
  5. Gilou Member

    (And if you have 50 PC in a VLAN, properly isolated, use multicast, that will be way faster.. Even if your switch sees it as broadcast, it probably would work faster in anyway..)

Share This Page