rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

recommended settings for 1 Gbps connection #1046

Open inside83 opened 3 years ago

inside83 commented 3 years ago

Hi

I've been reading up on https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning and sample config there is used with 74/20 Mbps connection, 4 GB RAM and 1 local disk device.

Now I have a server with 1 Gbps connection, 32 GB RAM and 2 HDD's in RAID 0 so I was wondering is there some recommendations in regards of tweaking the config for best performance.

Here's my current config:

# This is the rtorrent configuration file installed by rtinst script - https://github.com/arakasi72/rtinst
# This file is installed to ~/.rtorrent.rc
# Enable/modify the options as needed, uncomment the options you wish to enable.
# This configuration will work with most systems, but optimal settings are dependant on specific server setup

### Set Directories
method.insert = cfg.basedir,     private|const|string, (cat,"/home/user/rtorrent/")
method.insert = cfg.watch,       private|const|string, (cat,(cfg.basedir),"watch/")

method.insert = cfg.logs,       private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.logfile,    private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log")

session.path.set = (cat,(cfg.basedir),".session")
directory.default.set = (cat,(cfg.basedir),"download")

schedule = watch_directory,5,5,((load.start,(cat,(cfg.watch),"*.torrent")))

#system.umask.set = 0000

### BitTorrent
# Global upload and download rate in KiB, `0` for unlimited
throttle.global_down.max_rate.set = 0
throttle.global_up.max_rate.set = 0

# Maximum number of simultaneous downloads and uploads slots
throttle.max_downloads.global.set = 300
throttle.max_uploads.global.set = 150

# Maximum and minimum number of peers to connect to per torrent while downloading
throttle.min_peers.normal.set = 30
throttle.max_peers.normal.set = 150

# Same as above but for seeding completed torrents (seeds per torrent)
throttle.min_peers.seed.set = -1
throttle.max_peers.seed.set = -1

### Networking
network.port_range.set = 51001-51250
network.port_random.set = yes
dht.mode.set = on
protocol.pex.set = no
trackers.use_udp.set = true

# network.scgi.open_port = localhost:5000
network.scgi.open_port = 127.0.0.1:5000
network.http.ssl_verify_peer.set = 0
protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext

network.max_open_files.set = 4096
network.max_open_sockets.set = 1536
network.http.max_open.set = 48
network.send_buffer.size.set = 4M
network.receive_buffer.size.set = 4M

### Memory Settings
pieces.hash.on_completion.set = no
pieces.preload.type.set = 1
pieces.memory.max.set = 3500M

### Logging:
#   Levels = critical error warn notice info debug
#   Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
#print = (cat,"Logging to ",(cfg.logfile))
#log.open_file = "log", (cfg.logfile)
#log.add_output = "info", "log"
#log.add_output = "tracker_debug", "log"

### The following line initialises rutorrent plugins without needing to open the web interface
execute = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php user &}

schedule2 = dht_node, 30, 0, "dht.add_node=router.bittorrent.com:6881"
#EOF
stickz commented 3 years ago

Looks good, I would change a few things though.

  1. Add system.file.allocate.set = 1 to enable pre-allocation of files.

  2. Increase network.send_buffer.size.set to 128M (which is the maximum possible value).

  3. Increase upload slots to 300 and reduce download slots to 150.

    throttle.max_downloads.global.set = 150
    throttle.max_uploads.global.set = 300
  4. Schedule rTorrent plugins to run 10 seconds after the program starts instead of instantly. schedule2 = init_plugins, 10, 0, "execute2 = {sh,-c, /usr/bin/php /srv/rutorrent/php/initplugins.php user &}"

  5. Use schedule2 instead of schedule for your watch directory. schedule2 = watch_directory,5,5,((load.start,(cat,(cfg.watch),"*.torrent")))

  6. Add network.xmlrpc.size_limit.set = 5M so you can add more torrents at once.

inside83 commented 3 years ago

thank you so much for this 🙏 I'll make the adjustments ang get back with a feedback

newadventure079 commented 12 months ago

2 years later and we're still waiting for your feedback

Suoritin commented 11 months ago

Thanks for bumping this to the front page of Google so we might get a answer one day

Ser4ph4 commented 1 month ago

3 years later we continue to wait for the return of the warrior, may he be alive... Peace.

kannibalox commented 1 month ago

I'd highly recommend checking out https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning. OP may respond someday, but that page has a wider variety of performance changes that can tested in the meantime