Easy Peasy Ubuntu Linux Torrent Client

In this brief blog entry I'll note a few bits about rTorrent. This client is perhaps the best one available for combo desktop/download machines that would like to USE the resources and not commit them to the Torrent client. What is rTorrent? rTorrent is a text-based ncurses BitTorrent client written in C++, based on the libTorrent libraries for Unices (Rakshasa's own, not the sourceforge libtorrent), with a focus on high performance and good code. The library differentiates itself from other implementations by transferring data directly between file pages mapped to memory by the mmap() function and the network stack. On high-bandwidth connections, it is claimed to be able to seed at many times the speed of the official client.

Off the bat, Ubuntu "Feisty" users, rTorrent and libtorrent9 can be installed from the local repository.

[coolcode]sudo aptitude -P install libtorrent9 rtorrent[/coolcode]

BUT WAIT! These versions are stale and I'd recommend you download the latest stable source and install.

[coolcode]wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.11.4.tar.gz
wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.7.4.tar.gz[/coolcode]

Usage includes opening rTorrent, downloading *.torrent(s), configuration of rTorrent. To open...

[coolcode]rtorrent[/coolcode]

You can find your own torrents. :-)

First open the settings file...
[coolcode]vi ~/.rtorrent.rc[/coolcode]

Then paste...

[coolcode download=".rtorrent.rc"]
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
max_peers = 100

# Proxy (Self Added)
http_proxy = localhost:8118

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 6

# Default directory to save the downloaded torrents.
directory = /home/czar/incoming/torrents/

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/czar/incoming/torrents/.sessions

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/home/czar/incoming/torrents/*.torrent
schedule = untied_directory,5,5,stop_untied=/home/czar/incoming/torrents/

# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
schedule = ratio,60,60,stop_on_ratio=200,200M,2000

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no
ip = 127.0.0.1

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no
#bind = 127.0.0.1

# Port range to use for listening.
#port_range = 6890-6999
port_range = 16778-16788

# Start opening ports at a random position within the port range.
port_random = yes

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
# encryption = allow_incoming,enable_retry,prefer_plaintext
encryption = require,allow_incoming,require_RC4

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

# Max number of files to keep open simultaniously.
#max_open_files = 128

# Number of sockets to simultaneously keep open.
#max_open_sockets =

# Example of scheduling commands: Switch between two ip's every 5
# seconds.
#schedule = "ip_tick1,5,10,ip=torretta"
#schedule = "ip_tick2,10,10,ip=lampedusa"

# Remove a scheduled event.
#schedule_remove = "ip_tick1"
[/coolcode]

This requires a few directories to be made. The incoming torrents and then a place to save our rTorrent session...

[coolcode]mkdir ~/incoming
mkdir ~/incoming/torrents
mkdir ~/incoming/torrents/.sessions[/coolcode]

encryption = require,allow_incoming,require_RC4 is FULL ENCRYPTION and will not transfer unless the other client also supports this level of encryption. Read the description and pay special attention to this line.

Save the *.torrent files to ~/incoming/torrents/ and rTorrent will auto pick up and add that download to queue. If you wish to delete the torrent in download use the keyboard shortcut Ctrl + D once to stop, Twice to delete the *.torrent.

Lab2 can also save a torrent on her ~/incoming/torrents mount using Easy Peasy NFS Set-up. rTorrent will start the download. :-)

Enjoy the nice seed speeds and cpu usage of a couple MHz.

rTorrent mods

If you are interested in more information about rTorrent check out this page. We cover ratio multiplication, changing client ids and misconceptions about trackers. http://calomel.org/rtorrent_mods.html If you have any questions drop me a line.

bookmarks

Great tips, add to bookmark. Thanks.

Tags