Learn about AWS CloudWatch, AWS Auto Scaling

Tram Ho

1. AWS CloudWatch

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time. You can use CloudWatch to collect and track metrics, which are variables you can measure for your resources and applications.

The CloudWatch homepage automatically displays statistics for all AWS services you use. You can also create custom dashboards to display metrics for your custom applications and display custom metric collections of your choice.

You can create data tracking alarms and send notifications or automatically make changes to the resource you are monitoring when the threshold is violated.

With CloudWatch, you gain system-wide visibility of resource usage, application performance and activity status.

Cloudwatch can monitor Amazon EC2 instances, Amazon DynamoDB tables, and Amazon RDS DB instances.

1.1. CloundWatch metrics.

Here I use to track ec2 server. After enabling and opening the monitoring tab, you will see the server’s resource usage status.

The aws home page displays several charts that indicate the status of ec2 resources. – CPU usage (%)

– Memory usage (%)

– Using external network (MB)

– Memory used (MB)

– Available memory (MB)

– Swap usage (%)

– Swap usage (MB)

– Use of disk space (%)

– Disk space used (GB)

– Free disk space (GB) …

In addition, we can create an alarm to alert when CPU Ram exceeds the level that we set the alarm.

2. Auto Scaling

With traditional technology infrastructure, there will be a certain number of physical servers to handle the work. As the number of visits increases, there will be delays, processing problems or even insufficient resources to handle. And cause hang instance. Unable to access.

Amazon provides AWS Auto Scaling (extension) service for Amazon EC2 to fix this error. AWS Auto Scaling automatically replicates to ensure that Amazon EC2 versions are sufficient to run your applications. You can create an AWS Auto Scaling group in EC2 versions. You can specify the minimum number of EC2 versions in that group and automatically expand will maintain and ensure the minimum number of EC2 versions.

Using AWS Auto Scaling, you can automatically increase or decrease the number of EC2 versions running in the group to meet changing customer traffic demand conditions. Model auto scaling

3. How does Auto Scaling work?

– Define an AMI version and create Auto-Extended Group to launch versions.

– You use CloudWatch to monitor your server instances and when certain configurable events occur, you can launch many other versions based on the AMI pattern you define.

– EC2 versions launch behind the Elastic Load Balancer (ELB) you define.

– ELB will send traffic in a circular pattern between all the versions assigned to it and you can control in real time how many versions you want to launch to cover traffic episodes large and keep at least one or two versions running during less temporary traffic. If any of your EC2 versions does not respond, ELB will detect it and launch instead. When web traffic stops working, you can also automatically terminate the EC2.

– CloudWatch allows you to configure alarms that trigger automatic extension policies to launch additional EC2 versions to automatically expand groups when network traffic, server load or statistical measurement tools Other measurements are too high, over 80%. The number of servers you add is based on the expansion policy you have set. Each server is a duplicate version of AMI that you define in the AWS Auto Scaling configuration.

– Your ELB will automatically disperse incoming visitors between all servers in your Auto Extension Group. You can set the minimum and maximum number of versions in your group, giving you peace of mind that your site will not crash due to the number of visitors and also to limit the impact on your billing statement. friend.

– You can also ask AWS to reduce the number of versions when network traffic has dropped, assuming it is below 20% usage for a measurable period to reduce the number. server in your web server cluster.

Share the news now

Source : Viblo