สวัสดีครับเพื่อน ๆ ชาว IT กลับมาพบกันอีกครั้งกับ Cloud HM Blog ข่าวสาร และบทความ IT น่าอ่านพร้อมบริการทุก ๆ ท่านน่ะครับ
วันนี้ทาง Cloud HM ขอนำเสนอฟีเจอร์หนึ่งที่น่าสนใจของ Azure คือฟีเจอร์ Load Balancer และสำหรับบทความนี้เราจะมาทำความรู้จักตั้งแต่พื้นฐานจนถึงเข้าใจการทำงานของ Azure Load Balancer กันเลย
Load Balancer คืออะไร
Load Balancer บริการที่ช่วยรองรับคำร้องจำนวนมากที่เข้ามายังระบบและจัดการได้อย่างเหมาะสมด้วยเทคนิคการกระจายคำร้องไปยังหลาย ๆ Server หรือ ระบบอื่น ๆ ได้


Component หลักของ Load balancer

- Load balancer Frontend IP เป็นไอพีในส่วน Component ที่เชื่อมต่อกับด้านหน้าและส่งข้อมูลไปยังระบบหลังบ้าน

- Backend Pool เป็น Component ที่รวมระบบหลังบ้านในรูปแบบ Pool เพื่อให้บริการเมื่อมีคำขอขาเข้าจากระบบ Load balancer และส่งต่อคำสั่งไปยังระบบหลังบ้านที่มี Pool โดยใน Pool จะมี Server คอยทำงานอยู่
- Health Probe เป็น Component ที่คอยตรวจสอบว่าระบบที่อยู่หลังบ้าน เครื่องใดที่พร้อมและไม่พร้อมใช้งาน
- Load balancing Rule เป็น Component ที่กำหนดเงื่อนไขต่าง ๆ ที่ส่งมาจากระบบหน้าบ้าน เพื่อตรวจสอบเงื่อนไขและส่งไปยังระบบหลังบ้าน

Load balancer ในรูปแบบ ภายในและภายนอก

Internal Load balance คือ Load balance ที่รับและส่งข้อมูลภายใน
Public Load balance คือ Load balance จากภายนอก (Internet) ไปยังระบบภายใน
การเข้าถึงโหลด Load balance ไปยังภูมิภาค หรือ Virtual Network

กำหนดกฏเมื่อมีการเข้ามาด้วย Network Address Translation (NAT)
โหลดบาลานซ์สามารถตั้งกฏให้ใช้ combination ด้วย Network Address Translation (NAT) ตามรูปภาพ

กำหนดกฏเมื่อมีการออกมาด้วย Source Network Address Translation (SNAT)
โหลดบาลานซ์สามารถกำหนดให้มีการออกด้วย Source Network Address Translation (SNAT)

3 แนวทางการตัดสินใจสำหรับ โหลดบาลานซ์ ใน Azure
- Traffic type ประเภทของข้อมูล
- Global versus. regional. ในการใช้งานต้องอยู่ที่ใด? , มีการขยายไปยังภูมิภาคอื่นหรือไม่?
- Availability ต้องการความพร้อมในงานหรือไม่
https://azure.microsoft.com/en-us/support/legal/sla/load-balancer/v1_0/
- ค่าใช้จ่าย
- ฟีเจอร์และข้อจำกัด
ตัวอย่างการทำงานของ Load balance

ตารางสรุปบริการ Load balance ในบริการอื่น ๆ ของ Azure

เปรียบเทียบตัวเลือก SKU ใน Azure Load balancer มี 2 ประเภท
1. SKU Basic:
- Backend pool จำกัดให้มี instances สูงสุดได้เพียง 300 instances
- Backend pool สามารถมี availability set ได้เพียงอันเดียวเท่านั้น
- Backend pool VMs ไม่สามารถขยายไปยัง Availability Zones
- ไม่มี SLA
- ไม่มีค่าใช้จ่าย
- Frontend ไม่สามารถทำ zone-redundant

2. SKU Standard:
- Backend pool สามารถขยายได้ถึง 1,000 instances
- Backend pool VMs สามารถขยายไปยังทุกเครื่องใน virtual network, scale sets, availability sets
- Backend pool VMs สามารถขยายไปยัง Availability Zones
- มีรับประกัน SLA 99.99%
- มีค่าใช้จ่าย
- สามารถทำ Zone-redundant and Zonal frontends for inbound and outbound traffic

ข้อมูลอ้างอิง
https://gist.github.com/adi-garg/37f1083010b75c3172d3526b57c0d0b5#file-standard-vs-basic-lb-csv
https://azure.microsoft.com/en-us/support/legal/sla/load-balancer/v1_0/
https://docs.microsoft.com/en-us/azure/architecture/guide/technology-choices/load-balancing-overview
https://azure.microsoft.com/en-us/products/azure-load-balancing/
— Cloud HM