Apparent Discrepancies in Bandwidth Usage Statistics
For WHM version 11.28
Often, when users compare bandwidth usage statistics provided by log analysis programs such as AWStats, Analog, and Webalizer to bandwidth statistics provided by cPanel and WHM, they are surprised to find apparent discrepancies.
These apparent discrepancies arise as a result of the way different programs measure bandwidth.
The purpose of this document is to explain the differences in measurement methods, and help web hosts and website owners understand how to obtain the most accurate bandwidth report.
Where to find bandwidth information in cPanel & WHM
There are several cPanel and WHM screens that display bandwidth usage information, including:
- WHM >> Account Information >> View Bandwidth Usage.
- WHM >> Account Functions >> Limit Bandwidth Usage.
- cPanel >> Stats >> Monthly Bandwidth Transfer.
- cPanel >> Logs >> Bandwidth >> monthly bandwidth usage pie charts.
- cPanel >> Logs >> Bandwidth >> select the domain >> Bandwidth By Day.
All of the information on these pages is generated by the same bandwidth monitoring tool. In contrast, AWStats, Analog, and Webalizer process bandwidth according to a different method.
(Data for bandwidth graphs are calculated using yet another method. For more information about the graphs, read our bandwidth graphs documentation
What causes the discrepancies?
Differences in measuring daily bandwidth statistics
The information presented by cPanel & WHM is likely to differ from the day's usage as shown by log processing programs such as AWStats, Analog, or Webalizer. There are 3 reasons for this:
- The server administrator can set log processing and bandwidth processing cycles independently. This means that the 2 statistics can be generated hours apart, in which case they may vary widely.
- Even if the server administrator attempts to synchronize log and bandwidth processing cycles, the system will always process the statistics at least 8 minutes apart.
- The statistics are processed such that usage data from 5 minutes before the time of processing, up to the time of processing, is always held until the next processing cycle.
In short, daily bandwidth usage numbers are far too volatile for the bandwidth and log processing results to match.
Overall differences in measuring bandwidth
There are further differences between the methods used by log programs and cPanel & WHM to process bandwidth usage.
How the log processing programs measure bandwidth
The bandwidth statistics reported by log processing programs include only
the content of the HTTP response. This measurement excludes both response headers that the HTTP server returns with content and the inbound bandwidth of requests received by the web server.
How cPanel & WHM measures bandwidth
The bandwidth reported by cPanel & WHM's bandwidth processing utility includes the total bandwidth used by the complete
response (including headers), and the incoming request.
How this affects results
For most websites, these differences will be relatively small. The headers are a few hundred bytes; the request itself is usually much less. Given reasonably sized output content, this overhead works out to a few percentage points' difference.
There are 2 cases in which these differences begin to make a significant impact on the bandwidth measurement:
- Large numbers of very small responses — If most of the content transferred is under 1 kilobyte, the response headers will obviously be a relatively large fraction of the reported bandwidth.
- Large requests — If a site receives large amounts of data in its HTTP requests, relative to the size of the responses, the 2 measures will diverge significantly. The log analysis programs are designed based on a model in which most of the transferred data travels out from a website. This model fits the vast majority of websites, but not all.
Which report should I use?
You will want to use the more complete bandwidth measurement reported by cPanel & WHM, for example on the cPanel Bandwidth
screen, or the WHM View Bandwidth Usage
screen. Log analysis programs, while not as accurate in reporting bandwidth, are worth using for information about hit statistics, referrals, and other information.
You should set bandwidth processing cycles as desired on the Server Configuration >> Statistics Software Configuration
screen of WHM, in the Bandwidth Processing Frequency
area of the Schedule Configuration
This will allow you to balance server performance with reporting latency, and, given those constraints, will provide as accurate bandwidth usage statistics as is possible.
For up-to-date usage information, you may process an individual user's statistics at any given moment. You can do this on the Server Configuration >> Statistics Software Configuration
screen of WHM, under the Process Statistics for User