How To Install & Use Guider in Linux
How you can install and use Guider as a performance analyzer in Linux.
What is Guider?
Guider is a performance analyzer based on Linux open-source which was developed to measure the use of system resources and, taking these analyzes, advise users to improve the performance of the operating system used.
Requirements to use Guider
- Linux kernel (> = 3.0)
- Python (> = 2.7)
- Kernel buffer size = 40960.
To know the version of Python in our system, in this case, Ubuntu 17 Server, we will execute the following:
python3 -version
To see the version of Kernel we run:
uname -r
Ubuntu
sudo apt-get install python3.4
Fedora
sudo dnf install python3.4
OpenSUSE
sudo zypper install python3
Step 1: Install Guider on Linux
To install Guider correctly, it will be necessary to clone the Guider repository located in GitHub by executing the following commands:
git clone https://github.com/iipeace/guider.git
Then we will access the Guider directory executing:
cd guider
Once there we have the following options:
- If we want to run Guider without installation we must execute the following:
guider.py
- If we're going to install it, we proceed to execute the following:
make sudo make install
- If we use PIP in the distribution we can run the following:
sudo pip install --pre guider
For this example we will use the option guide.py to not install the utility in the system, for its start we will run the following:
sudo /guider.py
Step 2: Configure Guider Buffer
By default, guider must configure the size of the buffer for the operations performed in the system, however, in case this does not happen, an error will be generated at the time of execution.
We can verify the size of the buffer with the following command:
sudo cat /sys/kernel/debug/tracing/buffer_size_kb
In case the value is less than 40960 we must execute the next line to establish this value:
echo 40960 | sudo tee /sys/kernel/debug/tracing/buffer_size_kb
With this defined we can start Guider using the line mentioned above:
sudo /guider.py
It will be possible to use guider in the sub-process, function, start, file and system modes using the following syntax:
guider [ mode | file ] [options]
Step 3: Perform CPU Usage Analysis in Thread Mode
With the following command, we will initiate the sequence tracking process which we can finish by pressing the Ctrl + C keys, after this, the data will be saved, and the analysis process will begin to display the analysis report finally.
sudo guider record
Pressing Ctrl + C will store the data and automatically see the results:
We can see details such as date, kernel, system load time and many more parameters.
We can go forward in the report with the AvPag keys or go back with RePag:
As we move forward, we will see new details of the system used.
Step 4: Linux Monitoring in Real Time on Top
With the following command we can see the use of the resources of the Linux processes in real time:
sudo guider.py top
It will be possible to set an interval to show the output using the -i modifier followed by the seconds:
sudo guider top -i 4
Step 5: Analyze Guider Process using PID
To carry out this process, we must first know the PID of the process, in this Apache example, for this, we can execute one of the following options:
pidof apache2 ps -e | grep apache2
We will see the list of associated processes; now, we can use the next line which generates the cycle of the CPU, the instruction number, the IPC, the failures, the lack of cache, the failure of the branch in real time:
sudo guider top -eP -g 1943
The -g parameter filters by the indicated process.
Step 5: Save Guider Results On A File
For administration tasks, it is possible to save the tracking data or any output in a file for its respective analysis.
With the following command, we will save the tracking data in a file called guider.dat, defined by default, in the current directory, but if we wish we can establish a different route:
sudo guider -s.
To save another output in a file named guider.out, by default, in the current directory we will use the following line:
sudo guider top -o.
At the moment we want to see the content of these files we can execute the following commands:
cat guider.dat cat guider.out
In many it will be possible that we wish to obtain the help of Guider, this one we will get it with the following command:
sudo ./guider.py -h
Thus, Guider is an additional aid to everyday administration tasks offering us possibilities to obtain global or real-time results of the elements of the system and therefore manage them in a much more direct way.