Okay.
Hello bloggers and welcome to this lecture.
This lecture is on Elastic Load balancers.
So what is a load balance.
Well surprisingly a load balancer is exactly what it sounds like.
It is a physical or virtual device that's designed to help you balance the load balance the network
load across multiple web servers.
So here we are we've got a load balancer his web server one web server two web server three etc. and
it can balance the load across the three of them.
You can also use it for applications it doesn't have to necessarily be Internet facing load balances
but typically they are Internet facing and primarily they're used to balance load across web servers.
So with NWS there's three different types of load balances we've got our application load balance we've
got our network load balancer and we've got what's called our classic load balancer which is the old
school version.
So let's start with application load balances.
They're basically best suited for load balancing of each TTP and each TTP has traffic.
They operate at least seven and our application aware.
So basically if you think about your browser and maybe your you change your language too I don't know
French for example inside on a website you'll load balancer can actually see what you've done and then
it could go ahead and load balance across all the French Web servers or if you change your language
over to English or maybe to US dollars it can see that you've done that and essentially load balance
across the US servers.
So that's all we mean by application or where it can see inside the application can see all the requests
that you're making.
I can see that even the individual each terminal suit can make intelligent decisions.
So application load balances are intelligent you can create advance requests rooting sending specified
requests to specific web servers so you think of an application load balancer like a Tesla Model X they
look really really cool they're super intelligent and they can essentially do very advanced rooting
so you'd like the Tesla does auto pilot now network low balances are best suited for load balancing
of TGP traffic where extreme performance is required and this is a Tesla Roadster This is my dream car
this is the fastest car ever built by human beings both in terms of top speed as well as acceleration
so associate network load balancers with extreme performance like the Tesla Roadster Now it operates
at the connection level so this is at Layer 4 and network load balances are capable of handling millions
of requests per second while maintaining ultra low latency is he going to use this for extreme performance
and then we have our classic load balancer and this isn't a Tesla by any means.
So these are the legacy Elastic Load balances you can load balance hasty the P and CPS applications
and use Layer 7 specific features such as x forwarded 4 and sticky sessions you can still use export
to foreign sticky sessions but it's not application aware it doesn't do it at the Layer 7 level and
we'll come to what X forwarded for what that is in a second so you can also use strictly for load balancing
for applications that rely purely on the TPP protocol and classic load balances are basically they're
not all that intelligent you really want to be using application load balancers where you would use
classic is if you don't really care about how traffic is routed and if you're just doing basic round
robin then you might want to use classic because it's going to be a bit cheaper.
So in terms of errors that you might see when using classic load balances if your application stops
responding the ECB B is going to respond with a 5 0 4 0 5 0 4 error just means Gateway timeout and this
means that your application is having an issue.
This could either be at your web server layer or the database layer it's not the load balancer that's
having the issue it's it's the easy two instances just aren't responding see what you need to do is
identify where the application is failing and scale it up or out where possible.
Moving onto export add for headers so this is our user they're browsing to our website from 1 to 4 dot
12 dot three dot two three one that's their public IP address and they're heading our elastic load balancer
now elastic load balancer has an internal IP address of 10 dot dot dot 23 and this is being passed to
your easy to instance and the easy to instance is logging the internal load balancers IP address as
our users IP address and this can be annoying because you might want to know your user's IP address
you might want to be you know know where they're coming from maybe you've got a whole bunch of users
in France and you want to identify that so you can still get their public IP address and what you need
to do that is the X forwarded force you just need to look for the X forwarded for header and that will
have their public IP address so just bear that in mind for your exam.
So onto my exam tips we've got three different types of load balances we've got our application load
balances which are.
We've got our network load balancers which are going to use for extreme performance.
And then we've got our classic low balances and this might be where you want just basic load balancing
at the most cost effective rate.
Just remember that a fiver for error means that the Gateway has timed out.
And this means that the application itself has stopped responding within the idle time out period.
And you just need to go and troubleshoot the application figure out if it's the web server layer or
the database layer and then you have to go in and fix it and see scale it up or scale it out and then
also just remember what the Apex forward for is used for it basically it's useful if you need the IP
for address of your end user.
You need to look for the export ID for header.
So that is it for the theory lecture in the next lecture we're going to go ahead and get our hands dirty
and start using a classic load balance of first and then we're going to go ahead and use an application
load balancer.
Do feel free to go ahead and delete your VPC and all the two instances that we did in the last section
of course you won't need them anymore.
So that is it but this lecture goes if you have any questions please let me know if not feel free to
move onto the next lecture.
Thank you.