I am confused about the network speed outputs:
If the report says:
sar -n DEV 1 1
Linux 2.6.18-194.el5PAE (dev-db) 03/26/2011 _i686_ (8 CPU)
01:11:13 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
01:11:14 PM eth0 342.57 342.57 93923.76 141773.27 0.00 0.00 0.00
Does it mean that there is only an average of 342 packets that could have transmitted in the last second or it mean there is an average of 342 packets that were actually transmitted in the last second?
I think the second sentence is correct. But how can it tell the network performance is good or bad? I mean it only tells how many packets actually were transmitted but doesn't tell the reason if there is demand/no demand for packet transmission or if the throughput is reduced due to external network traffic.
This question has been there in my mind for years.
Since you requested one sample at the interval of one second, sar gave you the instant speed. It means it shows the speed in one second, while it was measuring it.
As about the question "does this show the bottleneck, or it doesn't", this doesn't give any answer. This depends primarily on the conditions of the sample taken. If the conditions were created in such a way, that host should present all of it networking performance capabilities to either direction, for example you have pulled the file large enough from this host to another, with encryption and/or compression as low as possible, for the host to show all of it transmitting performance, or, au contraire, you have pulled the large file from another host to this host to measure it's receiving capabilities (assuming in both cases that other host capabilities and the intermediate channel are already tested and proven that they are at some reference condition) - then yes, it would give you the maximum performance cap and some food for thought.
If not - then no, this is some random data, showing some network exchange and the instant speed of it. Although this is meaningful too, for example when you have to determine what is the host network load.
Neither actually.
man sar
And in other words, if the interval is set, then the displayed statistics are the average for the selected interval.
In your example, with the interval set to
1
, you get the "average" statistics over the last second.The statistics are based on cumulative activity counters in the operating system and show what your system actually did, either since boot when the counters start at
0
, or the difference between their valuenow
and their value<interval>
seconds ago (averaged over either the uptime or the selected interval).