Before we going to see the above topic we have to know about Hits in website.

What is a HIT?

A hit is nothing but it s a request for one file from a web server. The file may be ant type text, or image, or video etc..

If you request a single web page (visit) which contains only text means the web server will send the page as a file this process is called HIT.

In the internet world the hits were a reasonable way of tracking how many pages were viewed.

Each page was consider as one file.

Hits

web server:

In most cases web server are a single machine( hardware unit) that can handle large no of visitors in a day.

Here let as take a small website that contains large no of static pages(stationary page contains text ,images and videos).and every one seems to see or visit the same page a time.

If the machine is consider our normal computer (Intel core processor,with window 2008 or Linux operating system that loads Apache web server and connect the machine to the internet through a good connection) the web server can handle hundreds or thousands of daily visitors.

The Above website or web server can work properly at normal operating conditions .Unlike if the following are not occur,

  • Need to handle millions of visitors per day.
  • If the existing machine failed due to hardware problems, the site will be down till a new machine is configured and installed.
  • And the visiting page is too large or complicated.
  • Any back end process have to be performed at the time of visiting the page.

In most cases all large websites are meet all of these conditions and they need large infrastructures.

How to manage or handle the above problem(load balancing)?

There are three main strategies for handling this type of problems,

  1. The website have to invest in a single huge machine with lot of processing power, memory, disk space and redundancy.
  2. The website have to distribute the load across a number of machines.
  3. The website can use some combination of the first two options.

Say for example if we visit a site that has a different URL each time we visit, such as www1.xxxxx.com,www2.xxxxx.com, www3xxxxx.com etc. then you know that the website is using alternative second access to the Web. This means that the website has a number of separate machines, where each of them is running a web publishing software for pages on them.

The incoming requests for pages across all of the machines are spread in two ways:

  • The DNS site can distribute the load. A Domain name server is an Internet service that translates domain name to IP addresses. Each time a request is made to the web server, DNS will rotate through the available IP addresses in a circular to distribute and share the load. Each of the servers has a common access to the pages of the same website.
  • Some switches(Load balancing) can also distribute the load. All requests for the Web site are made to a machine and then passes the request to one of the available servers. The switch can find out from the servers which one is least loaded.

The main advantage of this method is that there is redundancy and if some of the machines break or fall, the other will continue to work to keep the web accessible.

That is the failure of any one machine does not cause a problem, the other machines pick up the load.

It is also easy to add capacity in an incremental way. The disadvantage is that these machines will still have to talk to some sort of centralized database if there is any transaction processing going on.