LCA Performance Monitoring & Tuning 5 — Questions and Answers
Question 1: Which command measures and displays network interface statistics including packets, errors, and drops in real time?
- ip -s link
- netstat -i
- Both ip -s link and netstat -i show interface statistics (Correct answer)
- ss -s
Correct answer: Both ip -s link and netstat -i show interface statistics
Both 'ip -s link' and 'netstat -i' display per-interface packet counters; ip -s link is the modern preferred tool.
Question 2: What does 'numactl --membind' do when running a process on a NUMA system?
- Restricts memory allocations to specified NUMA nodes, reducing cross-node memory latency (Correct answer)
- Binds the process to specific CPU cores only
- Sets the process memory limit
- Enables huge page allocation for the process
Correct answer: Restricts memory allocations to specified NUMA nodes, reducing cross-node memory latency
numactl --membind forces memory allocations to the listed NUMA nodes, improving locality for memory-intensive workloads.
Question 3: Which tool can trace kernel function calls and measure their latency using eBPF without modifying the kernel?
- bpftrace (Correct answer)
- ftrace
- systemtap
- dtrace
Correct answer: bpftrace
bpftrace uses eBPF programs to instrument kernel and user-space functions dynamically without kernel modification.
Question 4: A server shows high CPU steal time (st) in top. What does this indicate?
- A hypervisor is consuming CPU cycles that the VM requested, indicating resource contention on the host (Correct answer)
- The kernel is stealing CPU from user processes for system tasks
- Processes are being preempted by higher-priority tasks
- The CPU governor is throttling frequency
Correct answer: A hypervisor is consuming CPU cycles that the VM requested, indicating resource contention on the host
CPU steal time appears in virtualized environments when the hypervisor is running other guests and cannot service this VM's requests.
Question 5: What does the 'tuned' daemon do in Linux performance management?
- Applies predefined and custom tuning profiles to kernel parameters, CPU governors, and disk settings automatically (Correct answer)
- Monitors CPU temperature and throttles frequency
- Manages cgroup resource limits for containers
- Schedules batch jobs during low-utilization periods
Correct answer: Applies predefined and custom tuning profiles to kernel parameters, CPU governors, and disk settings automatically
tuned dynamically switches between profiles (e.g., throughput-performance, latency-performance) to optimize the system for its workload.
Question 6: Which command shows how much memory is currently used by the kernel's slab allocator (dentries, inodes, etc.)?
- slabtop (Correct answer)
- free -m
- vmstat -m
- cat /proc/buddyinfo
Correct answer: slabtop
slabtop displays real-time kernel slab cache usage, showing which object types consume the most memory.
Question 7: What is the recommended way to permanently apply sysctl tuning parameters across reboots?
- Add the parameters to a file in /etc/sysctl.d/ and run sysctl --system (Correct answer)
- Add them to /etc/rc.local
- Write them to /proc/sys/ in a startup script
- Set them in /etc/security/limits.conf
Correct answer: Add the parameters to a file in /etc/sysctl.d/ and run sysctl --system
Files in /etc/sysctl.d/ are loaded at boot by systemd-sysctl; 'sysctl --system' applies them immediately without rebooting.
Which command measures and displays network interface statistics including packets, errors, and drops in real time?