Announcement

Collapse
No announcement yet.

Rtorrent configuration

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rtorrent configuration

    Originally posted by Copper View Post

    Rutorrent is not a client. It is a web interface to an actual client. The actual client is rtorrent, not rutorrent. And predictably, you didn't tell us what version of rtorrent or libtorrent you have. Entering settings in rutorrent is not persistent. They will only stick for the current session and would be lost when the client restarts. Persistent settings need to be set in .rtorrent.rc

    This kind of configuration information is particularly hard to come by for a variety of reasons. Ideal settings are specific to a given platform. They are determined empirically, i.e. someone tests them in real life.. setting more aggressive settings until it becomes unstable, then backs off a bit. No one will be able to give you an ideal set of settings with any certainty on paper.

    Try this to start. This is a moderately aggressive configuration suitable for a gigabit box. It should perform well for you. If you still unhappy. Or greedy.. and willing to spend the time, you can tweak further, particularly with respect to memory utilization.

    [spoiler=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
    #
    # based on original .rtorrent.rc file from The libTorrent and rTorrent Project
    # this assumes the following directory structure:
    #
    # /torrents/downloading - temporary location for torrents while downloading (see "directory")
    # /torrents/complete - torrents are moved here when complete (see "on_finished")
    # /torrents/torrentfiles/auto - the 'autoload' directory for rtorrent to use
    # rtorrent will automatically load .torrents placed here. (see "schedule = watch_directory")
    # /torrents/downloading/rtorrent.session - for storing rtorrent session information
    #


    # Downloads Settings
    #
    # maximum number of simultaneous uploads per torrent
    # throttle.max_uploads.set = 30
    max_uploads = 50

    # maximum and minimum number of peers to connect to per torrent
    # throttle.min_peers.normal.set = 40
    # throttle.max_peers.normal.set = 100
    min_peers = 30
    max_peers = 512

    # same as above but for seeding completed torrents (-1 = same as downloading)
    # throttle.min_peers.seed.set = 25
    # throttle.max_peers.seed.set = 60
    min_peers_seed = 40
    max_peers_seed = 512

    # tracker_numwant = -1
    trackers.numwant.set = -1

    # check hash for finished torrents. might be useful until the bug is
    # fixed that causes lack of diskspace not to be properly reported
    # pieces.hash.on_completion.set = yes
    check_hash = yes

    # default directory to save the downloaded torrents
    # directory.default.set = /home/<username>/downloads
    directory = /home/<username>/downloads

    # default session directory. make sure you don't run multiple instances
    # of rtorrent using the same session directory
    # perhaps using a relative path?
    # session.path.set = /home/<username>/downloads/.session
    session = /home/<username>/downloads/.session


    # Connection Settings
    #
    # port range to use for listening
    # network.port_range.set = 55950-56000
    port_range = 55950-56000

    # start opening ports at a random position within the port range
    # network.port_random.set = yes
    port_random = yes

    # global upload and download rate in KiB. "0" for unlimited
    # throttle.global_up.max_rate.set_kb = 0
    # throttle.global_down.max_rate.set_kb = 0
    upload_rate = 0
    download_rate = 0

    # max mapped memory
    # nb does not refer to physical memory
    # max_memory_usage = 3500M
    pieces.memory.max.set = 4500M

    # max number of files to keep open simultaneously
    # max_open_files = 192
    network.max_open_files.set = 20000

    # max_open_http = 32
    network.http.max_open.set = 128


    # BitTorrent Settings
    #
    # enable DHT support for trackerless torrents or when all trackers are down
    # may be set to "disable" (completely disable DHT), "off" (do not start DHT),
    # "auto" (start and stop DHT as needed), or "on" (start DHT immediately)
    # the default is "off". for DHT to work, a session directory must be defined
    #
    # dht.mode.set = disable
    dht = disable

    # UDP port to use for DHT.
    #
    # dht_port = 6881
    # dht.port.set = 6881

    # enable peer exchange (for torrents not marked private)
    # protocol.pex.set = no
    peer_exchange = no

    # the IP address reported to the tracker
    # network.local_address.set = rakshasa.no
    # network.local_address.set = 127.0.0.1
    # ip = rakshasa.no
    # ip = 127.0.0.1

    # schedule syntax: id,start,interval,command
    # call cmd every interval seconds, starting from start. an interval of zero calls the task once
    # while a start of zero calls it immediately. start and interval may optionally use a time format
    # dd:hh:mm:ss e.g. to start a task every day at 18:00, use 18:00:00,24:00:00.
    # commands: stop_untied =, close_untied =, remove_untied =
    # stop, close or remove the torrents that are tied to filenames that have been deleted

    # watch a directory for new torrents, and stop those that have been deleted
    schedule = watch_directory,5,5,load_start=/home/<username>/downloads/watch/*.torrent
    schedule = untied_directory,5,5,stop_untied=

    # 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

    # load = file, load_verbose = file, load_start = file, load_start_verbose = file
    # load and possibly start a file, or possibly multiple files by using the wild-card "*"
    # this is meant for use with schedule, though ensure that the start is non-zero
    # the loaded file will be tied to the filename provided.

    # when the torrent finishes, it executes "mv -n <base_path> ~/Download/"
    # and then sets the destination directory to "~/Download/". (0.7.7+)
    # on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/home/<username>/downloads/complete/ ;d.set_directory=/home/<username>/downloads/complete/"

    # network.scgi.open_port = 127.0.0.1:5000
    scgi_port = 127.0.0.1:5000

    # 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,pref er_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
    #
    # protocol.encryption.set =
    encryption = allow_incoming,enable_retry,prefer_plaintext


    # Advanced Settings
    #
    # do not modify the following parameters unless you know what you're doing
    #

    # 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"

    # hash read-ahead controls how many MB to request the kernel to read ahead 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 = 8
    # system.hash.read_ahead.set = 8

    # interval between attempts to check the hash, in milliseconds
    # hash_interval = 50
    # system.hash.interval.set = 50

    # 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 = 3
    # system.hash.max_tries.set = 3

    # SSL certificate name
    # http_cacert =
    # SSL certificate path
    # http_capath =

    # throttle.max_downloads.div.set =
    # max_downloads_div =

    # throttle.max_uploads.div.set =
    # max_uploads_div =

    system.file.max_size.set = -1

    # preload type 0 = Off, 1 = madvise, 2 = direct paging
    pieces.preload.type.set = 1
    pieces.preload.min_size.set = 262144
    pieces.preload.min_rate.set = 5120
    network.send_buffer.size.set = 1M
    network.receive_buffer.size.set = 131072

    pieces.sync.always_safe.set = no
    pieces.sync.timeout.set = 600
    pieces.sync.timeout_safe.set = 900

    # scgi_dont_route =
    # network.scgi.dont_route.set =

    # session.path.set =
    # session.name.set =
    session.use_lock.set = yes
    session.on_completion.set = yes

    system.file.split_size.set = -1
    system.file.split_suffix.set = .part

    # set whether the client should try to connect to UDP trackers
    # use_udp_trackers = yes
    trackers.use_udp.set = yes

    # use a http proxy. [url] ;an empty string disables this setting
    # http_proxy =
    # network.http.proxy_address.set =

    # The IP address the listening socket and outgoing connections is bound to
    # network.bind_address.set = rakshasa.no
    # network.bind_address.set = 127.0.0.1
    # bind = rakshasa.no
    # bind = 127.0.0.1

    # number of sockets to simultaneously keep open
    # max_open_sockets = 65023
    network.max_open_sockets.set = 20480

    # set the umask applied to all files created by rtorrent
    # system.umask.set =

    # alternate keyboard mappings
    # qwerty | azerty | qwertz | dvorak
    # key_layout = dvorak
    # keys.layout.set = dvorak
    [/spoiler]









    I've been playing around with this as a starting point and I was trying to understand 2 pieces of the config that I can't seem to get working:

    #network.max_open_files.set = 20000
    #network.max_open_sockets.set = 20480

    I have my files limits set at 4096 and I am googled for a bit trying to understand what those two settings are specifically doing. When I uncomment them, I get a number of "cannot resolve host name" for torrents and they error out. I comment them out, no issues.

    for pid in `pidof rtorrent`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done
    rtorrent
    Limit Soft Limit Hard Limit Units
    Max open files 4096 4096 files
    Currently open files: 176


    Are those two settings related back to the max open files and my numbers are just too low currently?

  • #2

    Thread split.
    We'd prefer that you don't "hijack".. even though it was an old and inactive thread.




    I spoke to you briefly earlier and urged you to post a lot more detail about your configuration. I'm a little dismayed to see that you didn't do so. I don't intend to be rude, but to make a point - we are not psychic. The lack of crucial detail severely constrains us from providing useful advice. In fact without specific details, it's largely guess work.

    There are multiple open file settings and you didn't tell us which of those you are referring to. And they have dependencies as well so the context of other parameters would have been invaluable to narrow down the potential issues. Also if you happen to be using an older version of rtorrent, your troublesome parameters may be throwing errors because they require the old style (depreciated) syntax. Or constraints in your VPS config may be conflicting with rtorrent.

    Amongst other things, it would have been highly useful to know what your rtorrent, rutorrent, OS and processor (stepping) versions were. A debug log, full rtorrent & VPS configs.. et al. When in doubt, a useful rule of thumb is to append too much detail, rather than too little. Basically everything, including the kitchen sink. In your place, I would only obscure IP + email addresses or tracker nicks.

    The settings recommended to you included these:

    network.max_open_files.set = 20000
    network.http.max_open.set = 128
    If you set the latter to 4096, that would certainly cause you issues.

    Feel free to think me rude or a hardass.. but the more detail you provide, the better the advice you are likely to find. Trouble shooting (and perhaps supermods) can be frustrating and I wish you luck in chasing down your gremlins.


    Last edited by Copper; September 26, 2013, 10:51 AM.
    Fortune and love favour the brave .-. Ovid ....

    Comment


    • #3
      Let me see if I can add some more detail as I was trying to really understand what those two settings were accomplishing.

      VPS Configuration:
      Code:
      OS: Ubuntu 13.04
      
      processor    : 5
      vendor_id    : GenuineIntel
      cpu family    : 6
      model        : 30
      model name    : Intel(R) Xeon(R) CPU           X3440  @ 2.53GHz
      stepping    : 5
      cpu MHz        : 1197.000
      cache size    : 8192 KB
      physical id    : 0
      siblings    : 8
      core id        : 1
      cpu cores    : 4
      apicid        : 3
      initial apicid    : 3
      fpu        : yes
      fpu_exception    : yes
      cpuid level    : 11
      wp        : yes
      flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm dts tpr_shadow vnmi flexpriority ept vpid
      bogomips    : 5053.85
      clflush size    : 64
      cache_alignment    : 64
      address sizes    : 36 bits physical, 48 bits virtual
      power management:
      
      cat /proc/meminfo 
      MemTotal:        4194304 kB
      MemFree:            4596 kB
      Cached:          3836332 kB
      Active:           109884 kB
      Inactive:        4025808 kB
      Active(anon):      87208 kB
      Inactive(anon):   212152 kB
      Active(file):      22676 kB
      Inactive(file):  3813656 kB
      Unevictable:           0 kB
      Mlocked:               0 kB
      SwapTotal:             0 kB
      SwapFree:              0 kB
      Dirty:                 4 kB
      Writeback:             0 kB
      AnonPages:        299360 kB
      Shmem:              4180 kB
      Slab:              53988 kB
      SReclaimable:      44664 kB
      SUnreclaim:         9324 kB
      
      uname -a
      Linux xxx 2.6.32-042stab076.5 #1 SMP Mon Mar 18 20:41:34 MSK 2013 x86_64 x86_64 x86_64 GNU/Linux
      My full .rtorrentrc. I XXXed some of my personal stuff.
      Code:
      encoding_list = UTF-8
      #port_range = 61000-61000
      #port_random = no
      directory = /home/XXX/autotools_seed
      session = /home/XXX/.session/rtorrent/state
      
      #Autowatch Directories for things that download as rar files
      schedule = watch_directory_XXX,5,5,"load_start=/home/felix/autowatch/XXX/*.torrent,d.set_directory=/home/felix/seed/TV,,d.set_custom1=TV"
      schedule = watch_directory_XXX,5,5,"load_start=/home/felix/autowatch/XXX/*.torrent,d.set_directory=/home/felix/seed/XXX,,d.set_custom1=XXX"
      schedule = watch_directory_XXX,5,5,"load_start=/home/felix/autowatch/XXX/*.torrent,d.set_directory=/home/felix/seed/XXX,,d.set_custom1=XXX"
      system.method.set_key = event.download.inserted_new,move_tor,"execute=mv,-u,$d.get_loaded_file=,~/.session/rtorrent/torrents/"
      
      # Logging 
      log.open_file = "rtorrent", ~/logs/rtorrent.log
      log.add_output = "notice", "rtorrent" 
      
      # Connection Settings
      #
      # port range to use for listening
      # network.port_range.set = 55950-56000
      port_range = 55950-56000
      
      # start opening ports at a random position within the port range
      # network.port_random.set = yes
      port_random = yes
      
      # global upload and download rate in KiB. "0" for unlimited
      # throttle.global_up.max_rate.set_kb = 0
      # throttle.global_down.max_rate.set_kb = 0
      upload_rate = 0
      download_rate = 0
      
      # max mapped memory
      # nb does not refer to physical memory
      # max_memory_usage = 3500M
      pieces.memory.max.set = 4500M
      
      # max number of files to keep open simultaneously
      # max_open_files = 192
      #network.max_open_files.set = 20000
      #network.max_open_files.set = 512
      
      # max_open_http = 32
      network.http.max_open.set = 128
      
      # Off for Private Trackers
      dht = disable
      peer_exchange = no
      
      # close torrents when diskspace is low. */
      schedule = low_diskspace,5,60,close_low_diskspace=100M
      
      # network.scgi.open_port = 127.0.0.1:5000
      scgi_port = 127.0.0.1:5000
      
      # encryption options, set to none (default) or any combination of the following:
      # allow_incoming, try_outgoing,require,require_RC4,enable_retry,pref er_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
      #
      # protocol.encryption.set =
      encryption = allow_incoming,enable_retry,prefer_plaintext
      
      
      # Advanced Settings
      #
      # do not modify the following parameters unless you know what you're doing
      #
      
      # 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"
      
      # hash read-ahead controls how many MB to request the kernel to read ahead 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 = 8
      # system.hash.read_ahead.set = 8
      
      # interval between attempts to check the hash, in milliseconds
      # hash_interval = 50
      # system.hash.interval.set = 50
      
      # 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 = 3
      # system.hash.max_tries.set = 3
      
      # SSL certificate name
      # http_cacert =
      # SSL certificate path
      # http_capath =
      
      # throttle.max_downloads.div.set =
      # max_downloads_div =
      
      # throttle.max_uploads.div.set =
      # max_uploads_div =
      
      system.file.max_size.set = -1
      
      # preload type 0 = Off, 1 = madvise, 2 = direct paging
      pieces.preload.type.set = 1
      pieces.preload.min_size.set = 262144
      pieces.preload.min_rate.set = 5120
      network.send_buffer.size.set = 1M
      network.receive_buffer.size.set = 131072
      
      pieces.sync.always_safe.set = no
      pieces.sync.timeout.set = 600
      pieces.sync.timeout_safe.set = 900
      
      # scgi_dont_route =
      # network.scgi.dont_route.set =
      
      # session.path.set =
      # session.name.set =
      session.use_lock.set = yes
      session.on_completion.set = yes
      
      system.file.split_size.set = -1
      system.file.split_suffix.set = .part
      
      # set whether the client should try to connect to UDP trackers
      # use_udp_trackers = yes
      trackers.use_udp.set = yes
      
      # use a http proxy. [url] ;an empty string disables this setting
      # http_proxy =
      # network.http.proxy_address.set =
      
      # The IP address the listening socket and outgoing connections is bound to
      # network.bind_address.set = rakshasa.no
      # network.bind_address.set = 127.0.0.1
      # bind = rakshasa.no
      # bind = 127.0.0.1
      
      # number of sockets to simultaneously keep open
      # max_open_sockets = 65023
      #network.max_open_sockets.set = 20480
      
      # set the umask applied to all files created by rtorrent
      # system.umask.set =
      
      # alternate keyboard mappings
      # qwerty | azerty | qwertz | dvorak
      # key_layout = dvorak
      # keys.layout.set = dvorak
      From a logging perspective, I did not get any information in the logs:
      1380196375 W The SCGI socket is bound to a specific network device yet may still pose a security risk, consider using 'scgi_local'.

      What I see in my rtorrent screen though is a number of issues related to torrents erroring out:
      Tracker: [Couldn't resolve host name]

      The only setting I uncommented at this point is:
      network.max_open_files.set = 512, which seems to break everything.

      I was trying to understand what that setting is and tied back to from the OS perspective. I thought it was the open_files yet that does not seem to be the case.

      Also, I do not think anything you have said is rude or being a hardass. From everything I've seen/read, you want to be helpful and are asking for enough information from my perspective to be helpful. That is appreciated.

      Comment


      • #4

        You have a positive attitude, but you still haven't provided a lot of the requested details. From what you did add, nothing jumps out. The SCGI message isn't pertinent.

        Regrettably, I don't have the time to chase this thread for the remaining information. What version or rtorrent do you have?? Try killing your rtorrent /screen PIDs, then invoke rtorrent from the cmd line and watch for any config file parsing errors. I'd also recheck .rtorrent.rc for typos. And try to snag the actual VPS config file and a rtorrent handshake debug log. We have a lot of knowledgeable members who can probably help if they have something to chew on.










        Fortune and love favour the brave .-. Ovid ....

        Comment


        • #5
          I'm running the current version of rtorrent / librorrent :

          rtorrent-0.9.3 and libtorrent-0.13.3

          I've tried restarting a number of time and validated a reboot. I see no parsing errors when starting it up by hand.

          I'll see if I can snag the actual VPS file as well. I was still just trying to correlate what that parameter is choking from a configuration perspective.

          Comment


          • #6

            This .rtorrent.rc file has been used on any number of servers uneventfully. Perhaps your VPS configuration is the bottleneck. Try scaling the two or three apparently troublesome rtorrent parameters down to minimal values, and then restart rtorrent (or reboot).















            Fortune and love favour the brave .-. Ovid ....

            Comment


            • #7
              I just kept tweaking at little things here and there and never really got the performance I was hoping for.

              In the end, I punted and gave up on the VPS approach and just stuck with a provider at a shared seedbox level instead of trying to go down the VPS route as without being able to understand all the pieces behind the scenes, it was too much to get working in the manner I wanted.

              In the end, I'm using the stock configuration so far with great results both on my current seedbox and my home configuration so that seems solid. I'm guessing the smaller pieces that did not work for me were very specific to the VPS configuration.

              I'll chalk it up as a learning experience and thanks for the assistance!

              Comment

              Working...
              X