CodexBloom - Programming Q&A Platform

High CPU usage from `systemd` on Ubuntu 20.04 due to `journalctl` logs

👀 Views: 27 đŸ’Ŧ Answers: 1 📅 Created: 2025-07-07
linux systemd ubuntu performance bash

I'm experiencing unusually high CPU usage on my Ubuntu 20.04 server, and after monitoring processes, I've pinpointed `systemd-journald` as the culprit. The `journalctl` logs are apparently growing rapidly, and I suspect they might be filled with repetitive behavior messages that are causing the high load. I've tried limiting the size of the journal logs by adding the following lines to `/etc/systemd/journald.conf`: ```ini [Journal] SystemMaxUse=50M SystemKeepFree=100M SystemMaxFileSize=10M ``` After making these changes, I restarted the `systemd-journald` service with `sudo systemctl restart systemd-journald`, but the CPU usage remained high. When I check the logs using `journalctl -xe`, I see a recurring behavior: ``` Oct 10 12:00:01 myserver systemd[1]: Failed to start MyService.service: Unit MyService.service not found. ``` This behavior appears multiple times per second, which I think might be related to a misconfiguration or missing service unit file. I've also executed `systemctl --failed` to identify any failed services, but it returns nothing. Could this be causing the CPU usage? How can I resolve this scenario and prevent `systemd-journald` from consuming excessive resources?