pyroscope / pyrocore

:wrench: A collection of tools for the BitTorrent protocol and especially the rTorrent client
https://pyrocore.readthedocs.org/
GNU General Public License v2.0
291 stars 43 forks source link

rtControl is very slow #82

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hi,

I am using rtControl to manage my queue and delete stuff after seeding etc. etc. Every rtcontrol command I do takes minutes to complete.

~/bin/rtcontrol is_complete=yes tracker=SOMETRACKER ratio=+0 custom_2!=forever OR is_complete=yes tracker=SOMETRACKER seedtime=+1s custom_2!=forever --cull --yes`

Anything I can do about the speed? The machine it runs on has a powerful CPU and lots of RAM. Sometimes there are a few hundred torrents seeding but I don't think that's why it should be slow.

pyroscope commented 5 years ago

For one, OR binds differently that you think. Use [ … ].

And there's -v and --debug, find out what's broken in your install.

ghost commented 5 years ago

so instead of OR I literally type [ ... ]

?

joydashy commented 5 years ago

I am having similar issue on some of my nodes, here's the debug log:

[13:17 rb@burke ~] > ~/bin/rtcontrol xfer=+0 --debug -v DEBUG Options: alter_view=None, anneal=[], append_view=False, call=None, close=False, column_headers=False, config_dir=None, config_file=[], cron=False, cull=False, custom=None, debug=True, defines=[], delete=False, detach=False, dry_run=False, exec=None, fast_query='=', flush=False, from_view=None, hash_check=False, help_fields=False, ignore=None, interactive=False, json=False, modify_view=None, nul=False, output_format=None, output_template=None, prio=None, purge=False, quiet=False, reverse_sort=False, select=None, shell=False, sort_fields=[], spawn=[], start=False, stats=False, summary=False, tag=None, tee_view=False, throttle=None, to_view=None, verbose=True, view_only=False, yes=False DEBUG Loading '/home/rb/.pyroscope/config.ini'... DEBUG Loading '/home/rb/.pyroscope/config.py'... DEBUG Sorting order is: name, alias DEBUG Matcher is: xfer=+0 DEBUG Loading rtorrent config from '/home/rb/.rtorrent.rc' DEBUG rtorrent.rc: scgi_port = 127.0.0.1:5000 DEBUG CMD MAPPINGS ARE: {'log=': 'print=', 'log': 'print'} DEBUG XMLRPC raw request: "<?xml version='1.0'?>\n\nsystem.client_version\n\n\n\n" DEBUG system.client_version() took 405.003 secs DEBUG XMLRPC raw request: "<?xml version='1.0'?>\n\nsystem.library_version\n\n\n\n" DEBUG system.library_version() took 0.004 secs

So system.client_version is taking ~7 minutes...

kannibalox commented 5 years ago

Your issue sounds like the client (or just the scgi port/socket) is being blocked for that amount of time @joydashy

joydashy commented 5 years ago

From some more testing, it does appear to work (usually) after 8+ minutes. Is that normal, only a couple hundred torrents?

ghost commented 5 years ago

Exact same issue as @joydashy here.

pyroscope commented 5 years ago

Use sysdig or similar to find out what's broken with your setups. And no, it is not normal.

pyroscope commented 4 years ago

Very very likely an rtorrent or host setup issue, closing.

You might wanna try to use a unix domain socket instead of TCP.