Sometimes there is an update that does not play well with the OS and the component becomes so resource intensive that the CPU runs at 100% and the server becomes extremely slow in responding to your command line entries. What do you do when this happens. Recently this happened to me after updating the ‘clamav’ component on one of my (VPS) CentOS servers. After running a few queries on Google the solution was not immediately clear and my server was getting slower and slower by the minute. The immediate reflex action of any administrator would be to run the ‘top’ command, make a note of the ‘process id’ found under the ‘PID’ column and then issue the ‘kill’ command to resolve the issue. Anyone who has already tried to look into the ‘clamav’ issue knows that this will not work as the ‘clamav’ process simply spawns a new thread and keeps running – thereby creating a new ‘process id’. After attempting to ‘kill’ the process, a new ‘top’ command entry on the command line will reveal a new ‘process id’ belonging to ‘clamav’. Well, the next best thing at this point would be to do an ’emergency stop’ of the process. To begin, run the ‘top’ command and make a note of the entry beneath the ‘COMMAND’ column. Next, run the command ‘ps -aux | grep “the-value-of-the-entry-beneath-the-command-column”‘. From the list that appears, you will then need to identify the executable that is running. Switch to the root user (if you currently are not) and rename the offending executable file that is utilizing the CPU the most (in our example it is 100%) and then reboot the server.
After the server reboots you now have the full responsiveness and full control of your server and you can implement the fix/solution you identified for your issue.