rakshasa / rtorrent

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

Very slow to connect to peers, network config issue #1233

Closed Notabbot closed 1 year ago

Notabbot commented 1 year ago

Using rtorrent on a 'seedbox', a shared remote server intended for torrents. After a while it will take a long time, several minutes to almost an hour to connect to a newly added, well-seeded torrent.

This problem develops over time, it is not present shortly after starting rtorrent. I found that if I stop all of my inactive (seeding) torrents then rtorrent will then quickly connect to multiple peers on the new torrent, which suggest to me that the torrent limits and network settings are probably poorly configured and causing a bottle neck.

Below is my configuration, any thoughts on a better configuration?

Shared seedbox (remote server), I can edit rtorrent.rc but not system settings e.g. ulimit handles will remain fixed at 1024 and system receive/send buffers are (max) 4M. 24 GB available RAM

800 seeding torrents Rarely more than a small handful of active torrents rtorrent v0.9.6/0.13.6

Obstensibly a 10 Gbps port, but observed, sustained speed is 160 MB/s down and 90 MB/s up for large, well-seeded torrents, so effective bandwidth appears to be about 1.28 Gbps down and 0.72 Gbps up.

rtorrent.rc #Private trackers dht = disable protocol.pex.set = no trackers.use_udp.set = no #Ports & Housekeeping directory.default.set = /home/abbot/storage/downloads/data/ encoding.add = UTF-8 execute.nothrow = chmod,777,/home/abbot/storage/.appdata/rtorrent/.sessions/ network.port_random.set = yes network.port_range.set = 44210-45000 network.tos.set = throughput encryption = allow_incoming,try_outgoing,enable_retry,require_RC4 network.scgi.open_local = /var/run/abbot/.rtorrent.sock execute.nothrow = chmod,770,/var/run/abbot/.rtorrent.sock schedule = init_plugins, 10, 0, "execute = {sh,-c,/usr/bin/php /srv/html/rutorrent/php/initplugins.php abbot &}" schedule = watch_directory, 5, 5, load.start=/home/abbot/storage/downloads/rtorrent/watch/*.torrent session.path.set = /home/abbot/storage/.appdata/rtorrent/.sessions/ #Memory & FS system.file.max_size.set = 1099511627776 pieces.hash.on_completion.set = no pieces.preload.type.set = 2 pieces.preload.min_rate.set = 51200 pieces.memory.max.set = 3584M system.file.allocate = 1 #Network throttle.global_up.max_rate.set = 0 throttle.global_down.max_rate.set = 0 throttle.max_uploads.global.set = 300 throttle.max_downloads.global.set = 300 ##Max slots per torrent throttle.max_uploads.set = 60 throttle.max_downloads.set = 60 ##Max peers should be at least 2x max slots per torrent throttle.max_peers.normal.set = 200 throttle.max_peers.seed.set = -1 ##n.b. set to 1, broken in v0.9.6/0.13.6 throttle.min_peers.normal.set = 1 throttle.min_peers.seed.set = -1 trackers.numwant.set = 200 ##n.b. ulimit fixed at 1024 network.max_open_files.set = 350 ##Max connections accepted/made by rtorrent network.max_open_sockets.set = 450 network.http.max_open.set = 150 ##n.b. system/max buffer sizes fixed at 4M network.send_buffer.size.set = 4M network.receive_buffer.size.set = 4M ##Default xmlrpc: 524288 network.xmlrpc.size_limit.set = 4M #Logging log.open_file = "rtorrent", (cat,/home/abbot/storage/.appdata/rtorrent//rtorrent.log.,(system.pid)) log.open_file = "tracker", (cat,/home/abbot/storage/.appdata/rtorrent//tracker.log.,(system.pid)) log.open_file = "storage", (cat,/home/abbot/storage/.appdata/rtorrent//storage.log.,(system.pid)) #log.add_output = "info", "rtorrent" #log.add_output = "critical", "rtorrent" #log.add_output = "error", "rtorrent" #log.add_output = "warn", "rtorrent" #log.add_output = "notice", "rtorrent" #log.add_output = "debug", "rtorrent" #log.add_output = "dht_debug", "tracker" #log.add_output = "tracker_debug", "tracker" #log.add_output = "storage_debug", "storage" #EOF
kannibalox commented 1 year ago

I would recommend using the latest release, and looking at https://github.com/rakshasa/rtorrent/wiki/Performance-Tuning for performance tuning tips. You may want to open up a ticket with your provider if you're paying for support.

Notabbot commented 1 year ago

Thanks, there is a lot of good advice there but the recommendations are based on a 74/20 Mbps connection and limited memory. My current config works substantially better than the linked example and miles ahead of what the provider suggests.

Trying to get a better idea of what torrent limit settings are getting saturated from seeding torrents.