Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

使用 AWS 負載平衡服務讓您的應用程式規模化

1,229 views

Published on

AWS Elastic Load Balancing(彈性負載平衡)能自動分配處理多個 Amazon EC2 執行個體的連入應用流量,讓您的應用能獲得容錯能力,全方位提供路由傳送應用流量所需的負載平衡容量。Application Load Balancer(應用負載平衡器)是一款 Elastic Load Balancing(彈性負載平衡)服務可選用的負載平衡工具,並且可在應用層運作。本場專題演講將介紹 Application Load Balancer(應用負載平衡器)、探索 Application Load Balancer(應用負載平衡器)的功能及特色、說明最佳實務,以及協助您上手 Application Load Balancer (應用負載平衡器)

Published in: Technology

使用 AWS 負載平衡服務讓您的應用程式規模化

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Retro Kuo, Cloud Support Engineer, Premium Support 06/07/2017 使用 AWS 負載平衡服務讓您的應用程式規模化 AWS 快速入門
  2. 2. EC2 Instance
  3. 3. Load Balancer used to route incoming requests to multiple EC2 instances. ELB EC2 Instance EC2 Instance EC2 Instance
  4. 4. Elastic Load Balancing automatically distributes incoming application traffic across multiple applications, microservices and containers hosted on Amazon EC2 instances.
  5. 5. SecureElastic Integrated Cost Effective
  6. 6. Two Types of Load Balancers
  7. 7. Classic Application Protocol TCP, SSL, HTTP, HTTPS HTTP, HTTPS Platforms EC2-Classic, EC2-VPC EC2-VPC Health checks ✔ Improved CloudWatch metrics ✔ Improved Content-based routing ✔ WAF support ✔ WebSocket & HTTP/2 ✔
  8. 8. EC2 instances registered behind a Classic Load Balancer ELB EC2 Instance EC2 Instance EC2 Instance Content-Based Routing
  9. 9. Running two separate applications with Classic Load Balancer requires multiple load balancers ELB EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance ELB EC2 Instance orders.example.com images.example.com
  10. 10. ELB /orders example.com EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance /images Application Load Balancer allows for multiple applications to be hosted behind a single load balancer
  11. 11. Native Support HTTP/2, WebSocket, and IPv6
  12. 12. Web Application Firewall supports to Application Load Balancers
  13. 13. Content-based routing allows requests to be routed to different applications behind a single load balancer New, feature rich, layer 7 load balancing platform Web Application Firewall helps protect your web applications from common web exploits Application Load Balancer
  14. 14. My application needs IPv6 to meet the requirement. Which load balancer type should I use?
  15. 15. My application uses WebSocket. Which load balancer type should I use?
  16. 16. My website is under layer 7 attack. Which load balancer type should I use?
  17. 17. Load Balancer Listener Listener
  18. 18. Define the protocol and port on which the load balancer listens for incoming connections Each load balancer needs at least one listener to accept incoming traffic, and can support up to 10 listeners Routing rules are defined on listeners Listeners
  19. 19. Load Balancer Listener Listener Target Group #1 Health Check Health Check Health Check Target Group #2 Target Group #3
  20. 20. Logical grouping of targets behind a load balancer Target groups can be exist independently from the load balancer, and be associated with a load balancer when needed Regional construct that can be associated with Auto Scaling group Target Groups
  21. 21. HTTP and HTTPS health checks Customize the frequency, failure thresholds, and list of successful response codes Detailed reasons for health check failures are now returned via the API and displayed in the Management Console Health Checks
  22. 22. Load Balancer Target Group #1 Health Check Health Check Health Check EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS Listener Listener Target Group #2 Target Group #3
  23. 23. Logical load balancing target, which can be an EC2 instances, micro-service or container-based application EC2 instances can be registered with the same target group using multiple ports A single target can be registered with multiple target groups Targets
  24. 24. Load Balancer Target Group #1 Health Check Health Check Health Check EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS Listener Listener Target Group #2 Target Group #3 Rule (default) Rule (*/app/*) Rule (default)
  25. 25. Provide the link between listeners and target groups and consist of conditions and actions When a request meets the condition of the rule, the associated action is taken Today, rules can forward requests to a specified target group Rules
  26. 26. Conditions can be specified in path pattern and host format A condition is case sensitive, can be up to 128 characters in length, and can contain any of the following characters: • A-Z, a-z, 0-9 • _ - . $ / ~ " ' @ : + • & (using &) • * (matches 0 or more characters) • ? (matches exactly 1 character) Rules (continued)
  27. 27. Demo
  28. 28. Load Balancer Target Group #1 Health Check Health Check EC2 EC2 Listener Rule (default) Rule (/app/*) Target Group #2
  29. 29. What if one back-end instance per target group does not have enough capacity?
  30. 30. Auto Scaling supports the scaling of applications at the target group level
  31. 31. Application Load Balancer integrates with Auto Scaling to manage the scaling of each target group independently ELB default example.com EC2 Instance EC2 Instance EC2 Instance EC2 Instance /app/ EC2 Instance
  32. 32. Demo
  33. 33. Load Balancer Target Group #1 Health Check Health Check EC2 EC2 Listener Rule (default) Rule (/app/*) Target Group #2 Auto Scaling Auto Scaling EC2
  34. 34. Provides several new resource types, including target groups, targets and rules Integrate with Auto Scaling group at target group level A condition is case sensitive, can be up to 128 characters in length Application Load Balancer
  35. 35. Always use multiple Availability Zones Configure the Health Check target to a static page Use Auto Scaling group with Application Load Balancers Best Practices
  36. 36. For TCP/SSL or EC2-Classic, use Classic Load Balancer; all other use-cases, use Application Load Balancer
  37. 37. Thank you!

×