deluged using 100% of two cores

General support for problems installing or using Deluge
Post Reply
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

deluged using 100% of two cores

Post by iconoclasthero »

https://pastebin.com/khRinYez

OS: Ubuntu 22.04 jammy
Kernel: x86_64 Linux 5.15.0-50-generic
Uptime: 10d 59m
Shell: bash 5.1.16
Disk: 3.3T / 3.7T (94%)
CPU: Intel Core i5-3570K @ 4x 3.8GHz [51.0°C]
GPU: NVIDIA GeForce GTX 650 Ti BOOST
RAM: 10031MiB / 24001MiB
XDG_CURRENT_DESKTOP=ubuntu:GNOME
default-display-manager: /usr/sbin/gdm3
Kernel info (uname): Linux 5.15.0-50-generic #56-Ubuntu SMP Tue Sep 20 13:23:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ deluged --version; deluge-gtk --version
deluged 2.0.3
libtorrent: 2.0.5.0
Python: 3.10.6
OS: Linux Ubuntu 22.04 Jammy Jellyfish
deluge-gtk 2.0.3
libtorrent: 2.0.5.0
Python: 3.10.6
OS: Linux Ubuntu 22.04 Jammy Jellyfish
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

from #twisted irc:
"It looks like an application bug in deluged to me. deluged is trying to do some metrics tracking or something and has messed up. Twisted is in control of the mainloop so you see a lot of mentions of it but the direct cause of the problem appears to be in deluged itself, not Twisted. Of course, Twisted could be doing something wrong that trips deluged up but it's really hard to see what that might be from just those logs."
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

glyph
New User
New User
Posts: 1
Joined: Wed Oct 26, 2022 6:59 pm

Re: deluged using 100% of two cores

Post by glyph »

Just checking in from the Twisted project to say that we'd be happy to help out if there is some debugging required on the framework side of this issue.
mhertz
Moderator
Moderator
Posts: 2164
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluged using 100% of two cores

Post by mhertz »

@glyph, thanks alot, appreciate you guys! :)

@iconoclasthero, I can be wrong, but i'm pretty sure this is related to libtorrent v2.x together with deluge 2.0.3, which isn't really setup for that as far I remember. Also, deluge 2.0.3 has issue with python 3.8+ and need a fix in deluge 2.0.4 to not spam log upon errors, because extra arg in log module or something of sorts, eludes my memory now honestly, but alike. Also needs twisted v19.7.0+ btw.

It's getting an error about deprecated libtorrent field(in v2.0.x), I think, and because of the python issue spams log and hogs disk/cpu.

If possible then upgrade deluge, or downgrade libtorrent to 1.2.x, but still have the py 3.8+ issue, so the former preferred(e.g. from PPA or pypa).
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

mhertz wrote: Wed Oct 26, 2022 7:37 pm If possible then upgrade deluge, or downgrade libtorrent to 1.2.x, but still have the py 3.8+ issue, so the former preferred(e.g. from PPA or pypa).
As opposed to building from source? I wanted to go with the repo version since one of the sites I use won't let you use a PPA build, but it looks like that is shot.

Inre py 3.8+: I am not sure I really want to mess with Python on this machine as it can break my OS...
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

I used the PPA:
$ deluged --version; deluge-gtk --version
deluged 2.1.1
libtorrent: 2.0.5.0
Python: 3.10.6
OS: Linux Ubuntu 22.04 jammy
deluge-gtk 2.1.1
libtorrent: 2.0.5.0
Python: 3.10.6
OS: Linux Ubuntu 22.04 jammy

$ apt show deluged
Package: deluged
Version: 2.1.1-0~202207101304~ubuntu22.04.1
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

Is it remotely possible that deluged is invoking ffmpeg to look at the files in the download directory? I was in htop (as root) looking at the issues with deluged while also converting something with ffmpeg and while it was converting the files it was supposed to, I would see these fleeting glimpses of ffmpeg in my torrent directory...
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: deluged using 100% of two cores

Post by iconoclasthero »

Unfortunately, now systemctl shows it "active" but it isn't there in ps:*

Code: Select all

# systemctl restart deluged; systemctl status deluged; sleep 5; ps -A|grep deluge
● deluged.service - LSB: Start or stop the Deluge BitTorrent daemon.
     Loaded: loaded (/etc/init.d/deluged; generated)
     Active: active (running) since Wed 2022-10-26 22:41:21 EDT; 11ms ago
       Docs: man:systemd-sysv-generator(8)
    Process: 58281 ExecStart=/etc/init.d/deluged start (code=exited, status=0/SUCCESS)
      Tasks: 1 (limit: 28718)
     Memory: 2.8M
        CPU: 15ms
     CGroup: /system.slice/deluged.service
             └─58288 /usr/bin/python3 /usr/bin/deluged -d -c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L debug

Oct 26 22:41:21 gigabyte systemd[1]: Starting LSB: Start or stop the Deluge BitTorrent daemon....
Oct 26 22:41:21 gigabyte deluged[58281]:  * Starting Deluge BitTorrent Daemon deluged
Oct 26 22:41:21 gigabyte deluged[58281]:    ...done.
Oct 26 22:41:21 gigabyte systemd[1]: Started LSB: Start or stop the Deluge BitTorrent daemon..
  54998 pts/6    00:00:04 deluge-gtk
I'm remote presently and I tried it from my laptop and my phone as well as "locally" via X11 over ssh and no client could see the server...
If, logged in as root (haven't tried it otherwise yet—kinda moot), I call /usr/bin/python3 /usr/bin/deluged -d -c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L info, the clients can see & connect to the server. No idea what is going on. FWIW, I told it to keep my existing config files when apt installed the PPA version.
mhertz
Moderator
Moderator
Posts: 2164
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluged using 100% of two cores

Post by mhertz »

Ubuntu by default generates a systemd service through systemd-sysv-generator, i.e. a crutch between the old and new init system, and i've seen issues with this before, possible this here too, cannot fully remember, but personally then I would myself use straight systemd service as per the official deluge setup docs.

I before messed with this and tested it in a previous ubuntu version(20.04.), and made some quick instructions, so if wanted to try that, then I'll paste the post link here, and it's just the lines at bottom I refer to here. The official deluge instructions for service setup, states to make a deluge user and use that through additional user.conf file, but in my instructions I added service files with debian-deluged already defined as user/group, because that is user generated with the ubuntu repo deluge package, and I also used the default path from that package for profile, instead of the one in the official deluge instructions, but can change if wanted.

These instructions where for the official repo package, but can be used with PPA package too, if having used the repo package before(as having got generated debian-deluged user/group from it before). In the link I also linked official deluge service setup instructions, which if preferred you can use instead, but still need the systemctl disable command for deluged specifically run beforehand to get that annoying sysv/systemd crutch/generator disabled for the deluge package - sounds strange but is needed I found- also states that afterwards i.e. outputs "deluged now omited fom the sysv generator" or something.

viewtopic.php?p=232328#p232328

Edit: To previous question, no deluged never would invoke ffmpeg as far as I know, so not unless scripted yourself through execute plugin or using some other plugin specifically doing such.
Post Reply