Elastic Load-Balancing Using Octavia deep dive
Dean H. Lorenz, IBM Research – Haifa Allan Hu, Cloud Networking Services, IBM NSJ
OpenStack Austin 2016
Using Octavia deep dive Dean H. Lorenz, IBM Research Haifa Allan - - PowerPoint PPT Presentation
Elastic Load-Balancing Using Octavia deep dive Dean H. Lorenz, IBM Research Haifa Allan Hu, Cloud Networking Services, IBM NSJ OpenStack Austin 2016 Load Balancing 101 Users access a service Service hosted on cloud Pool of
Dean H. Lorenz, IBM Research – Haifa Allan Hu, Cloud Networking Services, IBM NSJ
OpenStack Austin 2016
pool
‒ Service hosted on cloud
‒ High availability:
‒ Performance:
‒ Clients do not know which back-end serves them ‒ Need to split incoming VIP traffic
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
back-end server Service back-end server back-end server back-end server Service IP (VIP)
‒ Distribute new VIP connections to members ‒ High availability: avoid failed servers ‒ Performance: avoid overloaded servers
‒ Health Monitor + Stats Collector
‒ Balance something
‒ Affinity: similar packets go to same back-end
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
pool back-end server Service back-end server back-end server back-end server Load Balancer
(on VIP)
Amphora
LB VM
Amphora
LB VM
Amphora
LB VM
Amphora
LB VM
Operator-grade Load Balancer
‒ LB (VIP) Listeners (protocol) Pool Members, Health monitor
CRUD: {create,delete,list,show,update}
‒ VM per LB (aka Amphora) running HAProxy
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Octavia
Operator API Neutron LBaaS Octavia Driver
Usr API Handler back-end back-end back-end back-end
Amphora
LB VM back-end back-end back-end
Amphora
LB VM back-end back-end
Amphora
LB VM back-end back-end back-end back-end
Amphora
LB VM
DB
Amphora
LB VM
Amphora
LB VM
Amphora
LB VM
Amphora
LB VM
‒ LB (VIP) Listeners (protocol) Pool Members, Health monitor
CRUD: {create,delete,list,show,update}
‒ VM per LB (aka Amphora) running HAProxy
‒ Many pieces under the hood…
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Controller Certificate Driver Compute Driver Amphora Driver Networking Driver Housekeeping Mgr Health Manager Octavia API Barbican Nova Neutron
LBaaS Octavia Driver Octavia Worker
Usr API Handler back-end back-end back-end back-end
Amphora
LB VM back-end back-end back-end
Amphora
LB VM back-end back-end
Amphora
LB VM back-end back-end back-end back-end
Amphora
LB VM
HAProxy LB
‒ L7 Content Switching ‒ Monitor back-end health ‒ Cookie insertion (session stickiness) ‒ SSL termination ‒ Authentication ‒ Compression ‒ …
‒ E.g., cache, FW, rewrite, …
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
back-end server Service back-end server back-end server back-end server
in Octavia (Mitaka) Not supported in Octavia (yet)
Amphora
Load Balancer
(on VIP) back-end server Service back-end server back-end server back-end server back-end server Service back-end server back-end server back-end server back-end server Service back-end server back-end server back-end server
‒ High availability
‒ Performance:
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
back-end server Service back-end server back-end server back-end server
Load Balancer
(on VIP) back-end server Service back-end server back-end server back-end server back-end server Service back-end server back-end server back-end server back-end server Service back-end server back-end server back-end server
‒ High availability
‒ Performance:
‒ Pool of Amphorae ‒ Need to split incoming VIP traffic over Amphorae pool ‒ Déjà vu…
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
back-end server Service back-end server back-end server back-end server
pool
Amphora Amphora Amphora Amphora
LBaaS Challenge:
‒ Cheap for small workloads (free tier) ‒ Acceptable performance for large workloads
‒ Use as little resources as possible for small workloads ‒ Have the resources to handle huge workloads
‒ One active VM
‒ (optionally) One idle standby VM
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Introducing:
‒ Can handle large load
1) Distributor to Amphorae 2) Amphora to Back-end servers
‒ Ready to replace a failed Amphora
‒ Failed Amphora recreated as standby ‒ Can generalize to more than one standby
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
back-end server Service back-end server back-end server back-end server
Standby Amphora Amphora Amphora Amphora
Distributor
N +1 Amphorae Pool Disclaimer: Active-Active topology is still a draft blue-print ( + demo code ) Service IP (VIP)
‒ Should have similar high availability attributes ‒ Needs to handle entire VIP load ‒ HW is a good match
‒ More like ECMP ‒ L3 only, but must have per-flow affinity
‒ SSL termination is only at Amphora
‒ If you have enough (public) IPs
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Amphora Amphora Amphora Amphora
Distributor
Service IP (VIP)
‒ Co-located on same LAN as Amphorae ‒ L2 forwarding
‒ Direct Server Return
‒ Amphorae do not advertise VIP
‒ Select Amphora by hash of SrcIP:Port
‒ Can be any OpenFlow switch ‒ Multi-tenant ‒ No HA for now
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Router
Front-end
VIP public Front-end Router
Distributor
Instance
Amphora
Instance
Amphora
Instance
Amphora
VIP VIP private VIP
‒ Co-located on same LAN as Amphorae ‒ L2 forwarding
‒ Direct Server Return
‒ Amphorae do not advertise VIP
‒ Select Amphora by hash of SrcIP:Port
‒ Can be any OpenFlow switch ‒ Multi-tenant ‒ No HA for now
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Router
Front-end
VIP public Front-end Router
Distributor
Instance
Amphora
Instance
Amphora
Instance
Amphora
VIP VIP private VIP
$ sudo ovs-ofctl –O OpenFlow 15 dump-groups br-data OFPST_GROUP_DESC reply (OF1.5) (xid=0x2): group_id=1, type=select, se sele lection_ ction_met ethod
hash, fi fiel elds( s(ip ip_sr src, , tcp_s cp_src), bucket=bucket_id:0,actions=set_field:fa:16:3e:95:86:06->eth_dst,IN_PORT, bucket=bucket_id:1,actions= ns=set set_fiel _field:f d:fa: a:16:3 6:3e: e:9d:c d:c9:d :d2->eth_ th_dst dst,IN_PORT, bucket=bucket_id:2,actions=set_field:fa:16:3e:ef:97:60->eth_dst,IN_PORT $
OS::Heat OS::Heat:: :: AutoScal AutoScalingGroup ingGroup
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Instance
Amphora
Instance
Amphora
Instance
Amphora
‒ Use Heat to manage Amphora stack
‒ Manage cluster of N Amphorae
‒ Configure each Amphora ‒ Monitor Amphorae at the application level
‒ Add/remove forwarding rules to Distributor
OS OS:: ::Ce Ceilom ilomet eter er:: :: Alarm Alarm
Disclaimer: Not even a blue-print yet ( but demo code )
‒ High-availability ‒ Performance
‒ Load-balancer HA ‒ Accommodate more workloads ‒ Allow pay-per-use (cost efficient)
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
OpenStack Austin 2016 Elastic Load Balancing Using Octavia 16
Elastic Active-Active
‒ Red shop ‒ Blue shop
‒ Red or Blue flower ‒ Different flower per back-end ‒ Back-end IP inserted into page
‒ For demo purposes only
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Distributor
Red Amphora Red Shop Blue Amphora Blue Shop Blue Shop Blue Shop Red Shop Red Shop Red Amphora Blue Amphora Red Amphora Red Amphora I want to buy flowers for my dear one
VIP 20.0.0.12 VIP 30.0.0.11 10.0.0.4 10.0.0.3 10.0.0.5 Private IPs Floating IPs
Back-end IP Amphora ID VIP
Back-end IP Amphora ID VIP changed unchanged refresh
Back-end IP Amphora ID VIP changed unchanged refresh
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Management network Red shop network Blue shop network
Amphorae Distributor
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Amphorae Cluster Ceilometer Alarm Ceilometer Alarm Scaling Policy Scaling Policy
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Scale-down Alarm Scale-down Policy Scale-up Policy Scale-up Alarm Amphorae Cluster
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Scale-up Ceilometer Alarm:
Alarm fires when avg of cpu_util > 40% over 2 minutes
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Scale-down Ceilometer Alarm:
Alarm fires when avg of cpu_util < 10% over 2 minutes
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
cpu_util > 40% (as specified in the alarm) – scale-up alarm triggered A new Amphora VM will be added to the cluster (by Heat Engine)
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
cpu_util < 10% (as specified in the alarm) – scale-down alarm triggered An existing Amphora VM will be removed from the cluster (by Heat Engine)
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
1 2 3 4 5 6 7 8 9
5 10 15 20 25 30 Number of Amphorae time New Sessions Per Second (1000)
Amphorae Sessions per second
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
OpenStack Austin 2016 Elastic Load Balancing Using Octavia 32
‒ Containers use less resources ‒ Can be packed tighter
‒ Horizontal scaling allows large workloads
‒ No need for +1 ?
‒ Larger N better spread ‒ Container migration
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
OpenStack Austin 2016 Elastic Load Balancing Using Octavia
Blueprints: (active-active-topology, active-active-distributor) https://review.openstack.org/#/c/234639