SlideShare uma empresa Scribd logo
1 de 25
Performance e Autoscaling
2
Due lati della stessa medaglia
3
Aspetta, provo questo
e andiamo online!
Chi sono
4
• LUIGI MOLINARO – neen
Di cosa parlerò
• Che cosa è l'auto-scaling ?
• Di cosa ho bisogno per scalare ?
• Scaling & Perfomance: Strumenti di Benchmark
• Tuning Magento per l’auto-scaling
• Video scaling
• Analisi dei Benchmark effettuati
• Rischi legati all'autoscaling
Traffic Patterns
5
Predictable Bursts1 Un Predictable Bursts2 Constantly Growing3
Upfront server investment
6
CAPACITY
TIME
Source AWS
Large upfront
investment
Large upfront
investment
FIXED CAPACITY
PREDICTION
7
CAPACITY
TIME
Source AWS
FIXED CAPACITY
ACTUAL DEMAND
Fixed vs Actual demand
8
CAPACITY
TIME
Source AWS
FIXED CAPACITY
ACTUAL DEMAND
1° Problema: Capacità inutilizzata
9
CAPACITY
TIME
Source AWS
FIXED CAPACITY
ACTUAL DEMAND
2° Problema: Picchi non gestiti
10
CAPACITY
TIME
Source AWS
ACTUAL DEMAND
VIRTUALIZED INFRASTRUCTURE
Autoscaling
We can closely align our infrastructure
with our load requirements and save costs
Why Amazon AWS?
11
•Il cloud pubblico più famoso al mondo
•Ambiente standard e conosciuto per i test
•Ottimo sistema di Autoscaling
•Cloud Specialist
Solution components
12
• Magento CE
• EC2 (Elastic Compute Cloud)
• EBS (Elastic Block Storage)
• ELB (Elastic Load Balancer)
• Amazon Elastic Ip Address (Varnish)
• Amazon ClaudWatch
• NFS
• Nginx
• Php-fpm APC
• Redis
• Memcache
• Varnish
Autoscaling Benchmarks
13
BENCHMARK 1
• Un singolo server (senza cache, cache, redis/memcache, Magento Tuned, Mage 100k)
BENCHMARK 2
• Scaling Orizzontale dell’infrastruttura
BENCHMARK 3
• Scaling con Varnish (no cache-cache)
Autoscaling Key
14
• Varnish
• CloudWatch
• Template studiato per scalare
• Memcache sessioni, Redis cache
Template studiato per scalare
15
• Immaginare come si comporta un nuovo server da zero
• Sfruttare sistemi di automazione (Puppet, Chef, oppure ignegniarsi ! :-)
• Php Session
• Log Server remoto
• Monitoring Server
• Il server può essere terminato
• Storage distribuito (NFS)
CloudWatch metrics
16
Create new launch configuration:
> as-create-launch-config my-launch-config –image-id (template ottimizzato frontend) –
instance type m1.small –key my-key-pair –group my-security-group
Create auto scale group:
> as-create-auto-scaling-group “my-as-group” --availability-zone eu-west-1 –launch-
configuration my-launch-config –max-size 10 –min-size 1 –cooldown 180 –load-balancers
my-load-balancer
Create auto scale group:
> as-create-or-update-trigger my-as-trigger –auto-scaling-group –namespace “mm14” --
measure CPU Utilization –statistics Average –dimension “AutoscalingGroupName= my-as-
group” --period 60 –lower-treshold 20 –upper-treshold 80 –lower-breach-increment 2 –
upper-breach-increment 4 –breach-duration 180
Redis + memcache
17
•Redis good for cache
•Memcache good for sessions
Strumenti per l’analisi
18
• Strumenti di analisi lato server (Munin, Nagios, Cacti, Zabbix, Ganglia)
• Strumenti di analisi applicativo / profiling (Zend server, Xdebug, Xhprof, MySql tuner, New
Relic)
• Strumenti grafici (kcachegring, webgring, xhgui, xhprof.io)
Stress testing tools Opensource / Commerciali
(Apache Jmeter, Siege, Httperf, Tsung / LoadImpact, flood.io, Load Tester)
Test applicativo
19
• Si è presa la sitemap.xml e la si è data in pasto a SIEGE (Usare log Varnish/web
server in casi complicati o per avvicinarsi al caso reale più possibile)
• Script per popolare database con 100.000 prodotti
• Si è lanciato SIEGE con uno script in bash per aumentare la concorrenza
gradualmente
• Ogni 30 secondi incremento di 10 utenze contemporanee
• I dati si sono graficati grazie a highcharts.com
20
Autoscaling video
Analisi grafici
21
• Riepilogativo dei test, con evidenza dei possibili visitatori / costi nelle varie ipotesi
Varnish
22
• Cos’è
• Perché
• Criticità nell’inserirlo all’interno dell’autoscaling Amazon
• Soluzione al problema
Analisi costi
23
Soluzione
Utenti
contemporanei
Costi indicativi
(al mese)
1 Nodo 10 $ 80,00
2 Nodi (www + MySql) 35 $ 200,00
3 Nodi (www + NFS + MySql) 35 $ 240,00
12 nodi (10x www + NFS + MySql) 150 $ 720,00
4 Nodi (www + NFS + MySql + Varnish no cache) + 9x www al 10% 150 $ 450,00
4 Nodi (www + NFS + MySql + Varnish cache) + 6x www al 10% > 150 $ 440,00
24
GRAZIE!
Follow us
25
facebook.com/neen.datacenter
@neendatacenter
youtube.com/neendatacenter
linkedin.com/company/neen-srl
neen s.r.l.
Via Mecenate 76/20A - 20138 Milano
T: (+39) 02.45485420 - F: (+39)
02.45485432
E: info@neen.it
Web: www.neen.it
Follow me
@luigimolinaro
it.linkedin.com/in/luigimolinaro/

Mais conteúdo relacionado

Destaque

Portfolio
PortfolioPortfolio
Portfolioilariar
 
春日小学校講演会
春日小学校講演会春日小学校講演会
春日小学校講演会fukudaisanzo
 
Group activity 1: Introduction to HCI
Group activity 1: Introduction to HCIGroup activity 1: Introduction to HCI
Group activity 1: Introduction to HCIFitri Masaan
 
Treball del ordinador
Treball del ordinadorTreball del ordinador
Treball del ordinadordjgero
 
Old Patients Present with High GCS in traumatic brain injury
Old Patients Present with High GCS in traumatic brain injuryOld Patients Present with High GCS in traumatic brain injury
Old Patients Present with High GCS in traumatic brain injuryDr Amber Z Jafferi
 
La fête de la chandeleur en France
 La fête de la chandeleur en France La fête de la chandeleur en France
La fête de la chandeleur en FranceEleni Chartzavalou
 
Aplication & flow system
Aplication & flow systemAplication & flow system
Aplication & flow systempendi pendi
 
Arunkumar_Profile
Arunkumar_ProfileArunkumar_Profile
Arunkumar_Profilearunn2980
 
Scientific research methodology
Scientific research methodologyScientific research methodology
Scientific research methodologyBleixen Sanchez
 

Destaque (17)

Portfolio
PortfolioPortfolio
Portfolio
 
อนุตตรีย์ วัชรภา
อนุตตรีย์  วัชรภาอนุตตรีย์  วัชรภา
อนุตตรีย์ วัชรภา
 
Embryology 1
Embryology 1Embryology 1
Embryology 1
 
You can win bangla by shiv khera (tanbircox)
You can win bangla by shiv khera (tanbircox)You can win bangla by shiv khera (tanbircox)
You can win bangla by shiv khera (tanbircox)
 
春日小学校講演会
春日小学校講演会春日小学校講演会
春日小学校講演会
 
Group activity 1: Introduction to HCI
Group activity 1: Introduction to HCIGroup activity 1: Introduction to HCI
Group activity 1: Introduction to HCI
 
Treball del ordinador
Treball del ordinadorTreball del ordinador
Treball del ordinador
 
Old Patients Present with High GCS in traumatic brain injury
Old Patients Present with High GCS in traumatic brain injuryOld Patients Present with High GCS in traumatic brain injury
Old Patients Present with High GCS in traumatic brain injury
 
Vocabularyby tanbircox
Vocabularyby tanbircoxVocabularyby tanbircox
Vocabularyby tanbircox
 
Big Data, Better Understanding, Better Care
Big Data, Better Understanding, Better CareBig Data, Better Understanding, Better Care
Big Data, Better Understanding, Better Care
 
La fête de la chandeleur en France
 La fête de la chandeleur en France La fête de la chandeleur en France
La fête de la chandeleur en France
 
Environment science by tanbircox
Environment science by tanbircoxEnvironment science by tanbircox
Environment science by tanbircox
 
Aplication & flow system
Aplication & flow systemAplication & flow system
Aplication & flow system
 
Arunkumar_Profile
Arunkumar_ProfileArunkumar_Profile
Arunkumar_Profile
 
Scientific research methodology
Scientific research methodologyScientific research methodology
Scientific research methodology
 
Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)
Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)
Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)
 
Important idioms and phrases by tanbircox
Important idioms and phrases  by tanbircoxImportant idioms and phrases  by tanbircox
Important idioms and phrases by tanbircox
 

Semelhante a [Neen luigi m]autoscalingmagentointhecloud-v7

Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...Meet Magento Italy
 
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQL
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQLMySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQL
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQLPar-Tec S.p.A.
 
October 2009 - JBoss Cloud
October 2009 - JBoss CloudOctober 2009 - JBoss Cloud
October 2009 - JBoss CloudJBug Italy
 
JBoss Clouds - JBug Roma october 2009
JBoss Clouds -  JBug Roma october 2009JBoss Clouds -  JBug Roma october 2009
JBoss Clouds - JBug Roma october 2009Sanne Grinovero
 
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBPolyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBSteve Maraspin
 
Azure dayroma java, il lato oscuro del cloud
Azure dayroma   java, il lato oscuro del cloudAzure dayroma   java, il lato oscuro del cloud
Azure dayroma java, il lato oscuro del cloudRiccardo Zamana
 
(N+1) Lezioni sul serverless
(N+1) Lezioni sul serverless(N+1) Lezioni sul serverless
(N+1) Lezioni sul serverlessPiero Bozzolo
 
Enterprise ASP.NET Web Forms 4.0
Enterprise ASP.NET Web Forms 4.0Enterprise ASP.NET Web Forms 4.0
Enterprise ASP.NET Web Forms 4.0Codemotion
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databasesGianluca Hotz
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page ApplicationsRoberto Messora
 
#2014LRIS - Liferay in a Cloud-Driven World
#2014LRIS - Liferay in a Cloud-Driven World#2014LRIS - Liferay in a Cloud-Driven World
#2014LRIS - Liferay in a Cloud-Driven Worldkino2k
 
Big Data e la forza degli eventi - Intervento di Cornevilli
Big Data e la forza degli eventi - Intervento di CornevilliBig Data e la forza degli eventi - Intervento di Cornevilli
Big Data e la forza degli eventi - Intervento di Cornevillicomunicareonline
 
Saphanaonpower 15 marzo webinar part 1 laura
Saphanaonpower 15 marzo webinar part 1 lauraSaphanaonpower 15 marzo webinar part 1 laura
Saphanaonpower 15 marzo webinar part 1 lauraLaura Narducci
 
Cuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysisCuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysisjekil
 
Antica presentazione AJAX
Antica presentazione AJAXAntica presentazione AJAX
Antica presentazione AJAXTommaso Torti
 
Warehouse Control Tower and Xray Image Recognition
Warehouse Control Tower and Xray Image RecognitionWarehouse Control Tower and Xray Image Recognition
Warehouse Control Tower and Xray Image RecognitionDecision Science Community
 
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWS
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWSTrovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWS
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWSAmazon Web Services
 
Cloud for sap evento15.4
Cloud for sap evento15.4Cloud for sap evento15.4
Cloud for sap evento15.4Otello Costa
 
Come l’Open Source può essere alla base di un business di successo: il caso H...
Come l’Open Source può essere alla base di un business di successo: il caso H...Come l’Open Source può essere alla base di un business di successo: il caso H...
Come l’Open Source può essere alla base di un business di successo: il caso H...MariaDB plc
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query ProcessingGianluca Hotz
 

Semelhante a [Neen luigi m]autoscalingmagentointhecloud-v7 (20)

Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
 
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQL
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQLMySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQL
MySQL Tech Tour 2015 - Soluzioni di alta disponibilità con MySQL
 
October 2009 - JBoss Cloud
October 2009 - JBoss CloudOctober 2009 - JBoss Cloud
October 2009 - JBoss Cloud
 
JBoss Clouds - JBug Roma october 2009
JBoss Clouds -  JBug Roma october 2009JBoss Clouds -  JBug Roma october 2009
JBoss Clouds - JBug Roma october 2009
 
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBPolyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
 
Azure dayroma java, il lato oscuro del cloud
Azure dayroma   java, il lato oscuro del cloudAzure dayroma   java, il lato oscuro del cloud
Azure dayroma java, il lato oscuro del cloud
 
(N+1) Lezioni sul serverless
(N+1) Lezioni sul serverless(N+1) Lezioni sul serverless
(N+1) Lezioni sul serverless
 
Enterprise ASP.NET Web Forms 4.0
Enterprise ASP.NET Web Forms 4.0Enterprise ASP.NET Web Forms 4.0
Enterprise ASP.NET Web Forms 4.0
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
#2014LRIS - Liferay in a Cloud-Driven World
#2014LRIS - Liferay in a Cloud-Driven World#2014LRIS - Liferay in a Cloud-Driven World
#2014LRIS - Liferay in a Cloud-Driven World
 
Big Data e la forza degli eventi - Intervento di Cornevilli
Big Data e la forza degli eventi - Intervento di CornevilliBig Data e la forza degli eventi - Intervento di Cornevilli
Big Data e la forza degli eventi - Intervento di Cornevilli
 
Saphanaonpower 15 marzo webinar part 1 laura
Saphanaonpower 15 marzo webinar part 1 lauraSaphanaonpower 15 marzo webinar part 1 laura
Saphanaonpower 15 marzo webinar part 1 laura
 
Cuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysisCuckoo Sandbox: Automated malware analysis
Cuckoo Sandbox: Automated malware analysis
 
Antica presentazione AJAX
Antica presentazione AJAXAntica presentazione AJAX
Antica presentazione AJAX
 
Warehouse Control Tower and Xray Image Recognition
Warehouse Control Tower and Xray Image RecognitionWarehouse Control Tower and Xray Image Recognition
Warehouse Control Tower and Xray Image Recognition
 
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWS
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWSTrovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWS
Trovare ciò che serve nella confusione: comprendere i Big Data con l'analisi AWS
 
Cloud for sap evento15.4
Cloud for sap evento15.4Cloud for sap evento15.4
Cloud for sap evento15.4
 
Come l’Open Source può essere alla base di un business di successo: il caso H...
Come l’Open Source può essere alla base di un business di successo: il caso H...Come l’Open Source può essere alla base di un business di successo: il caso H...
Come l’Open Source può essere alla base di un business di successo: il caso H...
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query Processing
 

[Neen luigi m]autoscalingmagentointhecloud-v7

  • 1.
  • 2. Performance e Autoscaling 2 Due lati della stessa medaglia
  • 3. 3 Aspetta, provo questo e andiamo online!
  • 4. Chi sono 4 • LUIGI MOLINARO – neen Di cosa parlerò • Che cosa è l'auto-scaling ? • Di cosa ho bisogno per scalare ? • Scaling & Perfomance: Strumenti di Benchmark • Tuning Magento per l’auto-scaling • Video scaling • Analisi dei Benchmark effettuati • Rischi legati all'autoscaling
  • 5. Traffic Patterns 5 Predictable Bursts1 Un Predictable Bursts2 Constantly Growing3
  • 6. Upfront server investment 6 CAPACITY TIME Source AWS Large upfront investment Large upfront investment FIXED CAPACITY PREDICTION
  • 7. 7 CAPACITY TIME Source AWS FIXED CAPACITY ACTUAL DEMAND Fixed vs Actual demand
  • 8. 8 CAPACITY TIME Source AWS FIXED CAPACITY ACTUAL DEMAND 1° Problema: Capacità inutilizzata
  • 9. 9 CAPACITY TIME Source AWS FIXED CAPACITY ACTUAL DEMAND 2° Problema: Picchi non gestiti
  • 10. 10 CAPACITY TIME Source AWS ACTUAL DEMAND VIRTUALIZED INFRASTRUCTURE Autoscaling We can closely align our infrastructure with our load requirements and save costs
  • 11. Why Amazon AWS? 11 •Il cloud pubblico più famoso al mondo •Ambiente standard e conosciuto per i test •Ottimo sistema di Autoscaling •Cloud Specialist
  • 12. Solution components 12 • Magento CE • EC2 (Elastic Compute Cloud) • EBS (Elastic Block Storage) • ELB (Elastic Load Balancer) • Amazon Elastic Ip Address (Varnish) • Amazon ClaudWatch • NFS • Nginx • Php-fpm APC • Redis • Memcache • Varnish
  • 13. Autoscaling Benchmarks 13 BENCHMARK 1 • Un singolo server (senza cache, cache, redis/memcache, Magento Tuned, Mage 100k) BENCHMARK 2 • Scaling Orizzontale dell’infrastruttura BENCHMARK 3 • Scaling con Varnish (no cache-cache)
  • 14. Autoscaling Key 14 • Varnish • CloudWatch • Template studiato per scalare • Memcache sessioni, Redis cache
  • 15. Template studiato per scalare 15 • Immaginare come si comporta un nuovo server da zero • Sfruttare sistemi di automazione (Puppet, Chef, oppure ignegniarsi ! :-) • Php Session • Log Server remoto • Monitoring Server • Il server può essere terminato • Storage distribuito (NFS)
  • 16. CloudWatch metrics 16 Create new launch configuration: > as-create-launch-config my-launch-config –image-id (template ottimizzato frontend) – instance type m1.small –key my-key-pair –group my-security-group Create auto scale group: > as-create-auto-scaling-group “my-as-group” --availability-zone eu-west-1 –launch- configuration my-launch-config –max-size 10 –min-size 1 –cooldown 180 –load-balancers my-load-balancer Create auto scale group: > as-create-or-update-trigger my-as-trigger –auto-scaling-group –namespace “mm14” -- measure CPU Utilization –statistics Average –dimension “AutoscalingGroupName= my-as- group” --period 60 –lower-treshold 20 –upper-treshold 80 –lower-breach-increment 2 – upper-breach-increment 4 –breach-duration 180
  • 17. Redis + memcache 17 •Redis good for cache •Memcache good for sessions
  • 18. Strumenti per l’analisi 18 • Strumenti di analisi lato server (Munin, Nagios, Cacti, Zabbix, Ganglia) • Strumenti di analisi applicativo / profiling (Zend server, Xdebug, Xhprof, MySql tuner, New Relic) • Strumenti grafici (kcachegring, webgring, xhgui, xhprof.io) Stress testing tools Opensource / Commerciali (Apache Jmeter, Siege, Httperf, Tsung / LoadImpact, flood.io, Load Tester)
  • 19. Test applicativo 19 • Si è presa la sitemap.xml e la si è data in pasto a SIEGE (Usare log Varnish/web server in casi complicati o per avvicinarsi al caso reale più possibile) • Script per popolare database con 100.000 prodotti • Si è lanciato SIEGE con uno script in bash per aumentare la concorrenza gradualmente • Ogni 30 secondi incremento di 10 utenze contemporanee • I dati si sono graficati grazie a highcharts.com
  • 21. Analisi grafici 21 • Riepilogativo dei test, con evidenza dei possibili visitatori / costi nelle varie ipotesi
  • 22. Varnish 22 • Cos’è • Perché • Criticità nell’inserirlo all’interno dell’autoscaling Amazon • Soluzione al problema
  • 23. Analisi costi 23 Soluzione Utenti contemporanei Costi indicativi (al mese) 1 Nodo 10 $ 80,00 2 Nodi (www + MySql) 35 $ 200,00 3 Nodi (www + NFS + MySql) 35 $ 240,00 12 nodi (10x www + NFS + MySql) 150 $ 720,00 4 Nodi (www + NFS + MySql + Varnish no cache) + 9x www al 10% 150 $ 450,00 4 Nodi (www + NFS + MySql + Varnish cache) + 6x www al 10% > 150 $ 440,00
  • 25. Follow us 25 facebook.com/neen.datacenter @neendatacenter youtube.com/neendatacenter linkedin.com/company/neen-srl neen s.r.l. Via Mecenate 76/20A - 20138 Milano T: (+39) 02.45485420 - F: (+39) 02.45485432 E: info@neen.it Web: www.neen.it Follow me @luigimolinaro it.linkedin.com/in/luigimolinaro/