It was an unforgettable memory that I have deployed my first website on Amazon EC2 instance. Why do I say that? Once several events come to my website, my EC2 instance can’t handle this overwhelming traffic, let alone operate normally. Above all, I try to figure out what’s going on with my EC2 instance and how could I detect the potential issues before I create a new one; moreover, Could I deal with these problems without manually setting them?
The photo is referenced by 945enet
I have run out of ideas in dealing with this situation. Even I refactored my code a lot of times. Not until auto-scaling methods were recommended by my teammates were I solve this issue.
Later, I googled keywords Auto Scaling on AWS on my Firefox browser, a bunch of information crashed into my mind, but something interesting happened! AWS has piled up their document tidy, it doesn’t cost me a lot of time to find key solutions!
How AWS monitoring your Auto Scaling instances and groups
Before we started, there have various ways to monitor your instance and take automatic actions when appropriate.
We are going to introduce two methods in this blog.
Health Check v.s Status Check
Amazon EC2 Auto Scaling runs health checks on the instances in your Auto Scaling group on a regular basis. If an instance fails its health check, it is flagged as unhealthy and terminated, with Amazon EC2 Auto Scaling launching a new instance in its place.
Instance health status
Status checks provided by Amazon EC2 to identify hardware and software issues that may impair an instance. The default health checks for an Auto Scaling group are EC2 status checks only.
Health checks provided by Elastic Load Balancing.
Your custom health checks.
Health Check Settings
You configure health checks for the targets in a target group using the following settings. The load balancer sends a health check request to each registered target every HealthCheckIntervalSeconds seconds, using the specified port, protocol, and ping path.
HealthCheckProtocol: The protocol the load balancer uses when performing health checks on targets. The possible protocols are HTTP and HTTPS. The default is the HTTP protocol.
HealthCheckPath: The ping path that is the destination on the targets for health checks. Specify a valid URI (/path?query). The default is /.
You can set up HealthCheckPort on the Advanced health check settings:
- HealthCheckPort: The port the load balancer uses when performing health checks on targets. The default is to use the port on which each target receives traffic from the load balancer. …
With instance status monitoring, you can quickly determine whether Amazon EC2 has detected any problems that might prevent your instances from running applications. Amazon EC2 performs automated checks on every running EC2 instance to identify hardware and software issues.
Types of Status Checks
There are two types of status checks:
System Status Checks
Keep an eye on the AWS systems where your instance is running. These checks identify underlying issues with your instance that necessitate AWS intervention to resolve. When a system status check fails, you have the option of waiting for AWS to address the problem or fixing it yourself. You can manually stop and start instances backed by Amazon EBS, which in most circumstances migrates the instance to a new host. You can terminate and replace instances that are backed by an instance store.
Problems that can cause system status checks to fail to include the following:
- Loss of network connectivity
- Loss of system power
- Software issues on the physical host
- Hardware issues on the physical host that impact network reachability
Instance Status Checks
Keep an eye on your instance’s software and network configuration. By making an address resolution protocol (ARP) request to the ENI, Amazon EC2 validates the instance’s health. These tests identify issues that require your assistance to resolve. When an instance status check fails, you must usually resolve the issue yourself (for example, by rebooting the instance or by making instance configuration changes).
The following are some instances of issues that can result in failed instance status checks:
- Failed system status checks
- Incorrect networking or startup configuration
- Exhausted memory
- Corrupted file system
- Incompatible kernel
Well goes an old saying:” All roads lead to Rome.” No matter what kinds of “Check” you implement, pick up the suitable methods to meet your situation. This blog unveils the details between Health Check and Status Check, after reading this blog, you could set up the advanced settings of health checks or know the different types of status checks!
If you want to explore other cool blogs of technologies, please stay tuned on eCloudture Blog!!!