ATOL: Load Balancing Marek Grac xgrac@fi.muni.cz Red Hat Czech s.r.o. / Faculty of Informatics, Masaryk University Advanced Topics of Linux Administration Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing Introduction to load-balancing ► Technique to distribute workload across several computers ► Increase reliability through redundancy ► Application based solutions ► General solutions based on Linux Virtual Server ipvsadm + pulse / piranha (Red Hat) ipvsadm + ldirectord (Novell) ► General solutions based on DNS (round robin) ► Solutions based on specified network protocol Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o Application based solutions ► Application is written with load-balancing as a feature ► Usually based on active-active model (service is running on several machines at same time) ► Examples: Clustered Samba, Oracle RAC ► Advantages: Better performance, Everything included Disadvantages: Very difficult to rewrite existing application Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o Framework based solutions ► Application does not know about load-balancing ► Active-active model but YOU HAVE TO take care of data (common storage, persistence of connections) ► ipvsadm Kernel + user-space part (ipvsadm) Protocol independent ► pulse + piranha Checking of service availability Improve configuration management piranha (Web User Interface) Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o Protocol specific solutions Mostly dedicated for HTTP e.g. nginx Reverse proxy ► Support HTTP, HTTPS, SMTP, POP3, IMAP (nothing else) Used by Sourceforge.net, AOL, WordPress.com ► Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o ipvsadm short FAQ ► kvm virtualization - packet is lost on router between virbrO and ethO is caused by problem with incorrect checksum. On each 'real' server you have to run ethtool -K ethO tx off ► QEMU and XEN virtualization - packet is lost on router between virbrO and ethO - problem is not solved yet ► how to setup arptables? Look at http://sources.redhat.com/cluster/wiki/PiranhaSetupSimple Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o Goals ► Create a load-balancing solution based on ipvsadm on router (IPC) and two load-balanced servers (2PC) ► Create an HTTP service that will be load-balanced (use different text on each server to find out that it works correctly) Marek Grác xgrac@fi.muni.cz ATOL: Load Balancing gp - = = ^)c^o