Bandwidth management tutorial

While bandwidth can be defined differently depending on where the term is used, in web hosting bandwidth is the amount of data which has, will or can be transferred between the web server where your website is located and your website's visitors which "consume" it.

 

More cPanel tutorials:

How To Create, Edit, and Delete a File in CPanel Using File Manager

I have a full backup of account through cPanel. How do I restore it?

Backup mysql database tutorial

Beginner Guide to cPanel Control Panel

Best practices for managing MySQL databases

CPanel Account Information Tutorial

CPanel Login Tutorial

CPanel Security

Cannot See My Website Online After Upload, Why?

Custom error page is not working

Default Home Directory Folders

Disk usage in cPanel

Getting Familiar With the cPanel User Environment

How Do I Create and Delete a Parked Domain

How do I create and remove an Addon Domain?

 

The amount of bandwidth which your website generates highly depends on how well your website is being optimized ( home page size and average size of the rest pages as well ). We will give you two examples for that so you can get a better overall understanding on the matter.

Let's say that we have two websites which have 200 average visitors per day where every visitor have 2 page views on an average base and the only difference is the average size of the pages.

  • First website

~200 visitors per day

~2 pages views per visitor

~1MB average page size

Total Bandwidth Usage for the whole month: ~12Gb

  • Second website

~200 visitors per day

~2 page views per visitor

~3MB average page size

Total Bandwidth Usage for the whole month: ~36Gb

This simple comparison shows that a well optimized website with very same amount of visitors/page views to another will generate less resource usage than a heavy and poorly optimized website.

While we are talking about the bandwidth usage, the example above is related only to the web traffic and there are additional types of bandwidth which your account can generate, which are:

  • IMAP
  • POP3
  • SMTP
  • FTP

The first three types are related to the data transferred using the mail service protocols, where the IMAP and POP3 are related to the incoming and SMTP to the outgoing connections of your E-mail accounts. The FTP is related to the transferred files from/to your account using the FTP service.

While our Shared Hosting Plans have unmetered bandwidth - meaning we won't charge you according to the amount of bandwidth that you have generated, bandwidth is not an infinite resource and we constantly monitor our shared servers for excessive use to ensure optimal performance for our customers.

Bandwidth abuse can be easily prevented by utilizing some best practices such as fetching commonly accessed files like images, videos and documents from a CDN or external storage service, analyzing traffic on a regular basis and removing irregularities regarding what your visitors access and how it affects your bandwidth generation. More on the ways to check your bandwidth, analyze it and improve the way your hosting account uses this resource, can be found in the following tutorials which we gladly provide.

 

More cPanel tutorials:

How to Backup My Website in cPanel

How to Create a MySQL Database, a User and Delete Database in Cpanel

How to Create a SubDomain in Cpanel

How to Create a Website/Domain Redirect in cPanel

How to Reset or Change to a New CPanel Password

How to Set Up and Delete a Cron Job

How to Setup Google Apps MX, CNAME and SPF records

How to Use the Hosting Features in cPanel control Panel

How to access raw log files

How to check your PHP version and configure your PHP settings

How to force your website url with www or non-www using htaccess

How to optimize your website to use less server resources

How to upload files to a website

 

General Information

How much bandwidth is included in my plan?

There are no set limits on the data transfer (bandwidth) that we provide in our web hosting plans. These resources are "unmetered", meaning you are not billed according to the amount of bandwidth used and we never charge extra for high bandwidth use.

We provide you with unmetered data transfer for your hosting account so that you can host almost any personal, small business and community website and grow freely to attract more and more visitors. We want you to have the resources you need to build a significant online presence, and 99% of all customers have more than enough disk space and bandwidth to meet their needs.

However, like all resources bandwidth is not infinite, so we monitor our shared servers for excessive use and abuse to ensure optimal performance for everyone. That being said, we do require all customers to be fully compliant with our Terms of service and utilize bandwidth in the normal operation of a personal or small business website. While it is rare, we may need to put constraints on accounts that are using resources beyond what would be expected in the normal operation of such website.

How do you determine "normal" operation for web hosting plans?

We regularly run customers' bandwidth utilization through statistical analysis and use the results of these studies to define "normal". Although the actual results vary from month to month, one thing remains constant: 99% of our customers fall into "normal" range. Typically, customers who fall outside the normal range are using their accounts for file storage or sharing rather than web hosting. Our shared hosting services are not intended to support these activities and we offer various plans that better address high bandwidth utilization. We strive to provide at least 72 hours notice to allow customers to make adjustments before we take any corrective action.

 

More cPanel tutorials:

 

How to check your Bandwidth Usage

Viewing your bandwidth usage at any time and for previous events can greatly increase your awareness of the business environment as well as show you exactly where you need to focus your future marketing campaigns and improvement of quality. As bandwidth is a precious resource, make sure to regularly check yours in order to avoid over saturation of your hosting account's performance.

There are two main ways via which you can check on your bandwidth, both providing different statistics which will come in handy. The first way is to do it via the dedicated cPanel section. So you will have to log in your cPanel account and search for Bandwidth in the search field or simply go to the right column of statistics and scroll down till you get to the Bandwidth field.

Now you will be able to see a rough chart of your bandwidth usage of the http, imap, pop3, smtp and ftp services in MB/min for the last 24 hours. By reviewing the same you will be able to determine if there was a peak of the traffic at given hour as well as the overall usage of the services during this period of time. In our example the HTTP service was heavily used so all of the bandwidth will be colored blue.

As well as one for the last 7 days.

And even the last year. On this chart you can detect spikes based on monthly events as well as seasons. If you are running promotions for your products during the winter holidays for example you will most likely see a spike in the bandwidth usage for that period.

Below them, you will be able to see a more detailed overview of your different bandwidth generators (domains, subdomains other mail/ftp services) on a monthly basis.

In order to get the visual representation pie chart of the previous months all you have to do is click the gray circle.

Clicking on a already loaded pie chart will give you a day by day representation of your bandwidth usage including again the service which was used.

The other way to see your bandwidth usage is to visit the Resource Monitoring System via your client area's dashboard

Here you can see your bandwidth usage along with other resource usage.

If you scroll down you will see the bandwidth usage by last 30 days, this month, last 3,6 and 12 months. If you choose one of the first two options, you will see a more detailed representation by days of your most recent bandwidth usage.

As previously mentioned this is the basic information which you can obtain regarding your bandwidth usage. For a more detailed report on your bandwidth usage, please read our other tutorial on the matter.

 

How to check your Bandwidth Usage in details

The devil is in the details, and this is especially true for the bandwidth consumption of your hosting account. Maybe you have a certain image that is being viewed thousands of times? Or on a certain day your website spikes in views on a certain page? These are just some of the examples we can give about abnormal bandwidth activity and if you know how your website's visitors have behaved in the past you will be ready for any similar future situations that may occur.

Before you start analyzing the data for your website available in Awstats, you should consider familiarizing yourself with the most used terms:

  • Unique Visitor: A unique visitor is a visit from a unique IP (host). Even if you have multiple people using the same computer/router and are visiting one or multiple pages on your website, as long as the IP stays unchanged this will only count as 1 unique visitor.
  • Visits: The visits represent the different sessions your users have. If one unique visitor accesses 5 of your pages in a row, this will be counted as one visit but if he closes your website and then opens It again it will count as two visits.
  • Pages: The number of pages visited by your visitors
  • Hits: One hit represents 1 file being fetched from the web server. So if a visitor accesses a page with 2 JavaScript and 2 other files, the total hits from visiting that page will be 4.
  • Session Duration: The time a visitor spent on your website in the span of one visit. Do note that some visit duration may be marked as unknown when a visit happens in-between updates of Awstats information or if it occurs in the last hour of the month.

Sections' Quick Access:

  • Monthly, Weekly, Daily and Hourly History
  • Locales
  • Hosts
  • Robots/Spiders
  • Visits Duration
  • File Type
  • Downloads

To access the detailed information about your website's bandwidth you will once again have to start by log in your cPanel account. From there navigate to the Metrics ? Awstats or simply search for Awstats n the search bar located at the top of the page.

Here you will be provided with a list of all the domains and subdomains currently residing in your account. Do note that you will see both the HTTP and HTTPS versions of your websites if you have an SSL certificate installed for set domains. This is important because if you force the HTTPS connections to your website, all of the bandwidth will be generated in that "version" of the website shown here. Click on the View button when you have found the website which you want to check on.

The Awstats may look a bit old school, but then again, it provides all of the bandwidth information you might need, wrapped neatly and with an easy to access panel on the left side of the page.

The first thing you will see on top of the page is the reported period selector from which you can choose for what duration period to get your statistics. There will also be a summary of the number of visits, hits, and bandwidth used.

The monthly history is similar to the one shown in your cPanel. However, here you can much better understand your traffic as you can see exactly how many visitors did a certain amount of hits on your pages and the corresponding bandwidth. To update the statistics to the latest available, you will have to enable the Update Now button which is disabled by default. To do so, you will have to access the cPanel File Manager.

Now navigate to the following folder:

/home/username/tmp/awstats/

Here, if you have multiple domains and subdomains, you will see their configuration files. Right click ? Edit on the .conf file for the domain which you want to enable the Update button.

Now you will have to find the following line and change the value to 1:

AllowToUpdateStatsFromBrowser=0

Click on the Save Changes button before exiting to apply the change.

Now re-entering the Awstats for that domain or refreshing the same page will result in the Update Now button to show next to the Last Update date.

section

Monthly, Weekly, Daily and Hourly History

The same information can be seen for each of the days of the month

The next chart shows your traffic for each of the days of the week. This can be useful if you are running events or promotions on specific days or if your website is tailored to providing news for/from a certain day of the week.

To check in which hours the traffic on your website is most dense, you can check the Hours chart. If your website's target group is adults from your country for example, you will see an increase in traffic after 5 PM since most of the users from your target group will still be at work before that hour.

 

Locales

The next few charts are quite important as in them you can see potential shifts in bandwidth usage and even attempts to hotlink your content. In the country chart, you can see users from which countries favor your content.

 

Hosts

The hosts (top 25) chart will show you the IPs of the visitors and the number of hits and bandwidth they have generated.

For our example, using this chart and the previous one we can conclude that there is only 1 visitor from Mongolia that made all of those hits, which is strange and might lead to us removing access from that IP if this continues in the future.

 

Robots/Spiders

In the Robot/Spiders visitors, you will see a list of all of the search engines and possible bad robots which crawl your website. Note that these values are not listed elsewhere in your Awstats so they can be treated as a completely separate statistic just for the non-human bandwidth generation on your website.

 

Visits Duration

The visits duration can show you how engaged your viewers are with your content. If the average visit duration is short, it could either mean that the average visitor either doesn't find what he is looking for or that he finds it too quickly. However, it is not always bad to see lower duration as it largely depends on the type of website which you host. For example, if you have a website about poetry and you have uploaded a lot of page-long poems, your visitors' visit duration will likely be much higher than if you host a dictionary website where people check a word's meaning in 5 seconds and then close the connection.

*Also, do note that no logging method is perfect. Just as you can see anomalies in the Google Analytics tool where visit/session duration can be 0 even if the user has stayed longer, the same can apply for Awstats' visit duration.

 

File Type

Now on to the next chart. The file type chart will show you what content types on your website is generating bandwidth. If you have an image heavy website, most likely the image type will be the one generating the majority of the bandwidth. If you are overusing bandwidth, you can easily improve such websites by optimizing your images or completely moving them to a subdomain with enabled Cloudflare which will fetch all of the images on demand from the CDN instead of the web server.

 

Downloads

The Downloads chart will show the downloadable content on your website and how many times each of your resources have been downloaded. In our case, this chart is empty as we have no downloadable content available.

The Page URLs also provides important information. Here you can see if for example, your login form is being brute forced or if all the traffic you get goes through a specific page which you can exclude in order to lower your bandwidth usage. In the example given here, we were running a store, which made the account creation page the most visited one.

Now armed with all of the statistics you can think of, and ways to pinpoint irregular bandwidth usage, you can take measures in order to keep your website in optimal condition.

 

How to Enable Hotlink Protection

Hotlinking is a direct linking to another website's resource (mainly images) which uses the bandwidth of that website instead of the bandwidth of the website which links it. It is also known as bandwidth theft and is frown upon in the internet communities.

Hotlinking can be something as simple as using as an avatar or a signature, an image someone saw on another website, without actually downloading it and then uploading it to the forum/platform that they want to use. As the avatar and signature are viewable on all of that person's posts, even a small image has the potential to generate a lot of bandwidth depending on the number of people loading pages where those posts are present.

Hotlinking can also trigger unwanted aggression from the webmaster which bandwidth is being used as he can switch the image at any time. This can turn the favorite movie character of a person to pornography materials or another prohibited element that might get the offender into trouble after this "switcheroo". Furthermore, displaying images which are not owned by the one displaying them may be a violation of copyright, making him susceptible to legal actions.

In this tutorial, we will show you how to protect your content from Hotlinking so you don't have to worry about bandwidth being stolen from you.

Firstly, login to your cPanel account, go to Security ? Hotlink Protection module or search for Hotlink in the search bar.

Now click on the Enable button to start the protection service.

By default, all of your other addon domains and subdomains will be included in the list of URLs that have access to your content. If you need to provide access to any additional websites or remove access just edit this list. *Make sure you have a backup of this list if you have edited it but want to temporarily disable hotlink protection. This is due to the list being reverted back to default once you re-enable the Hotlink Protection.

To change the list of file types which you wish to block, edit the list by separating the different extensions with a comma.

You can also direct the requests for such files to another URL - let's say a warning page informing the user of what Hotlinking is and why its forbidden on your website.

Once you are done, click on the Submit button to apply all the changes.

You can also manually apply hotlink protection by editing your website's .htaccess file. As this is a more advanced way of setting up hotlink protection, we will not go into the details of how to find your .htaccess file. Just copy this code snippet at the top of your .htaccess:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

You are now protected from Hotlinking - the most common form of bandwidth theft.

 

Best Practices

Although we have already created tutorials on some of this topics, we have to include these methods here as they will greatly improve your hosting account's bandwidth generation. The most important thing you need to know is that bandwidth is mostly generated via the images, JavaScript, CSS and downloadable content on your website. In order to battle this, we will focus on these 4 times of files.

  • Optimizing images - this one is pretty easy to understand - you lower the size of your images without losing almost any of the quality and lower size means lower bandwidth. However, if you have a lot of images, you might still need a better solution which comes in the next point.

  • Activating Cloudflare CDN via cPanel for your entire domain or moving the images to a subdomain which has Cloudflare active will reduce your bandwidth substantially. With Cloudflare's edge nodes service most of the content of your website to your visitors, your hosting account will be offloaded and generate way less bandwidth than before. Since Cloudflare does not charge for bandwidth, you will be able to benefit from both the fast loading speed and cashing of the nodes as well as the no price tag. Alternatively, if your domain is managed elsewhere, you can activate Cloudflare via their website.

  • Minifying your JavaScript and CSS files or completely remove the need to fetch then from your web server by using Cloudflare's infrastructure for this task as well. In here you can search for all of the CSS and JavaScript resources you need. You can also enable the Rocket Loader feature, which improves the load time of pages that include JavaScript. However, note that in some rare occasions activating the Rocket Loader might cause unexpected issues with the proper loading of .js files and in such cases, we would suggest considering turning it off.

  • Offload your downloadable files to a 3rd party storage solution and only link them to download buttons on your website. Amazon S3 is a great service which can provide your users with direct download from your website without any additional redirects. The downloads can also be restricted in case you want to provide purchasable content on demand so only the customer who has paid can download the files.

  • Offload your videos to a video sharing platform and then embed them on your website. Video Sharing platforms like YouTube and Vimeo are perfect for offloading video bandwidth. Just create an account and start uploading. Afterward, you can easily embed your videos by using the embed codes provided by the platform.

  • Offload your images to an external media service provider. This will decrease drastically the bandwidth consumption of your website as the images will be loaded from the external provider and directly from your domain name. Both Imgur and Flickr are a great choice for this.

  • Combining images instead of serving them one by one. Optimizing your graphical elements is a must do on call to action websites with a lot of clickable buttons and icons.

Additional ways of lowering bandwidth usage - improve the performance of your website.

If you already have reduced the bandwidth consumption by activating a CDN service and offloading the media content to an external provider, but you are still not satisfied with the results you may want to try the following methods:

  • Lower home page size. Since this is the main page which your visitors see when they access your website, it is recommended the same to be clean as much as possible. For example, if you have a store website, you might want to avoid adding a lot of products at the home page and instead split them to separate categories on different pages. Once this is done, you might consider of reducing the size of your internal pages as this will additionally decrease the bandwidth consumption of your domain.

  • Limit search engine bots with a robots.txt file. If you have determined that most of the bandwidth consumption is coming from the aggressive online crawlers/bots, you might consider of blocking them from your website using the robots.txt file. Whenever a robot visits your website, it will first check the rules which you have set in the robots.txt file and it will proceed only if you are allowing them to actually access your website's pages. By default, this file is located inside the web root directory of your domain name, but if you are not able to find it you can simply create it by yourself.

If you would like to block all crawlers/bots from your website, you will have to add the following lines inside the .txt file in question:

User-agent: *
Disallow: /

The first line means that the rule will apply to all robots, where the second line means that it will disallow the access to all of the pages on your website.

Alternatively, if you would like to block a single robot, you should use the following rules instead:

User-agent: BadBot
Disallow: /

where you will have to replace the "BadBot" with the name of the robot which you would like to block from your website.

There are also rules which you can apply to your robots.txt file if you would like to allow only a single robot and block the rest. For example, if you wish to allow access only to Google crawler, then you will have to use the following lines:

User-agent: Google
Disallow:
User-Agent: *
Disallow: /

To summarize the provided information above, you should always look to keep the size of your pages as small as possible and disallowing the access of aggressive robots. This way, you will not only reduce the bandwidth consumption but also increase the overall performance of your website.

All of these solutions are easy to follow, don't require extensive work on them while yielding excellent results. Combining some or all of them depending on your website may reduce your bandwidth tremendously.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

I have a full backup of account through cPanel. How do I restore it?

It is recommended that you maintain healthy backup of your website and possibly download the...

How To Create, Edit, and Delete a File in cPanel Using File Manager

This tutorial will be useful for you to understand how to create a file, edit a file or delete...

How to Create and Manage a MySQL Database

Create MySQL Database and User via cPanel The MySQL Database Wizard is another useful tool...

How do I create and remove an Addon Domain?

An add-on domain is a separate domain name that you add to your web hosting subscription with...

How to Set Up and Delete a Cron Job

A cron job allows you to run a certain command at times set by the job. For example, you could...