LCA Performance Monitoring & Tuning 3 — Questions and Answers
Question 1: Which command from the sysstat suite collects and reports historical system activity data on a scheduled basis?
- sadc (Correct answer)
- sar
- iostat
- pidstat
Correct answer: sadc
sadc (System Activity Data Collector) is the backend daemon that records data later read by sar.
Question 2: What does the 'b' column in vmstat output represent?
- Number of processes blocked waiting for I/O or other resources (Correct answer)
- Amount of buffer cache in kilobytes
- Number of page faults per second
- Bytes transferred per second
Correct answer: Number of processes blocked waiting for I/O or other resources
The 'b' column in vmstat shows processes in uninterruptible sleep, typically waiting on I/O.
Question 3: Which command pins a process or command to specific CPU cores using a CPU affinity mask?
- taskset (Correct answer)
- cpuset
- numactl
- cgroup
Correct answer: taskset
taskset sets or retrieves a process's CPU affinity, controlling which cores it may run on.
Question 4: What does 'iowait' percentage in top or mpstat specifically measure?
- CPU time spent idle while at least one I/O request was outstanding (Correct answer)
- Time the disk spent processing requests
- Network I/O wait time
- Time waiting for memory pages to be loaded
Correct answer: CPU time spent idle while at least one I/O request was outstanding
iowait is CPU idle time that occurs when the system has pending disk I/O, indicating potential I/O saturation.
Question 5: Which /sys path allows you to change the I/O scheduler for a specific block device at runtime?
- /sys/block/<dev>/queue/scheduler (Correct answer)
- /proc/sys/vm/scheduler
- /etc/udev/rules.d/scheduler
- /proc/block/<dev>/iosched
Correct answer: /sys/block/<dev>/queue/scheduler
Writing a scheduler name (e.g., 'mq-deadline') to /sys/block/<dev>/queue/scheduler changes it live.
Question 6: What is the primary advantage of the 'BFQ' (Budget Fair Queuing) I/O scheduler for desktop workloads?
- It allocates I/O bandwidth proportionally to processes, reducing latency for interactive applications (Correct answer)
- It maximizes raw disk throughput for sequential workloads
- It is the simplest scheduler with least overhead
- It is optimized for NVMe SSDs with multiple queues
Correct answer: It allocates I/O bandwidth proportionally to processes, reducing latency for interactive applications
BFQ provides per-process fair I/O budgeting, improving responsiveness for interactive tasks.
Question 7: Which command reports per-process disk I/O statistics including reads, writes, and I/O delay?
- pidstat -d (Correct answer)
- iotop -b
- iostat -p
- blktrace -p
Correct answer: pidstat -d
pidstat -d shows disk I/O statistics broken down by process ID.
Which command from the sysstat suite collects and reports historical system activity data on a scheduled basis?