For a while now (8 months or so), my system was sporadically hogged by high iowait and a very high load. Sometimes, this was at random, sometimes this was after I launched an electron app.
The drives and the memory are fine, so this had to come from somewhere else. I quickly found out that fontconfig was (one of) the culprit(s), but I couldn't quite point out were the problem was. Until I stumbled upon this post and this post. To summarize, the users noticed that killing xfsettingsd would remedy the problem. This aligns pretty well with my problem because:
- Only Xorg was plagued by this problem and would become unresponsive, I could still use the tty,
- Killing the X server would sometimes remedy the problem,
- Indeed, killing xfsettingsd would remedy the problem, too.
Furthermore, the first post states that:
Xfsettingsd uses g_file_monitor() calls to monitor those font folders, and runs a call-back function to notify fontconfig when any of those folders are modified. Since those timestamps keep changing, fontconfig constantly gets notified and creates more font cache. That severely impacts system performance, especially for GUI programs need to render texts on the screen.
This is reminiscent of some errors that I found running
journalctl -r | grep -i Fontconfig among whose output I could find, for example:
org.xfce.ScreenSaver: Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected.
A patch has been submitted a while ago to solve this problem. I don't know whether that does the trick or not, but, in any case, I noticed that the fontconfig and lib32-fontconfig from the arch repositories are much more recent than the ones in the manjaro repositories (which are of version 2:2.13.1+12+g5f5ec56-1 versus 2:2.13.91+24+g75eadca-2 for Arch). I did find a 2.13.91 version in the AUR (2:2.13.91+18+g01e4f08-1, fontconfig-git and lib32-fontconfig-git) which, so far, seem to solve the problem without having to kill xfsettingsd.
This is not ideal, as these are AUR packages, but it still is better than a situation were my machine would become unusuable for 10 - 15 min at random.
xfce4-screensaver and reinstalling fontconfig and lib32-fontconfig from the repos, I didn't observe the high iowait seen when xfce4-screensaver was on the system (I got the clue by the fact that xfce4-screensaver isn't on the live image). However, launching electron apps (atomic-tweetdeck and open-vector-editor) led to high iowait again and the system stalling. This behaviour was already present before I replace
lib32-fontconfig(from the repos) with
lib32-fontconfig-git, respectively. I don't know whether anyone else experienced that, though.