Load Balancer Flashcards
What are 2 things that load balancer does?
- It helps to spread the traffic across a cluster of servers to improve responsiveness and availability of applications, websites or databases.
- keeps track of the status of all the resources while distributing requests. If a server is not available to take new requests or is not responding or has elevated error rate, LB will stop sending traffic to such a server.
Where can a load balancer be placed?
• To utilize full scalability and redundancy, we can try to balance the load at each layer of the system.
• We can add LBs at three places:
o Between the user and the web server
o Between web servers and an internal platform layer, like application servers or cache servers
o Between internal platform layer and database
What is the value of a load balancer?
• By balancing application requests across multiple servers, a load balancer reduces individual server load and prevents any one application server from becoming a single point of failure, thus improving overall application availability and responsiveness
What is the difference between a web server and application server?
o Web server:
Web Server is designed to serve HTTP Content.
Web Server is mostly designed to serve static content, though most Web Servers have plugins to support scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP content.
o Application Server
App Server can also serve HTTP Content but is not limited to just HTTP and could support other protocols.
App server is mostly suited for dynamic content.
Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of.
o Interaction between the two:
The application server is working in conjunction with the web server, where one displays and the other one interacts.
What are the benefits of a load balancer?
o Faster, uninterrupted service.
Users won’t have to wait for a single struggling server to finish its previous tasks.
Instead, their requests are immediately passed on to a more readily available resource.
o Service providers experience less downtime and higher throughput.
Even a full server failure won’t affect the end user experience as the load balancer will simply route around it to a healthy server.
o System administrators to easily handle incoming requests while decreasing wait time for users.
o Predictive analytics.
PA could determine traffic bottlenecks before they happen.
As a result, the smart load balancer gives an organization actionable insight. These are key to automation and can help drive business decisions.
o System administrators experience fewer failed or stressed components. Instead of a single device performing a lot of work, load balancing has several devices perform a little bit of work.
What are the 2 things load balancer considers in general?
o Load balancers consider two factors before forwarding a request to a backend server:
Server they can choose is responding appropriately to requests
pre-configured algorithm to select one from the set of healthy servers.
What are load balancers health checks?
o Health Checks
Load balancers should only forward traffic to “healthy” backend servers.
To monitor the health of a backend server, “health checks” regularly attempt to connect to backend servers to ensure that servers are listening.
If a server fails a health check, it is automatically removed from the pool, and traffic will not be forwarded to it until it responds to the health checks again.
What are 6 load balancing algorithms?
- Least connections method
- Least response time method
- least bandwidth method
- Round Robin
- Weighted round robin
- IP Hash
What is Least connections method?
Least Connections Method
• This method directs traffic to the server with the fewest active connections.
• This approach is most useful when there are many persistent connections in the traffic unevenly distributed between the servers.
What is Least response time method?
• This algorithm directs traffic to the server with:
o The fewest active connections
o The lowest average response time.
What is least bandwidth method?
• This method selects the server that is currently serving the least amount of traffic, measured in megabits per second (Mbps).
What is round robin method? When is it usefull?
• This method cycles through a list of servers and sends each new request to the next server. When it reaches the end of the list, it starts over at the beginning.
• It is most useful when:
o servers are of equal specification
o there are not many persistent connections.
What is weighted round robin method?
- The weighted round robin scheduling is designed to better handle servers with different processing capacities.
- Each server is assigned a weight, an integer value that indicates the processing capacity. Servers with higher weights receive new connections first than those with less weights, and servers with higher weights get more connections than those with less weights.
What is IP hash?
• This method calculates a hash of the IP address of the client to determine which server receives the request.
What is redundant load balancing?
o Load balancer can be a single point of failure, to overcome this a second load balancer can be connected to the first to form a cluster.
o Each LB monitors the health of the other and since both are equally capable of serving traffic and failure detection, in the event the main load balancer fails, the second load balancer takes over.