[bittorrent] Introductory/endgame algorithms

Justin Cormack justin at street-vision.com
Wed Sep 28 17:17:41 EDT 2005

On 28 Sep 2005, at 22:09, Arvid Norberg wrote:

> On Sep 28, 2005, at 15:09, Jari Sundell wrote:
>> On 9/28/05, Olaf van der Spek <olafvdspek at gmail.com> wrote:
>> If there's enough RAM, can't you simply prefetch all files
>> completely into RAM?
>> I haven't considered doing this explicitly, I use mmap'ed files
>> directly and the kernel keeps the pages in memory if there's room.
>> If the user wants to preload the files, he may use dd or similar to
>> dump them into /dev/null.
> Assuming you support files larger than the address space of the
> machine (2 GB for an ordinary 32-bit machine), how do you do your  
> mmap?
> Do you move it around to parts of the files that gets the most read
> and write requests and use ordinary io for the rest? or do you create
> and free the mmap() for each read/write operation? (do you have any
> idea if that would incur big performance hits?).

Buy a 64 bit machine.

However the overhead of mmap is rarely worth it even then.


More information about the BitTorrent mailing list