Display All CPU in MySQL


Display All CPU(s) With the top Command

As you know, the top command displays All CPU(s) so it is difficult to identify if All CPU(s) are pegged.  Interactively, you can toggle top by pressing the Number 1 on the keyboard, however that toggle cannot be scripted.

The work around is to create a .toprc file in your home directory by pressing the W key (capital W) while top is running.  If you are paying attention, you will see a message that the .toprc file was just created.  From there on out, typing top will display All CPU(s).

Below is a script I run to capture top activity during peak loads.  Make sure you have enough disk space!

vi run_top.sh
#!/bin/sh
#Syntax Below
#./run_top.sh > TOP_UNDER_LOAD.doc
x=1
while [ $x -le 4000 ]        #Run 4000 Times
do
echo "START RUN TIME"
date
\top -n 4
  x=$(( $x + 1 ))
date
echo "END RUN TIME"
sleep 1
done


Comments

Popular posts from this blog

PostgreSQL Database Version 13.4 To MySQL Database Version 8.0.20 Migration by using SQLines Tool

RDS MySQL / MariaDB SSL Connection by using Workbench and command line

Install Mydumper and Myloader Software for Backup of MySQL / MariaDB Databases and Usage of commands