In this lesson, you will learn how to capture a statistical snapshot of your network stack to reliably detect performance degradation before it impacts production services.
Why Baseline?
A "performance baseline" isn't just a collection of logs; it is a quantified profile of your server’s network behavior during "known good" operating conditions. Without a baseline, you cannot distinguish between a legitimate traffic spike and a subtle, chronic degradation caused by kernel buffer saturation, interrupt thrashing, or silent packet drops.
Establishing the Metric Set
To establish a baseline, you must observe the kernel's interaction with the hardware under normal load. We focus on three critical dimensions: Throughput (PPS/BPS), Latency (RTT), and Stack Health (Drops/Errors).
You can use the following snippet to capture a 60-second snapshot of interface health, which is essential for identifying your "normal" baseline:
# Capture interface stats to establish baseline metrics
# -i 1 provides a 1-second interval
# -s provides summary statistics
sar -n DEV 1 60 > baseline_stats.txt
The "Steady State" Analysis
Once you have collected data over several days, look for the standard deviation in:
rxpck/sandtxpck/s: The standard packet volume during peak business hours.rxdrop/sandtxdrop/s: Ideally, this should be zero. If your baseline shows consistent drops, you have already identified a bottleneck in your stack—such as insufficient socket buffer sizes or improper interrupt affinity—that needs remediation before it worsens.softnetstatistics: Usecat /proc/net/softnet_statto see if your CPU cores are keeping up with incoming traffic. If thedroppedcolumn is incrementing during your baseline window, your current hardware configuration is failing to keep pace with your application demands.
By documenting these numbers, you create a "fingerprint" of your infrastructure. When users report slowness, you no longer guess; you compare the current live metrics against your stored baseline to see exactly which stage of the kernel stack is deviating from the norm.
Key Takeaway: A network performance baseline turns subjective "slow" reports into objective, actionable data by quantifying the expected behavior of your kernel stack under normal load.