Bandwidth Usage Statistics & Apparent Discrepancies

Bandwidth Usage Statistics & Apparent Discrepancies

Overview


Often, when users compare bandwidth usage statistics that log analysis programs provide (for example, AWStats, Analog, Logaholic, and Webalizer) to bandwidth statistics that cPanel provide, they are surprised to find apparent discrepancies.




These apparent discrepancies result from the way in which different programs measure bandwidth.




The purpose of this document is to explain the differences in measurement methods. Our goal is to help web hosting providers and website owners understand how to obtain the most accurate bandwidth report.




Where to find bandwidth data in cPanel & WHM


Bandwidth data in cPanel & WHM comes from a combination of summary files and databases.




Summary file data


The following cPanel interfaces display (mainly numeric) bandwidth usage information in summary files:



  • The Bandwidth statistic in the Statistics section of cPanel's  Home  interface.


  • cPanel's Bandwidth  interface (cPanel >> Home >> Metrics >> Bandwidth).


    Note:


    The Bandwidth interface includes this information in the monthly bandwidth usage pie charts, and in the Bandwidth by Day table when you select a domain. 






The same bandwidth monitoring tool generates all of the information in these interfaces.




In contrast, AWStats, Analog, and Webalizer use a different method to process bandwidth. This is why it sometimes appears that there is no correlation between the data that the bandwidth usage information interfaces show and the data that AWStats, Analog, and Webalizer show.




Database data


Databases generate the following bandwidth graphs in cPanel's Bandwidth interface (cPanel >> Home >> Metrics >> Bandwidth):



  • Past 24 hours

  • Past week

  • Past year


The system uses a different method to calculate these graphs than it does to calculate summary file data.




What causes the discrepancies?


Differences in measuring daily bandwidth statistics


The information that cPanel & WHM presents may differ from the day's usage in log processing programs, such as AWStats, Analog, or Webalizer. There are three possible reasons for this:



  1. The server administrator can set log processing and bandwidth processing cycles independently. This means that the system may generate the two statistics several hours apart, in which case, they may vary widely.

  2. Even if the server administrator attempts to synchronize log and bandwidth processing cycles, the system always processes the statistics at least eight minutes apart.

  3. The system holds the usage data for the five minutes prior to processing time until the next processing cycle. Therefore, those statistics appear in a later report.


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 that log programs and cPanel & WHM use to process bandwidth usage.




How log processing programs measure bandwidth

Log processing programs extract the amount of bytes that the Apache combined access log transfers. The Apache combined access log records incoming data requests, which includes the size of the requested file, in bytes.



  • This size only includes the full size of the content of the requested file. It does not reflect the actual number of bytes that the system transferred.

  • This size measures the content of the file only. It does not include the size of the headers of the response.

  • This size does not include the size of the request.


Log processing programs measure bandwidth by the size of the data that visitors requested, not the amount the data that the system actually transferred.




How cPanel & WHM measures bandwidth

To measure bandwidth, cPanel & WHM combines the amount of bytes of an incoming data request with the outgoing transferred data (the response to that request). cPanel & WHM obtains this data from the Apache logs.


These logs include the following amounts of bandwidth:



  • The total bandwidth that the incoming request that solicited the content used.

  • The total bandwidth that the complete response used (the sum of the size of the content plus the header).




How this affects the results

For most websites, these differences are 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.


Certain types of request and response combinations, however, cause these differences to make a significant impact on the bandwidth measurement:




  1. Large numbers of non-success responses — Because redirects and errors have virtually no content, and mainly contain headers, the bandwidth usage that the log processing programs report is much smaller than the bandwidth usage that cPanel & WHM reports.


  2. Large numbers of very small responses — For transferred content that is smaller than 1 KB, the log processing programs report less bandwidth usage than cPanel & WHM reports. This is because the combined size of the response headers and the request is often larger than 1 KB.


  3. Large requests that the user cancelled — To measure bandwidth, log processing programs show the size of the requested data, not the amount the data that the system actually transferred. This means that these programs do not make a distinction between completed and cancelled requests. Therefore, a high number of requests that users cancelled may cause cPanel & WHM to report a substantially smaller amount of bandwidth usage than log processing programs report. 

    • This situation often occurs with sites that serve a large number of video or audio streaming requests.

    • For example, 100 people request a 1 GB video, but cancel the request after only 10% of the video has downloaded. cPanel & WHM would report that the system transferred less than 10 GB of data. However, because of how they obtain their information, the log processing programs would report that the system transferred 100 GB.






Which report should I use?


We strongly recommend that you use the complete bandwidth measurement that cPanel provides. For example, use cPanel's Bandwidth interface (cPanel >> Home >> Metrics >> Bandwidth).


  • Log analysis programs, while not as accurate, are useful for information about page view statistics, referrals, and other information.




    • Related Articles

    • Know your control panel

      Overview The cPanel interface provides all of the functions available for you to manage your cPanel user account, and it displays important information and updates. The cPanel interface consists of the following sections: Navigation bar  Sidebar  ...
    • Is it mandatory to digitally authenticate all consents acquired from subscriber? What are the available modes for digital authentication?

      Yes, it is mandatory for Principal Entity(s) to get subscriber's consent digitally authenticated via OTP. However, at inception, the Principal Entities can migrate existing consents for existing entities, processes and data. Migrated consent recorded ...
    • I need a software...

      If you are looking to develop a software application unique to your needs, you are in the right place. Here are a few questions to help you plan better. What is the primary goal of your software? Eg: to maintain records, reduce time, increase ...
    • Check email disk quota

      The quota for an address defines the amount of mail, in Megabytes, that the account can store. When your mailbox exceeds this limit, the system returns any incoming mail to the sender with a message that states that the recipient’s mailbox is full.  ...
    • How to Remove Suspicious Code From WordPress Sites

      What is suspicious code? Suspicious code is code that matches general malware practices, but may not fit into a specific category of malicious intent. Suspicious code may have nothing inherently malicious within it, however, it matches patterns of ...