The journey to certification LPIC-2 [ENG]

photo by lpi.org

Welcome to LPIC 2 certification journey. I will detail all topics and points that are described on the timeline of this certification.

This journey will be divided into topics, organized according to the timeline. On this first page, I will cover topic 200 and in the others, following the order.

Topic 200: Capacity Planning

200.1 Measure and Troubleshoot Resource Usage

What will be covered in this topic

iostat, vmstat, mpstat

sar

netstat, ss e iptraf

processos ps, pstree, w, lsof

top, htop e iotop

swap, uptime e free

iostat

IOSTAT — CPU and I/O reporting from storage devices

  • IOSTAT — without any parameters, it will show all information.

avg-cpu:

  • %user: average CPU usage time at the user level. Application, software that root or any other ran.
  • %nice: User level applications that have been set some nice (priority)
  • %system: Kernel CPU usage, resource allocation, interrupts, etc.
  • %iowait: How long the CPU has been waiting for some input and output (read and write). Often used to monitor performance degradation on the disk.
  • %steal: Used in the virtual machine. How long the virtual machine’s CPU has been waiting for the real CPU to give it the resource.
  • %idle: Time the CPU’s was in idle status.

Device:

  • tps: average transfers per second made on sda since it was switched on.
  • KB_read/s: Kilobytes read per seconds
  • KB_wrtn/s: Kilobytes written per seconds
  • KB_read: kilobytes read total
  • KB_wrtn: kilobytes written total
  • iostat -m: display the data in mega MB
  • iostat -h: display the data in human-readable. Display in GB, MB.
  • iostat -c: display only CPU data (avg-cpu).
  • iostat -d: Display only devices.
  • iostat -p: Display only device partitions.
  • iostat -c 2: Generates constant CPU report every 2 seconds e.g. Parameter -c is cpu and number 2 the seconds.
  • p.s: The first result shown is the average time since the virtual machine was turned on. The others are according to the time chosen, in this case, 2 seconds.
  • iostat -d 2 5: Generate devices reports every 2 seconds 5 times and finishes. -d devices, 2 seconds update, 5 repeat times.

vmstat

vmstat — Alternative command to iostat. Shows information about process, memory, swap, I/O, CPU.

  • The first two columns are important
  • r — means what is in the processors’ processing queue. What is being executed or what is going to be executed, in the image1.
  • b — The process is blocked (or dormant) state, when the process is blocked by an I/O procedure, it is BLOCKED. in the image 0
  • vmstat -d — show the data of devices (read, written, I/O)
  • vmstat -p /dev/sda8 — shows theinformation of a specific partition. you must enter the partition with parameter -p.
  • vmstat 2 3 — shows constant report every 2 seconds 3 times.

mpstat

mpstat — Information similar to iostat -c, but only for CPU. It has more information fields, like %irq %soft %gnice, etc.

  • mpstat 2 4 — Constant report every 2 seconds and 4 reports.

Linux system admin