This guide is going to assume the following:
This is a dedicated server and you aren’t sharing this server with anyone else.
You have a 2-10 Gigabit uplink from your server to the internet.
The drive you are downloading to or uploading from is an SSD drive or a Raid array of SSD drives.
Add noatime to partition in /etc/fstab file.
Add “noatime” to the line for your root partition and your other Linux partitions. Not to the line for the swap partition!
An updated line may look like this:
UUID=xxxxx / ext4 noatime,errors=remount-ro 0 1
Note: There should be no space after the comma after noatime! Otherwise boot failure will probably occur.
Add the following code to your /etc/sysctl.conf file.
/etc/sysctl.d/99-sysctl.conf on Arch Linux.
fs.file-max = 2000000
net.core.rmem_default = 134217728
net.core.rmem_max = 134217728
net.core.wmem_default = 134217728
net.core.wmem_max = 134217728
net.core.optmem_max = 134217728
net.core.netdev_max_backlog = 65536
net.core.somaxconn = 4096
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_congestion_control = htcp
net.core.default_qdisc = fq
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_window_scaling = 1
vm.dirty_background_ratio = 5
vm.dirty_ratio = 80
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
We suggest optimizing your home computer with this too if transfer speeds between seedbox and home are slow.
Add the following code to your .rtorrent.rc file.
min_peers = 1
max_peers = 512
min_peers_seed = -1
max_peers_seed = -1
max_uploads = 512
download_rate = 0
upload_rate = 0
network.max_open_files.set = 1024
network.http.max_open.set = 512
pieces.memory.max.set = 28000M
network.xmlrpc.size_limit.set = 4M
network.max_open_sockets.set = 1024
throttle.global_up.max_rate.set_kb = 0
throttle.global_down.max_rate.set_kb = 0
system.file_allocate.set = yes
pieces.preload.type.set = 1
pieces.preload.min_size.set = 262144
pieces.preload.min_rate.set = 5120
network.send_buffer.size.set = 16M
network.receive_buffer.size.set = 4M
A couple of notes…
I set pieces.memory.max.set to 28000M because my server had 32GB of ram. Set this value to 80-90% your total ram.
You may have to delete an rtorrent plugin named throttle to get it to go past gigabit speeds.
You may also want to run the “fstrim -a” command on your server to trim the ssd drives for increased performance.
Here is a great guide with many more general optimizations for running Ubuntu on SSD Drives.
My server was having a hard time getting past 200MB/s until I performed these tweaks on it. It now easily reaches speeds of 500MB/s or more.