If like us you’ve been noticing decreased SSH terminal responsiveness on your server recently, or high CPU usage by a process called “mingetty”, you’ll want to know why this process is eating up your valuable CPU time and stop it doing so!
For those of you who don’t know, mingetty is, as the manual page puts it, “a minimal getty for use on virtual consoles” – it is the process that handles the activity of your virtual console (like PuTTY). If mingetty’s CPU usage is high, and/or your console responds slowly (particularly while running certain programs like top), a likely reason is that your utmp log file is getting large, and thus opening and writing to this file becomes resource intensive.
Simply delete/move your current utmp log and create a fresh empty one. We moved ours:
mv /var/run/utmp /var/run/utmp.BAK
That’s it! Let’s see if this has solved the issue…
Hooray, it worked! Our CPU usage has now evened out to an acceptable level. You can check the CPU usage of mingetty by typing “top” into your console.
The utmp log contains information on all logins to your console, so you may need to repeat this step every now and again to prevent this happening again. Although you should keep tabs on who is logging into your system at all times, you could also just remove the /var/run/utmp logfile completely so you don’t need to keep repeating this method.