27
Administrasi Server Load Balancing

Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Embed Size (px)

DESCRIPTION

Load Balancing Load Balacing: Mendistribusikan Resource. Resource: Processor, Memory, Network, Storage On top of creating actions and responses, your processor also powers your operating system RAM overutilization is not as big a problem as CPU overconsumption but it can still cause significant performance impact Network for monitoring bandwidth with tools bwm-ng, ping, and traceroute Disk (storage) for monitoring disk usage with tools du and df

Citation preview

Page 1: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Administrasi ServerLoad Balancing

Page 2: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing• Load balancing means the ability to spread the load of

processing for an application over a number of separate systems for an overall performance increase in processing incoming requests.

• Simple?

• Hanya membagi tugas kah?

• Pemisahan Web Server & Database Server apakah termasuk load balancing?

Page 3: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing• Load Balacing: Mendistribusikan Resource.• Resource: Processor, Memory, Network, Storage• On top of creating actions and responses, your processor also

powers your operating system• RAM overutilization is not as big a problem as CPU

overconsumption but it can still cause significant performance impact

• Network for monitoring bandwidth with tools bwm-ng, ping, and traceroute

• Disk (storage) for monitoring disk usage with tools du and df

Page 4: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

top

Page 5: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Prinsip Load balancingPrimary principles:• Split applications over a number of servers, balancing the load

over a number of servers (such as separate web and database servers).

• Add specialist components to applications in order to balance the amount of processing needed for each application function, – Caching of common web site data, saving time on the collection of this

data from disk, or the creation of this data from database entries, etc.

• Create additional servers that can collectively share the load, which can greatly increase the amount of processing power available to complete the tasks required by a server.

Page 6: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Perancangan Load BalancingGuiding Principles• Understand your system• Planning• Monitoring and Testing

Page 7: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Topics• Load Balancing Your Website• Load Balancing Your Database• Network Load Balancing

Page 8: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Webiste• Contoh kasus: Apache• Apakah Apache yang terinstall sudah maksimal?• Memaksimalkan Apache:

- Disable Modul yang tidak dibutuhkan

- Disabling DNS lookups- Compression

Page 9: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Website

Page 10: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Website• Distribute all incoming connections to your web site to a

number of different web servers by using one or more load balancing servers.

• Reduce the overall load on the web servers, you also have good means of failover in case one of the web servers temporarily breaks down.

• The simplest setup requires at least two web servers and one load-balancing server.

Page 11: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Website

Page 12: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Website

• Preparing the server• Preparing the workers• Testing the Load Balancer

Page 13: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Website

Page 14: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Database• MySQL Cluster will depend on several nodes working

together.• One or more cluster management nodes to manage,

configure, and oversee your cluster, one (though commonly several) data nodes on which to store your data, and one or more MySQL nodes (traditional MySQL servers) that execute SQL queries.

Page 15: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Load Balancing your Database

Page 16: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

• Sharing the workload• Basic Routing• Basic network connectivity testing

Network Load Balancing

Page 17: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Network Load Balancing

Page 18: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

• Round Robin• Least Connection• Source• URI• URL parameter

Load Balancing Scheduling Algorithm

Page 19: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

HTTP LOAD BALANCING DENGAN HAPROXY

Page 20: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Topologi

Page 21: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Konfigurasi HAProxy (1)• Instalasi HAProxy

− sudo apt-get install haproxy

• Enable haproxy– Buka file /etc/default/haproxy– Ubah bagian opsi ENABLED menjadi ENABLED=1– Simpan perubahan

• Konfigurasi file /etc/haproxy/haproxy.cfg– Detail file konfigurasi ada di 3 slide selanjutnya

Page 22: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

File Konfigurasi haproxy.cfgglobal log /dev/log local0 log /dev/log local1 notice user haproxy group haproxy daemon

……

Page 23: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

File Konfigurasi haproxy.cfg (cont.)…….

defaults log global mode http option httplog option dontlognull contimeout 5000 clitimeout 50000 srvtimeout 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http

Page 24: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

File Konfigurasi haproxy.cfg (cont.)…….

listen webfarm 0.0.0.0:80 mode http stats enable stats uri /haproxy?stats balance roundrobin option httpclose option forwardfor server webserver1 10.34.8.22:80 check server webserver2 10.34.8.23:80 check

nama load balancerIP/Port load balancer

algoritma load balancing

IP/Port webserver 1

IP/Port webserver 2

Page 25: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Konfigurasi HAProxy (2)• Restart service haproxy

– sudo service haproxy restart

• Catatan khusus : jika haproxy tidak dapat di-start/restart karena error socket binding, stop service apache2– sudo service apache2 stop

Page 26: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Pengujian HAProxy• Ubah isi file /var/www/html/index.html pada webserver1

– <h1> Webserver 1</>

• Ubah isi file /var/www/html/index.html pada webserver2– <h1> Webserver 2</>

• Lakukan akses ke alamat load balancer lewat browser

Page 27: Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number

Terima Kasih