[TUNING] ltConfig Settings and Explanations

Suggest, post, or discuss plugins for Deluge
Post Reply
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

[TUNING] ltConfig Settings and Explanations

Post by ambipro »

Further details about these options and their uses can be found in the libtorrent reference for the settings. https://www.libtorrent.org/reference-Settings.html

If you're looking for tips on how to tune these settings, particularly cache behavior and network and disk performance tuning, you can check out libtorrent's tuning tips. https://www.libtorrent.org/tuning.html

Before applying any ltConfig settings, I suggest you read the reference links above for AT LEAST the settings you are going to change. A single setting can easily cripple an entire Deluge instance.

NOTE: EVEN WHEN UNLOADING THE PLUGIN, ANY SETTINGS THAT YOU HAD PREVIOUSLY SET WILL REMAIN SET, SOMETIME PERSISTING THROUGH THE RESTARTING OF DELUGE. IF YOU FIND YOURSELF NEEDING TO RESET YOUR LTCONFIG, YOU WILL NEED TO LOAD THE LIBTORRENT DEFAULTS, APPLY THEM, AND SOMETIMES EVEN RESTART DELUGE.

For reference point of my settings, and there are obviously others you can tweak as well, I download to a dedicated linux machine with a Samsung 980 Pro NVMe SSD on a i5-13600K with 64GB of DDR5 5600MT/s memory. These settings have resulted in Deluge doing over 210MB/s total throughput (about 1GBit upload and download) simultaneously for me. This is the maximum my connection is capable of transferring.

Please also note, I am using libtorrent v1.2.19 - I do not use v2.x and find 1.2.x to perform substantially better with Deluge.

Your experience with these exact settings, even with the same or similar hardware, may vary. I am providing these as a reference, not a recommendation.

You can find the latest version of the ltConfig plugin with updated "high-performance" presets and options in the ltConfig plugin thread. @mhertz has taken over maintaining this, and posted the latest version here

Thanks to @mhertz for all his help as I researched and studied these, and for maintaining a crucial plugin for the community!

Settings:

"active_tracker_limit": 30000 - This is the total number of active torrents, the default is 1600. If you have more than 1600 torrents, you will notice they will queue randomly to achieve this max. This setting is independent of the regular total active preference option. You will need to increase this as well if you are seeding more than the default of 1600.

"aio_threads": 10 - This specifies the number of I/O threads to use for torrenting. Default is 10. Unless you have a very high performance SSD or many slow disks in a striped raid array you should not increase this much more.

"allow_multiple_connections_per_ip": true - Does exactly what it says, allows multiple connections from a single IP. Shared seedboxes and VPNs may be rejected if this is set to false and multiple users connect to you.

"announce_to_all_tiers": true - These announce options will announce to all tiers, and all trackers in the tiers. This only applies to torrents with more than one tracker associated, such as public trackers.

"announce_to_all_trackers": true - See above.

"checking_mem_usage": 2048 - This is the total amount of memory alloted to the checking process. Depending on the average size of the torrents you are downloading and available memory, this can be increased accordingly.

"choking_algorithm": 0 - This determines how libtorrent will "choke" or cut off peers. Default is 0. The two options are slot based and rate based. You should leave this at 0.

"coalesce_reads": true - The coalesce options are used for I/O and can improve read and write speeds. If you notice decreased performance when enabling or disabling, change it back. Mostly hardware (storage performance) dependent.

"coalesce_writes": true - See above.

"file_pool_size": 5000 - The total number of open files that the session will be able to keep open. Default is 5000 and is usually sufficient. For larger and very active seed bases, this can be increased. Open handles can also negatively affect performance if kept open once inactive.

"listen_queue_size": 15000 - The number of outstanding incoming connections to queue up while we're not actively waiting for a connection to be accepted. Default is 5. For large seed bases, you may want to increase this. You may see warnings about queue size during startup, mostly this will affect initial announces on startup and swarm responsiveness.

"low_prio_disk": false - Sets the disk priority to low. Disable this.

"max_allowed_in_request_queue": 50000 - Similar to listen_queue_size but for request's queue rather than the listening.

"max_concurrent_http_announces": 75 - How many HTTP requests (announces) to allow simultaneously.

"max_failcount": 1 - Amount of failures during attempted connections to a peer before we stop attempting to connect.

"max_out_request_queue": 50000 - Another queue setting for outgoing requests

"max_peer_recv_buffer_size": 5242880 - The number of bytes a single peer connection's receive buffer is allowed to grow to. Larger piece sizes and faster connections can safely increase this from the default (2097152)

"max_queued_disk_bytes": 7340032 - The maximum number of bytes queued to be written that can wait in the disk I/O thread queue

"max_rejects": 10 - The number of piece requests we will reject in a row while a peer is choked before the peer is considered abusive and is disconnected

"mixed_mode_algorithm": 0 - How uTP and TCP connections while torrenting are prioritized or favored. 0 is Prefer TCP. This is generally the best setting.

"no_atime_storage": true - Linux-only option. Passes in the O_NOATIME to open() when opening files. Can improve disk performance in some cases.

"peer_timeout": 20 - Timeout in seconds to wait during a connection to a peer

"peer_turnover": 0 - The percentage of peers to disconnect every peer_turnover_interval (5m default) - If you have unreliable/unstable peers this can be increased slowly. Most reputable private trackers can use 0 safely.

"read_cache_line_size": 32 - The number of blocks to read at a time and place into the cache while processing read operations

"request_timeout": 10 - The time a block (16KiB) is expected to be received within.

"send_buffer_low_watermark": 1048576 - The minimum send buffer target size (send buffer includes bytes pending being read from disk). For relatively high performance servers set this fairly high, to at least fit a few blocks. This is essentially the initial window size which will determine how fast we get to sustained and steady download rates.

"send_buffer_watermark": 3145728 - If the sending buffer has fewer bytes than this, we will read more blocks into it. If this is too low, upload will suffer. This directly relates to memory usage, so keep that in mind when setting this.

"send_buffer_watermark_factor": 150 - This is a multiple of the current upload rate that gets the send_buffer_watermark for a single connection. If you have fast upload, set this greater than 100. Too high of a setting can occupy excess RAM. Tweaking may be necessary.

"send_not_sent_low_watermark": 524288 - Relates to the unsent low watermark settings. This should usually be around half of your send_buffer_low_watermark.

"suggest_mode": 1 - Controls whether libtorrent sends piece suggestions to seeders and peers. This should be enabled.

"support_share_mode": true - Advertises share mode amongst the swarm

"tracker_receive_timeout": 20 - Timeout for responses from trackers during announce

"unchoke_slots_limit": -1 - How many slots to allow to be unchoked - High bandwidth/performance servers can generally set this to -1 (unlimited)

"use_read_cache": true - Self explanatory - Should be enabled

"use_write_cache": false - This can be used for slower disks, such as spinning disks (instead of SSDs) to prevent I/O thrashing. If you're disk has high IOPS and throughput (SSD) then this can usually be disabled.

"validate_https_trackers": true - Whether to validate TLS certificates when announcing. If you are using unreliable/unreputable trackers (public trackers) - you will want to keep this enabled. If your tracker ever has their SSL certificate expire, setting this to false will continue to seed and announce successfully.

"write_cache_line_size": 256 - Similar to read_cache_line_size - the number of blocks that will be read at a time to be placed into the cache or I/O queue.


My full ltConfig.conf

Code: Select all

{
    "file": 1,
    "format": 1
}{
    "apply_on_start": true,
    "settings": {
        "active_tracker_limit": 20000,
        "aio_threads": 10,
        "allow_multiple_connections_per_ip": true,
        "allowed_fast_set_size": 5,
        "announce_to_all_tiers": false,
        "announce_to_all_trackers": false,
        "apply_ip_filter_to_trackers": false,
        "broadcast_lsd": false,
        "checking_mem_usage": 2048,
        "choking_algorithm": 0,
        "coalesce_reads": true,
        "coalesce_writes": true,
        "file_pool_size": 2000,
        "listen_queue_size": 3000,
        "low_prio_disk": false,
        "max_failcount": 1,
        "max_out_request_queue": 2250,
        "max_peer_recv_buffer_size": 5242880,
        "max_queued_disk_bytes": 7340032,
        "max_rejects": 10,
        "mixed_mode_algorithm": 0,
        "no_atime_storage": true,
        "peer_timeout": 20,
        "peer_turnover": 0,
        "rate_limit_utp": false,
        "read_cache_line_size": 32,
        "request_timeout": 10,
        "send_buffer_low_watermark": 1048576,
        "send_buffer_watermark": 3145728,
        "send_buffer_watermark_factor": 150,
        "send_not_sent_low_watermark": 524288,
        "suggest_mode": 1,
        "support_share_mode": true,
        "tracker_receive_timeout": 20,
        "unchoke_slots_limit": -1,
        "use_read_cache": true,
        "use_write_cache": false,
        "validate_https_trackers": true,
        "write_cache_line_size": 256
    }
}
For qBittorrent users who found this via google looking for libtorrent setting explanations, I have a seedbox I've converted the same basic settings in, you can find a screenshot of my qBittorrent 4.4.5 with libtorrent v1 settings below as a reference.

Image
User avatar
Ser4ph4
Member
Member
Posts: 10
Joined: Thu Oct 13, 2022 9:38 pm
Location: Osaka - Japan

Re: [TUNING] ltConfig Settings and Explanations

Post by Ser4ph4 »

Thanks for the contribution, I'm testing this config on a raspberry pi4 4gb 700/400 link
I'll be back with feedback soon.
" Os computadores não merecem confiança! Os humanos menos ainda. "
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: [TUNING] ltConfig Settings and Explanations

Post by ambipro »

I wouldnt really equate a raspberry pi 4 to the hardware I listed, but I guess it can't hurt to test it if you want.
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [TUNING] ltConfig Settings and Explanations

Post by mhertz »

Awesome thread, thank you for making bud, just wanted say that also in public, better late than never I guess lol. Anyway, nice to have something to point people at, instead of bits and pieces scattered all over, then right here at home. Thanks bro.
Post Reply