SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer!...

115
SKALOWANIE APLIKACJI PHP Leszek Krupiński, PHPCon 2014

Transcript of SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer!...

Page 1: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SKALOWANIE APLIKACJI PHP

Leszek Krupiński, PHPCon 2014

Page 2: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

LEAFNODE

Page 3: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

CO TO JEST SKALOWALNOŚĆ?

Page 4: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

— WIKIPEDIA

Skalowalność (ang. scalability) - zapewnienie coraz wydajniejszej pracy w miarę zwiększania

liczby elementów składowych.

Page 5: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SKALOWANIE WERTYKALNE

Page 6: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SKALOWANIE HORYZONTALNE

Page 7: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PO CO DBAĆ O SKALOWALNOŚĆ?

Page 8: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ZADOWOLENIE KLIENTA

Page 9: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

bit.ly/slowwebspeed

Page 10: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 11: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 12: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

JAKIE SĄ KRYTYCZNE WARTOŚCI?

Page 13: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 14: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 15: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYMIERNE KORZYŚCI

Page 16: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

15,4% WIĘCEJ POBRAŃ FIREFOKSA PO

PRZYSPIESZENIU STRONY MOZILLI O 2,2s

Page 17: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

14% WIĘCEJ WPŁAT NA KAMPANIĘ BARACKA OBAMY PO PRZYSPIESZENIU STRONY

ZGŁOSZENIOWEJ O 60%

Page 18: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYLICZENIA WALMARTU I AMAZONU:

ZYSKI WIĘKSZE O 1% ZA KAŻDE 100ms

Page 19: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYLICZENIA YAHOO: 9% WIĘCEJ RUCHU W

SERWISIE ZA KAŻDE 400ms

Page 20: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PODSTAWY

Page 21: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

HTTP REQUEST

Page 22: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 23: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 24: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 25: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SKOCZĘ JESZCZE PO WARZYWA

Page 26: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

CO MOŻNA ZROBIĆ?

Page 27: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

• SZYBSZA OBSŁUGA KLIENTA

• WIĘCEJ KAS • KOLEJNE SKLEPY

Page 28: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

KUPMY WIĘKSZY SERWER

Page 29: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

KUPMY WIĘCEJ

SERWERÓW

Page 30: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

BEZ ODPOWIEDNIEJ ARCHITEKTURY

NIE MA TO SENSU

Page 31: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

BYĆ MOŻE WYSTARCZY OPTYALIZACJA

APLIKACJI

Page 32: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYCIŚNIĘCIE MAKSIMUM Z

MOŻLIWOŚCI MASZYNY

Page 33: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

OPTYMALIZUJ ISTOTNE FRAGMENTY

KODU

Page 34: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

— Donald Knuth

Premature optimization is the root of all evil.

Page 35: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

UPEWNIJ SIĘ, ŻE TO NA PEWNO PHP

JEST WINNE

Page 36: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NARZĘDZIA

Page 37: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

xdebug + cachegrind

Page 38: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 39: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

XHProf

Page 40: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 41: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

New Relic

Page 42: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NEWRELIC POKAŻE KTÓRE KOMPONENTY

DOMINUJĄ OBCIĄŻENIE

Page 43: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

METRYKI

Page 44: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 45: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

STATSD

Page 46: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 47: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

MIN, MAX, 90th, COUNT, MEAN

Page 48: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

GRAPHITE

Page 49: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 50: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 51: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ANALIZA LOGÓW: LOGSTASH, GRAYLOG2

Page 52: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PHP

Page 53: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ZAKTUALIZUJ PHP

Page 54: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

STANDARD NA 2014: NGINX + PHP-FPM

Page 55: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NGINX: SZYBKOŚĆ,

ELASTYCZNOŚĆ

Page 56: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PHP-FPM: ROZDZIELENIE

PROCESÓW

Page 57: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WŁĄCZ OPCODE CACHE

Page 58: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ZOPTYMALIZUJ FRAMEWORK

Page 59: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WŁĄCZ CACHE

Page 60: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYŁĄCZ AUTOGENEROWANIE

Page 61: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

WYŁĄCZ ZBĘDNE MODUŁY

Page 62: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

OPTYMALIZACJA BAZY DANYCH

Page 63: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

GŁÓWNA PRZYCZYNA PROBLEMÓW Z WYDAJNOŚCIĄ

Page 64: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SLOW LOG? PERCONA TOOLKIT

Page 65: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

INDEKSY QUERY CACHE

ALTERNATYWNE SILNIKI

Page 66: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NOSQL

Page 67: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ARCHITEKTURA

Page 68: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 69: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

DOBIERZ KOMPONENTY

Page 70: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

FULL TEXT SEARCH? SPHINX.

Page 71: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

STRUKTURY DANYCH? REDIS.

Page 72: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

BUFORUJ DANE

Page 73: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

•WYNIKI ZAPYTAŃ •ODPOWIEDZI API •KONFIGURACJA •GENEROWANE DANE

Page 74: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NAJCZĘŚCIEJ UŻYWANE: W PAMIĘCI

Page 75: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

MEMCACHE

Page 76: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

MOŻLIWOŚĆ WYDZIELENIA WSPÓŁDZIELONEGO SERWERA MEMCACHE

Page 77: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

VARNISH

Page 78: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NAGŁÓWKI HTTP

bit.ly/httpcache

Page 79: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

MAX AGE LAST MODIFIED

ETAG

Page 80: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ROZDZIEL SKŁADNIKI

Page 81: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

ARCHITEKTURA HEKSAGONALNA

Page 82: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 83: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PRZETWARZAJ ASYNCHRONICZNIE

Page 84: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

GDZIEŚ TU UŻYTKOWNIK KLIKA “RELOAD”

Page 85: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

Aplikacja Kolejka

Page 86: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

Nowa%piosenka

RekodowanieC++MusicShare

Generowanie%skrótu%piosenkiC++

Web%ServiceJava

Jabbererlang

Statyczny%HTMLPHP

DECOUPLING

Page 87: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

LOAD BALANCING

Front&end

RabbitMQ

Consumer

Page 88: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

POZA JEDEN SERWER

Page 89: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

LOAD BALANCER

Page 90: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

VARNISH HAPROXY

NGINX

Page 91: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PROBLEMY

Page 92: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

DANE WSPÓŁDZIELONE

Page 93: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SESJE

Page 94: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

PERSISTENT LOAD BALANCER

Page 95: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

WSPÓLNY MEMCACHE

Page 96: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

INNE DANE

Page 97: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

PLIKI STATYCZNE

Page 98: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

!

WSPÓLDZIELONY SYSTEM PLIKÓW

Page 99: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

API

Page 100: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ARCHITEKTURA DLA BAZ DANYCH

Page 101: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

REPLIKACJA MASTER-SLAVE

Page 102: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

SHARDING

Page 103: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 104: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 105: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.
Page 106: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PROBLEMY

Page 107: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

RESHARDING

Page 108: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

JOIN

Page 109: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NA KONIEC

Page 110: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

NIE OPTYMALIZUJ PRZEDWCZEŚNIE

Page 111: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

BUDUJ ARCHITEKTURĘ PERSPETYWICZNIE

Page 112: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

ŻYCZĘ WSZYSTKIM TAKICH PROBLEMÓW

:-)

Page 113: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

https://joind.in/11839

Page 114: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

PYTANIA?

Page 115: SKALOWANIE APLIKACJI PHP - wafel.com · php decoupling. load balancing front&end rabbitmq consumer! poza jeden serwer. load balancer. varnish haproxy nginx. problemy! dane wspÓŁdzielone.

DZIĘKUJĘ ZA UWAGĘ