Performance Monitoring & Tuning Flashcards
7 cards from real LCA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Performance Monitoring & Tuning flashcards as text
What does the Linux OOM killer do, and which /proc file stores each process's OOM score?
Answer: It terminates processes to free memory; scores are in /proc//oom_score
When memory is exhausted, the OOM killer selects a victim using /proc//oom_score and kills it.
Which tool provides a flame graph-compatible call-stack profiler for on-CPU and off-CPU analysis in Linux?
Answer: perf record + perf script
perf record captures stack samples; perf script outputs them for flame graph generation with stackcollapse tools.
What kernel parameter controls the maximum number of open file descriptors system-wide?
Answer: fs.file-max
fs.file-max sets the kernel-wide limit on open file handles; per-process limits are set via ulimit.
Which command shows memory usage broken down by shared, private, and anonymous mappings for a specific process?
Answer: Both /proc//smaps and pmap -x provide this detail
Both /proc//smaps and pmap -x show detailed per-mapping memory breakdown including shared and private pages.
What does enabling Transparent Huge Pages (THP) do and when might you disable it?
Answer: THP automatically uses 2MB pages to reduce TLB misses; disable it for databases that manage memory themselves to avoid latency spikes
THP reduces TLB pressure but can cause latency spikes during compaction; databases like Redis and MongoDB recommend disabling it.
Which sysctl tunable directly reduces the time the kernel waits before writing dirty pages to disk?
Answer: vm.dirty_writeback_centisecs
vm.dirty_writeback_centisecs sets the interval (in centiseconds) at which the kernel's flush threads wake to write dirty pages.
What is the effect of setting /proc/sys/kernel/sched_migration_cost_ns to a higher value?
Answer: The scheduler is less likely to migrate tasks between CPUs, improving cache locality at the cost of load balance speed
A higher sched_migration_cost_ns makes migrations more expensive in the scheduler's cost model, favoring cache-hot execution.