Typically my job doesn’t end with a website… more often than not, our clients at We Create Digital are keen to automate, simplify and integrate their business processes within their website. Why? Because it makes their lives easier! Occasionally handling systems which run large database queries on popular websites can be problematic.
I was challenged with a problem on a server which was having high CPU issues. After a few hours of troubleshooting, I was keen to understand what was going on behind the scenes.
I took the following action:
- I installed htop using
sudo apt-get install htopand after installation I ran
htopand could instantly see a mysql process was running at around 180%
- Knowing that the database was responsible for the high CPU, logged into mysql and ran
SHOW FULL PROCESSLISTand I could very quickly see the query responsible
Fortunately the query was not business critical and could be turned off. The CPU usuage dropped considerably straight away and a new solution is being put together.
Monitoring the server more closely going forward:
We share a Slack workgroup with the client and use a Digital Ocean server to run our application. The solution was obvious… use monitoring Slack alerts and now we can be informed before problems arrise, even when the most carefully planned queries are put together!