[Libtorrent-devel] Representative "record size" for rtorrent I/O

Josef Drexler josef at ttdpatch.net
Sat Oct 10 10:15:24 UTC 2009


On Oct 10, 2009, at 6:49 AM, spiro at fea.st wrote:
> What is the representative "record size" for rtorrent access to the
> disk?
>
> I remember reading on the list before that "Each request is a given
> 16-KByte piece of a random chunk." (J. Drexler)
>
> Does that mean that, regardless of torrent chunk size, rtorrent is  
> doing
> random 16-KB i/o requests (read/write) most of the time?


rtorrent doesn't do any disk IO at all.

Instead it uses mmap'ed files, which means that the kernel is doing  
the IO all by itself, rtorrent just accesses the files as if they  
were memory. So the kernel is essentially swapping in and out the  
data on its own as needed, automatically and (for the most part)  
transparently to the application. The "record size" would then be  
determined by the kernel's memory manager settings, and while  
rtorrent uses mmaps with a size given by each torrent's chunk size  
property, that doesn't mean the kernel will read or write using that  
size as well. Really, the only explicit IO you'll find in rtorrent is  
loading .torrent files and reading/writing the session data. Torrent  
data IO is completely up to the kernel in all aspects, except for  
rtorrent occasionally requesting that all pending data be synced to  
the disk NOW when the safe_sync option is in effect or diskspace is  
low and there's danger that the kernel will run out of diskspace  
while syncing (which would then cause a bus error).

-- 
Josef Drexler
josef at ttdpatch.net



More information about the Libtorrent-devel mailing list