Fix: XFCe (up to 4.10 at least): tumblerd using 100% CPU

Post tutorials, HOWTO's and other useful resources here.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Fix: XFCe (up to 4.10 at least): tumblerd using 100% CPU

Post#1 by Rava » 16 Apr 2016, 05:07

I found a solution to the tumblerd og XFCe hogging 100% CPU, especially when browsing folders with many files, especially large files e.g. animated GIF, or huge PNG or animated PNG files, for creating the thumbnails.

It is also described here.

There are two solutions I found online.
Both are scripts. The one that seems to be the "more compact coded" one is from https://wiki.archlinux.org/index.php/th ... o_much_CPU :

Code: Select all

#!/bin/bash
period=20
tumblerpath="/usr/lib/*/tumbler-1/tumblerd" # The * here should find the right one, whether 32 and 64-bit
cpu_threshold=50
mem_threshold=20
max_strikes=2                               # max number of above cpu/mem-threshold's in a row
log="/tmp/tumblerd-watcher.log"

if [[ -n "${log}" ]]; then
    cat /dev/null > "${log}"
    exec >"${log}" 2>&1
fi


strikes=0
while sleep "${period}"; do
    while read pid; do
	cpu_usage=$(ps --no-headers -o pcpu -f "${pid}"|cut -f1 -d.)
	mem_usage=$(ps --no-headers -o pmem -f "${pid}"|cut -f1 -d.)

	if [[ $cpu_usage -gt $cpu_threshold ]] || [[ $mem_usage -gt $mem_threshold ]]; then
	    echo "$(date +"%F %T") PID: $pid CPU: $cpu_usage/$cpu_threshold %cpu MEM: $mem_usage/$mem_threshold STRIKES: ${strikes} NPROCS: $(pgrep -c -f ${tumblerpath})"
	    (( strikes++ ))
	    if [[ ${strikes} -ge ${max_strikes} ]]; then
		kill "${pid}"
		echo "$(date +"%F %T") PID: $pid KILLED; NPROCS: $(pgrep -c -f ${tumblerpath})"
		strikes=0
	    fi
	else
	    strikes=0
	fi
    done < <(pgrep -f ${tumblerpath})
done
Sadly, it won't work that easily for our version / path of tumblerd;

Code: Select all

root@porteus:/# l /usr/lib/*/tumbler-1/tumblerd
ls: cannot access /usr/lib/*/tumbler-1/tumblerd: No such file or directory
root@porteus:/# l /usr/lib64/tumbler-1/tumblerd
-rwxr-xr-x 1 root 91104 2014-10-19 15:15 /usr/lib64/tumbler-1/tumblerd
root@porteus:/# l /usr/lib*/*/tumbler-1/tumblerd
ls: cannot access /usr/lib*/*/tumbler-1/tumblerd: No such file or directory
root@porteus:/# l /usr/lib*/tumbler-1/tumblerd
-rwxr-xr-x 1 root 91104 2014-10-19 15:15 /usr/lib64/tumbler-1/tumblerd

I have not run both scripts to get a good comparison, but by the code alone it seems the wiki.archlinux.org version is more "compact" or "slim-coded" and might be more CPU and RAM friendly.


The other version you can find here:
http://forums.linuxmint.com/viewtopic.p ... rd#p554241


It was posted as solution here https://forum.xfce.org/viewtopic.php?id=8722 and since I do have an forum.xfce account I did post the URL and code of the other, more slim script (as I did above)

Any ideas what the path of the 32 bit version to tumblerd is?
The "longer" version used /usr/lib/i386-linux-gnu/tumbler-1/tumblerd
But I dunno what 32 bit Porteus 3.1 (and upcoming 3.2) are using... I only know what 3.1 84 bit are using.
Cheers!
Yours Rava

sos
White ninja
White ninja
Posts: 6
Joined: 07 Jul 2022, 19:37
Distribution: x86_64 XFCE

Fix: XFCe (up to 4.10 at least): tumblerd using 100% CPU

Post#2 by sos » 15 Apr 2024, 20:54

Just a heads up that this is still a problem in Porteus 5.01 XFCE x86_64.
Apparently nothing to do with Porteus per se (Google shows other distros affected), but with Thunar/Tumbler in certain circumstances.

In my case, I was using the Tree view in the Thunar Side Pane and browsing some pretty big file trees in /tmp while building some modules. The mouse cursor began doing its spinning/wait deal for some ridiculous amount of time while Thunar was working on my last Tree click. Finally I ran top in the terminal and saw that tumblerd was using all the CPU. Closing (or killing) Thunar ended it and gave me back control.

I usually run with the Thumbnails turned off in the guest account ("Show thumbnails: Never" in the Thunar Preferences), but in this case building some modules I was using a root Thunar window and the Thumbnails were probably on. As others have reported (Google), it seems that the Tree view in conjunction with the Thumbnails can exhibit this long-standing problem.

For me, the simplest fix seems to be just running with the Thumbnails off (which I usually do anyway), but now will make sure both my guest AND root accounts are set that way. The next level fix would be to edit /etc/xdg/tumbler/tumbler.rc (setting Disabled=true for some or all of the plugins). I will report back if I experience any more trouble and need to do so. And then, of course we have Rava's earlier fixes if you need Thumbnails.

Post Reply