SlideShare a Scribd company logo
1 of 50
Download to read offline
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Andrea Catalano
Solution Architect
Amazon Web Services
Gestire la scalabilità su larga scala
26-02-2024
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cos’è la concorrenza ?
Perché dovrei preoccuparmi della concorrenza?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Commodore 64
Nessuna concorrenza! Se volevi eseguire
un programma diverso dovevi spegnere il
computer, inserire un nuovo disco e
riaccenderlo.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cooperative multitasking
Il programma in primo piano è
responsabile del controllo periodico
per vedere se un altro programma
richiede CPU. Facoltativamente può
cedere ai programmi in background
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Preemptive multitasking
Il sistema operativo può sospendere in
modo proattivo un programma e pianificare
quale programma dovrà ottenere
successivamente un intervallo di tempo
della CPU.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Multicore processors
Più programmi vengono effettivamente eseguiti
contemporaneamente su core diversi dello stesso
processore.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Client/server architecture
I programmi comunicano tramite Internet con
cluster di server in cui il lavoro viene svolto su
molti computer multicore
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
La concorrenza continua ad aumentare
in modo esponenziale man mano che la
tecnologia migliora
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
La storiaa delle tecnologie infrastrutturali di base
Hardware Hardware
Hardware
Operating System Operating System
Operating System
Hypervisor Container Runtime
App App App
Virtual Machine
Operating System
bin / Library
App App
Virtual Machine
Operating System
bin / Library
App App
App
bin /
Library
Container
App
bin /
Library
Container
App
bin /
Library
Container
App
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Come posso creare
un'applicazione in grado di
gestire la concorrenza?
Da zero utenti a milioni
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Un solo container è semplice….
Container Runtime
Host OS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Ho un limite al numero massimo di containers in un Host…
Container Runtime
Host OS
?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Complessità nella gestione della scalabilità
Container Runtime
Host OS
Container Runtime
Host OS
Container Runtime
Host OS
…
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Come Sviluppatore software hai bisogno degli strumenti
giusti al momento giusto
Il nuovo progetto greenfield
necessita di un rapido sviluppo di
nuove funzionalità
Il software maturo necessita di
manutenzione, supporto e affidabilità
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Gli sviluppatori necessitano di un'elaborazione ottimizzata
per una bassa concorrenza e di un'elaborazione
ottimizzata per un'elevata concorrenza
Low Concurrency
Applications
Sto ancora cercando il
prodotto adatto al
mercato. Hai bisogno di
uno sviluppo facile, bassi
costi operativi, bassi costi
di base.
High Concurrency
Applications
Adozione virale di
grande successo. Hai
bisogno di grandi
quantità di elaborazione
a tariffe sostenibili.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Le tecnologie containers serverless ti aiutano a
iniziare in piccolo ma poi a espandersi quando
necessario.
AWS Lambda AWS App Runner AWS Fargate
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda
Funzioni as a Service
conteinerizzate nel Cloud
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda esegue la tua funzione nel cloud
exports.handler = (event, context, callback) => {
callback(null, "Hello world!");
}
Handler function
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Diversi modi di eseguire il codice: eventi
exports.handler = (event, context, callback) => {
callback(null, "Hello world!");
}
Handler function
AWS Lambda
Esegui tramite le API di
Lambda
Esegui al verificarsi di un
evento
Amazon
EventBridge
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Diversi modi per eseguire il codice: richieste web
Handler function
Amazon API Gateway
Application Load Balancer
exports.handler = (event, context, callback) => {
callback(null, "Hello world!");
}
Lambda function URL
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
exports.handler = (event, context, callback) => {
callback(null, "Hello world!");
}
Handler function
Firecracker microVM
exports.handler = (event, context, callback) => {
callback(null, "Hello world!");
}
Handler function
Firecracker microVM
Lambda crea più
copie isolate del tuo
codice inserito in
contenitori in
microVM fortemente
isolate l'una dall'altra
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Firecracker virtual machine monitor (VMM)
• KVM-BASED VMM
• OPEN SOURCE
• PROGETTATO PER WORKLOADS SERVERLESS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Firecracker obbiettivi
Sicurezza
• Funzionalità del SO limitate
• Accesso al Sistema operative guest
non possibile
• Singolo processo per ogni VM
Efficiencienza
• Boot Veloce
• Basso consume di CPU e Memoria
• Gestione tramite API
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cold Start Invoke
AWS Lambda è estremamente conveniente quando
ci sono tempi morti tra una attività e l’altra da
svolgere
Init
Nessun
Costo
Paghi per ms
Invoke
Nessun costo
“Scala a 0”
1 sec
Paghi per ms
500 ms Invoke
Nessun costo
“Scala a 0”
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Function
execution
Cold Start
Cold Start
Cold Start
Function
Instance 1
Function
Instance 2
Function
Instance 3
1 request
2 concurrent
requests
3 concurrent
requests
Un'istanza gestisce solo un'invocazione alla volta
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cold Start Invoke
Scalabilità gestita da AWS
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke
x3 x2 x3 x3
x2 x2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cold Start Invoke
Che cosa succede quando ci sono molte funzioni
Lambda simultanee?
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
Cold Start Invoke
Init Invoke Invoke Invoke
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Concorrenza
Cosa sta realmente accadendo durante una
richiesta?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Handler Invoke (120ms)
Validate Input
Payload (1ms)
Insert Row in Database,
wait for response (10ms)
Call to downstream service and wait for response (100ms)
JSON serialize
(8ms)
Handle DB
response
(1ms)
Molte applicazioni moderne sono piene di operazioni
di input/output (I/O).
Cosa sta effettivamente facendo la mia applicazione?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Handler Invoke (120ms)
Validate Input
Payload (1ms)
Insert Row in Database,
wait for response (10ms)
Call to downstream service and wait for response (100ms)
JSON serialize
(8ms)
Handle DB
response
(1ms)
Running Waiting Running Waiting Running
Le applicazioni che fanno I/O spesso trascorrono più tempo in
attesa rispetto all'esecuzione del codice sulla CPU
Cosa sta effettivamente facendo la mia applicazione?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Cold Start Init
Maggiore è l'attività simultanea che ho, maggiori
sono i millisecondi di attesa rispetto ai millisecondi di
esecuzione delle istruzioni della CPU
Cold Start Init
Cold Start Init
Cold Start Init
Cold Start Init
Cold Start Init
Cold Start Init
Quali alternative ci sono?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
I moderni framework applicativi consentono di
gestire più richieste simultanee in un unico
processo applicativo
Event Loop
Validate Input
Payload (1ms)
JSON
serialization
(8ms)
Handle DB
response
(1ms)
Ogni secondo ha 1000 ms
di CPU
Quando si fa I/O la CPU si
dedica ad altro
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Validate Input
Payload (1ms)
JSON serialization
(8ms)
Handle DB
response (1ms)
Invece di non fare nulla durante l'attesa, gestisce
un altro evento
Time
Waiting for DB
Validate Input
Payload (1ms)
Waiting for downstream service
Waiting for DB Handle DB
response (1ms)
Waiting for downstream service JSON serialization
(8ms)
Un singolo processo applicativo può tenere occupato il core della CPU
svolgendo altro lavoro (come rispondere a un'altra richiesta HTTP) mentre
attende l'I/O
Request 1
Request 2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
exports.handler = async function (event, context, callback) {
// Validate the event
let dbResponse = await db.insert(); // Wait for IO from DB
// Handle DB response
let downstreamResponse = await downstreamService.put();
// Serialize a JSON response
}
La parola chiave wait
ritorna al ciclo degli
eventi per consentire
al processo di
iniziare a gestire
un'altra richiesta
mentre attende il
completamento
dell'I/O.
Node.js async/await
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
exports.handler = async function (event, context, callback) {
// Validate the event
let dbResponse = await db.insert(); // Wait for IO from DB
// Handle DB response
let downstreamService = await downstreamService.put();
// Serialize a JSON response
}
La quantità di possibile concorrenza per una funzione
dipende dal tempo della CPU consumato dalle sue
istruzioni
10ms
100ms
1ms
1ms
8ms
CPU time: 10ms
1000ms / 10ms = 100 invocazioni di funzioni/sec per singolo thread
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Gestione della concorrenza: cosa succede se hai
troppe richieste al secondo?
Event Loop
Code to run
Code to run
Code to run
Code to run
Code to run
Code to run
Code to run
Code to run
Code to run
Code to run
CPU
0%
100%
Quando la CPU si satura,
il tempo di risposta sale
alle stelle
50%
Response
Time
Memory
Le attività iniziano a
essere messe in coda
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Soluzione: bilanciare il carico simultaneo su più
copie del processo applicativo, ciascuna con il
proprio ciclo di eventi
Load Balancer
Event
Loop
Event
Loop
I processi potrebbero
essere sia in esecuzione
sulla stessa macchina
fisica che condividere
core separati di una
macchina multicore.
Oppure potrebbero
essere saltri nodi
computazionali
Application
Container
Application
Container
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS App Runner
Ogni copia della tua applicazione
gestisce molte richieste simultanee
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS App Runner gestisce la scalabilità orizzontale
Load Balancing
(AWS)
Event
Loop
Application
Container
Client code
(Voi)
Application code (Voi)
MicroVM (AWS)
Scaling (AWS)
AWS = Gestito da AWS
Voi = Vostra responsabilità
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Application Container
Concurrent Requests Limit
Overflow Queue
Event Loop
Envoy Proxy Load Balancer
AWS
Voi
Voi Application Container
Concurrent Requests Limit
Overflow Queue
Event Loop
429 Too Many
Requests
La vostra
applicazione è
protetta dagli
aumenti di traffico
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Active
Active
Cold Start Provisioned (Not Active) Stop
Provisioned (Not Active)
Il traffico termina,
entrambe le istanze
del contenitore
diventano inattive
1 x CPU + Memory 2 x CPU + Memory
Il traffico supera il limite di
concorrenza della prima istanza
del contenitore, quindi ne viene
avviata un'altra
1 x Memory
App Runner
arresta
un'istanza
inattiva
2 x Memory
Traffico nel tempo
Inizio traffico
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Fargate
Serverless containers, but you
manage scaling and concurrency
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Fargate fornisce microVM on demand
Event
Loop
Application
Container
Application code (Voi)
MicroVM (AWS)
Capacità computazionale (AWS)
Le patch per gli host e
l'infrastruttura sottostanti
sono gestite da AWS.
Le patch al codice, al runtime o
alle librerie nel viostro container
sono gestite da voi.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Gestisci il bilanciamento del carico e l'ingresso
Load Balancing
(Voi)
Event
Loop
Application
Container
Client code
(Voi)
Application code (Voi)
MicroVM (AWS)
AWS = Gestito da AWS
Voi = Vostra responsabilità
Event
Loop
Application
Container
Application code (Voi)
MicroVM (AWS)
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Scalabilità decisa da voi
Event
Loop
Application
Container
Application code (Voi)
MicroVM (AWS)
Event
Loop
Application
Container
Application code (Voi)
MicroVM (AWS)
Underlying compute capacity (AWS)
La capacità di calcolo sottostante
viene fornita da AWS per garantire
che tu possa lanciare container su
richiesta
Devi decidere quanti containers ti
servono e come scalarli
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Task Running
Cold Start
Request
Request
Request
Request
Request
Stop
Request
AWS Fargate addebita i costi in base al tempo, non
all'attività
No requests
Costo per richiesta più basso quando il traffico simultaneo è elevato e il codice
è efficiente
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda AWS App Runner AWS Fargate
Isolamento per
richiesta
Isolamento a
livello di processo
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Stabilità della concorrenza
Intensità della concorrenza
AWS Lambda
AWS App Runner AWS Fargate
Quanto è prevedibile la vostra concorrenza?
Quanta concorrenza?
Serveless quale strumento?
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
GRAZIE!

More Related Content

Similar to AWS: gestire la scalabilità su larga scala

Viaggio attraverso il Cloud - Cos'è AWS?
Viaggio attraverso il Cloud - Cos'è AWS?Viaggio attraverso il Cloud - Cos'è AWS?
Viaggio attraverso il Cloud - Cos'è AWS?Amazon Web Services
 
Il Cloud Infrastrutturale
Il Cloud InfrastrutturaleIl Cloud Infrastrutturale
Il Cloud InfrastrutturaleMarco Lombardo
 
Federico Massi.it - Intro alle app mobile Cordova
Federico Massi.it - Intro alle app mobile CordovaFederico Massi.it - Intro alle app mobile Cordova
Federico Massi.it - Intro alle app mobile CordovaFederico Massi
 
Wasm and Blazor CDays keynote
Wasm and Blazor CDays keynoteWasm and Blazor CDays keynote
Wasm and Blazor CDays keynoteNicolò Carandini
 
Architetture a Microservizi (con Kubernetes)
Architetture a Microservizi (con Kubernetes)Architetture a Microservizi (con Kubernetes)
Architetture a Microservizi (con Kubernetes)Steve Maraspin
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
comm-09 Cloud Computing
comm-09 Cloud  Computingcomm-09 Cloud  Computing
comm-09 Cloud Computingmcolavit
 
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015Presentazione Aronis - Aruba @ VMUGIT UserCon 2015
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015VMUG IT
 
Introduction to Cloud Computing - ITS 2014 Edition
Introduction to Cloud Computing - ITS 2014 EditionIntroduction to Cloud Computing - ITS 2014 Edition
Introduction to Cloud Computing - ITS 2014 EditionMarco Parenzan
 
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmasterEcommerce HUB
 
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9Andrea Mauro
 
Distribuisci software migliori più velocemente con DevOps
Distribuisci software migliori più velocemente con DevOpsDistribuisci software migliori più velocemente con DevOps
Distribuisci software migliori più velocemente con DevOpsAmazon Web Services
 
Presentazione servizi "Cassiopea" - Infogest s.r.l.
Presentazione servizi "Cassiopea" - Infogest s.r.l.Presentazione servizi "Cassiopea" - Infogest s.r.l.
Presentazione servizi "Cassiopea" - Infogest s.r.l.infogest
 
WordPress Facilissimo: guida alla sicurezza
WordPress Facilissimo: guida alla sicurezzaWordPress Facilissimo: guida alla sicurezza
WordPress Facilissimo: guida alla sicurezzaFlavius-Florin Harabor
 
La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013Massimo Chirivì
 

Similar to AWS: gestire la scalabilità su larga scala (20)

Aws
AwsAws
Aws
 
Viaggio attraverso il Cloud - Cos'è AWS?
Viaggio attraverso il Cloud - Cos'è AWS?Viaggio attraverso il Cloud - Cos'è AWS?
Viaggio attraverso il Cloud - Cos'è AWS?
 
Il Cloud Infrastrutturale
Il Cloud InfrastrutturaleIl Cloud Infrastrutturale
Il Cloud Infrastrutturale
 
Federico Massi.it - Intro alle app mobile Cordova
Federico Massi.it - Intro alle app mobile CordovaFederico Massi.it - Intro alle app mobile Cordova
Federico Massi.it - Intro alle app mobile Cordova
 
Cloud in Action_6 giugno 2014
Cloud in Action_6 giugno 2014Cloud in Action_6 giugno 2014
Cloud in Action_6 giugno 2014
 
Wasm and Blazor CDays keynote
Wasm and Blazor CDays keynoteWasm and Blazor CDays keynote
Wasm and Blazor CDays keynote
 
Architetture a Microservizi (con Kubernetes)
Architetture a Microservizi (con Kubernetes)Architetture a Microservizi (con Kubernetes)
Architetture a Microservizi (con Kubernetes)
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
comm-09 Cloud Computing
comm-09 Cloud  Computingcomm-09 Cloud  Computing
comm-09 Cloud Computing
 
IBM Cloud Platform
IBM Cloud Platform IBM Cloud Platform
IBM Cloud Platform
 
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015Presentazione Aronis - Aruba @ VMUGIT UserCon 2015
Presentazione Aronis - Aruba @ VMUGIT UserCon 2015
 
Introduzione A Docker
Introduzione A DockerIntroduzione A Docker
Introduzione A Docker
 
Introduction to Cloud Computing - ITS 2014 Edition
Introduction to Cloud Computing - ITS 2014 EditionIntroduction to Cloud Computing - ITS 2014 Edition
Introduction to Cloud Computing - ITS 2014 Edition
 
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster
[eh2018 - Arena] Fabio Assenzio - Una posizione privilegiata per i webmaster
 
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9
Evento Veeam & Assyrus - 2 Novità di Veeam Backup & Replication v9
 
Distribuisci software migliori più velocemente con DevOps
Distribuisci software migliori più velocemente con DevOpsDistribuisci software migliori più velocemente con DevOps
Distribuisci software migliori più velocemente con DevOps
 
Presentazione servizi "Cassiopea" - Infogest s.r.l.
Presentazione servizi "Cassiopea" - Infogest s.r.l.Presentazione servizi "Cassiopea" - Infogest s.r.l.
Presentazione servizi "Cassiopea" - Infogest s.r.l.
 
WordPress Facilissimo: guida alla sicurezza
WordPress Facilissimo: guida alla sicurezzaWordPress Facilissimo: guida alla sicurezza
WordPress Facilissimo: guida alla sicurezza
 
La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013
 

More from Speck&Tech

What should 6G be? - 6G: bridging gaps, connecting futures
What should 6G be? - 6G: bridging gaps, connecting futuresWhat should 6G be? - 6G: bridging gaps, connecting futures
What should 6G be? - 6G: bridging gaps, connecting futuresSpeck&Tech
 
Creare il sangue artificiale: "buon sangue non mente"
Creare il sangue artificiale: "buon sangue non mente"Creare il sangue artificiale: "buon sangue non mente"
Creare il sangue artificiale: "buon sangue non mente"Speck&Tech
 
Praticamente... AWS - Amazon Web Services
Praticamente... AWS - Amazon Web ServicesPraticamente... AWS - Amazon Web Services
Praticamente... AWS - Amazon Web ServicesSpeck&Tech
 
Data Sense-making: navigating the world through the lens of information design
Data Sense-making: navigating the world through the lens of information designData Sense-making: navigating the world through the lens of information design
Data Sense-making: navigating the world through the lens of information designSpeck&Tech
 
Data Activism: data as rhetoric, data as power
Data Activism: data as rhetoric, data as powerData Activism: data as rhetoric, data as power
Data Activism: data as rhetoric, data as powerSpeck&Tech
 
Delve into the world of the human microbiome and metagenomics
Delve into the world of the human microbiome and metagenomicsDelve into the world of the human microbiome and metagenomics
Delve into the world of the human microbiome and metagenomicsSpeck&Tech
 
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...Speck&Tech
 
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...Monitorare una flotta di autobus: architettura di un progetto di acquisizione...
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...Speck&Tech
 
Why LLMs should be handled with care
Why LLMs should be handled with careWhy LLMs should be handled with care
Why LLMs should be handled with careSpeck&Tech
 
Building intelligent applications with Large Language Models
Building intelligent applications with Large Language ModelsBuilding intelligent applications with Large Language Models
Building intelligent applications with Large Language ModelsSpeck&Tech
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computersSpeck&Tech
 
Machine learning with quantum computers
Machine learning with quantum computersMachine learning with quantum computers
Machine learning with quantum computersSpeck&Tech
 
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUsGive your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUsSpeck&Tech
 
From leaf to orbit: exploring forests with technology
From leaf to orbit: exploring forests with technologyFrom leaf to orbit: exploring forests with technology
From leaf to orbit: exploring forests with technologySpeck&Tech
 
Innovating Wood
Innovating WoodInnovating Wood
Innovating WoodSpeck&Tech
 
Behind the scenes of our everyday Internet: the role of an IXP like MIX
Behind the scenes of our everyday Internet: the role of an IXP like MIXBehind the scenes of our everyday Internet: the role of an IXP like MIX
Behind the scenes of our everyday Internet: the role of an IXP like MIXSpeck&Tech
 
Architecting a 35 PB distributed parallel file system for science
Architecting a 35 PB distributed parallel file system for scienceArchitecting a 35 PB distributed parallel file system for science
Architecting a 35 PB distributed parallel file system for scienceSpeck&Tech
 
Truck planning: how to certify the right route
Truck planning: how to certify the right routeTruck planning: how to certify the right route
Truck planning: how to certify the right routeSpeck&Tech
 
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...Speck&Tech
 
AI and Space: finally, no more arguing with the GPS
AI and Space: finally, no more arguing with the GPSAI and Space: finally, no more arguing with the GPS
AI and Space: finally, no more arguing with the GPSSpeck&Tech
 

More from Speck&Tech (20)

What should 6G be? - 6G: bridging gaps, connecting futures
What should 6G be? - 6G: bridging gaps, connecting futuresWhat should 6G be? - 6G: bridging gaps, connecting futures
What should 6G be? - 6G: bridging gaps, connecting futures
 
Creare il sangue artificiale: "buon sangue non mente"
Creare il sangue artificiale: "buon sangue non mente"Creare il sangue artificiale: "buon sangue non mente"
Creare il sangue artificiale: "buon sangue non mente"
 
Praticamente... AWS - Amazon Web Services
Praticamente... AWS - Amazon Web ServicesPraticamente... AWS - Amazon Web Services
Praticamente... AWS - Amazon Web Services
 
Data Sense-making: navigating the world through the lens of information design
Data Sense-making: navigating the world through the lens of information designData Sense-making: navigating the world through the lens of information design
Data Sense-making: navigating the world through the lens of information design
 
Data Activism: data as rhetoric, data as power
Data Activism: data as rhetoric, data as powerData Activism: data as rhetoric, data as power
Data Activism: data as rhetoric, data as power
 
Delve into the world of the human microbiome and metagenomics
Delve into the world of the human microbiome and metagenomicsDelve into the world of the human microbiome and metagenomics
Delve into the world of the human microbiome and metagenomics
 
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...
Home4MeAi: un progetto sociale che utilizza dispositivi IoT per sfruttare le ...
 
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...Monitorare una flotta di autobus: architettura di un progetto di acquisizione...
Monitorare una flotta di autobus: architettura di un progetto di acquisizione...
 
Why LLMs should be handled with care
Why LLMs should be handled with careWhy LLMs should be handled with care
Why LLMs should be handled with care
 
Building intelligent applications with Large Language Models
Building intelligent applications with Large Language ModelsBuilding intelligent applications with Large Language Models
Building intelligent applications with Large Language Models
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computers
 
Machine learning with quantum computers
Machine learning with quantum computersMachine learning with quantum computers
Machine learning with quantum computers
 
Give your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUsGive your Web App superpowers by using GPUs
Give your Web App superpowers by using GPUs
 
From leaf to orbit: exploring forests with technology
From leaf to orbit: exploring forests with technologyFrom leaf to orbit: exploring forests with technology
From leaf to orbit: exploring forests with technology
 
Innovating Wood
Innovating WoodInnovating Wood
Innovating Wood
 
Behind the scenes of our everyday Internet: the role of an IXP like MIX
Behind the scenes of our everyday Internet: the role of an IXP like MIXBehind the scenes of our everyday Internet: the role of an IXP like MIX
Behind the scenes of our everyday Internet: the role of an IXP like MIX
 
Architecting a 35 PB distributed parallel file system for science
Architecting a 35 PB distributed parallel file system for scienceArchitecting a 35 PB distributed parallel file system for science
Architecting a 35 PB distributed parallel file system for science
 
Truck planning: how to certify the right route
Truck planning: how to certify the right routeTruck planning: how to certify the right route
Truck planning: how to certify the right route
 
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...
Break it up! 5G, cruise control, autonomous vehicle cooperation, and bending ...
 
AI and Space: finally, no more arguing with the GPS
AI and Space: finally, no more arguing with the GPSAI and Space: finally, no more arguing with the GPS
AI and Space: finally, no more arguing with the GPS
 

AWS: gestire la scalabilità su larga scala

  • 1. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Andrea Catalano Solution Architect Amazon Web Services Gestire la scalabilità su larga scala 26-02-2024
  • 2.
  • 3. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cos’è la concorrenza ? Perché dovrei preoccuparmi della concorrenza?
  • 4. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Commodore 64 Nessuna concorrenza! Se volevi eseguire un programma diverso dovevi spegnere il computer, inserire un nuovo disco e riaccenderlo.
  • 5. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cooperative multitasking Il programma in primo piano è responsabile del controllo periodico per vedere se un altro programma richiede CPU. Facoltativamente può cedere ai programmi in background
  • 6. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Preemptive multitasking Il sistema operativo può sospendere in modo proattivo un programma e pianificare quale programma dovrà ottenere successivamente un intervallo di tempo della CPU.
  • 7. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Multicore processors Più programmi vengono effettivamente eseguiti contemporaneamente su core diversi dello stesso processore.
  • 8. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Client/server architecture I programmi comunicano tramite Internet con cluster di server in cui il lavoro viene svolto su molti computer multicore
  • 9. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. La concorrenza continua ad aumentare in modo esponenziale man mano che la tecnologia migliora
  • 10. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. La storiaa delle tecnologie infrastrutturali di base Hardware Hardware Hardware Operating System Operating System Operating System Hypervisor Container Runtime App App App Virtual Machine Operating System bin / Library App App Virtual Machine Operating System bin / Library App App App bin / Library Container App bin / Library Container App bin / Library Container App
  • 11. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Come posso creare un'applicazione in grado di gestire la concorrenza? Da zero utenti a milioni
  • 12. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Un solo container è semplice…. Container Runtime Host OS
  • 13. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Ho un limite al numero massimo di containers in un Host… Container Runtime Host OS ?
  • 14. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Complessità nella gestione della scalabilità Container Runtime Host OS Container Runtime Host OS Container Runtime Host OS …
  • 15. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Come Sviluppatore software hai bisogno degli strumenti giusti al momento giusto Il nuovo progetto greenfield necessita di un rapido sviluppo di nuove funzionalità Il software maturo necessita di manutenzione, supporto e affidabilità
  • 16. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Gli sviluppatori necessitano di un'elaborazione ottimizzata per una bassa concorrenza e di un'elaborazione ottimizzata per un'elevata concorrenza Low Concurrency Applications Sto ancora cercando il prodotto adatto al mercato. Hai bisogno di uno sviluppo facile, bassi costi operativi, bassi costi di base. High Concurrency Applications Adozione virale di grande successo. Hai bisogno di grandi quantità di elaborazione a tariffe sostenibili.
  • 17. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Le tecnologie containers serverless ti aiutano a iniziare in piccolo ma poi a espandersi quando necessario. AWS Lambda AWS App Runner AWS Fargate
  • 18. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda Funzioni as a Service conteinerizzate nel Cloud
  • 19. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda esegue la tua funzione nel cloud exports.handler = (event, context, callback) => { callback(null, "Hello world!"); } Handler function
  • 20. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Diversi modi di eseguire il codice: eventi exports.handler = (event, context, callback) => { callback(null, "Hello world!"); } Handler function AWS Lambda Esegui tramite le API di Lambda Esegui al verificarsi di un evento Amazon EventBridge
  • 21. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Diversi modi per eseguire il codice: richieste web Handler function Amazon API Gateway Application Load Balancer exports.handler = (event, context, callback) => { callback(null, "Hello world!"); } Lambda function URL
  • 22. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. exports.handler = (event, context, callback) => { callback(null, "Hello world!"); } Handler function Firecracker microVM exports.handler = (event, context, callback) => { callback(null, "Hello world!"); } Handler function Firecracker microVM Lambda crea più copie isolate del tuo codice inserito in contenitori in microVM fortemente isolate l'una dall'altra
  • 23. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Firecracker virtual machine monitor (VMM) • KVM-BASED VMM • OPEN SOURCE • PROGETTATO PER WORKLOADS SERVERLESS
  • 24. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Firecracker obbiettivi Sicurezza • Funzionalità del SO limitate • Accesso al Sistema operative guest non possibile • Singolo processo per ogni VM Efficiencienza • Boot Veloce • Basso consume di CPU e Memoria • Gestione tramite API
  • 25. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cold Start Invoke AWS Lambda è estremamente conveniente quando ci sono tempi morti tra una attività e l’altra da svolgere Init Nessun Costo Paghi per ms Invoke Nessun costo “Scala a 0” 1 sec Paghi per ms 500 ms Invoke Nessun costo “Scala a 0”
  • 26. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Function execution Cold Start Cold Start Cold Start Function Instance 1 Function Instance 2 Function Instance 3 1 request 2 concurrent requests 3 concurrent requests Un'istanza gestisce solo un'invocazione alla volta
  • 27. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cold Start Invoke Scalabilità gestita da AWS Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke x3 x2 x3 x3 x2 x2
  • 28. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cold Start Invoke Che cosa succede quando ci sono molte funzioni Lambda simultanee? Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke Cold Start Invoke Init Invoke Invoke Invoke
  • 29. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Concorrenza Cosa sta realmente accadendo durante una richiesta?
  • 30. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Handler Invoke (120ms) Validate Input Payload (1ms) Insert Row in Database, wait for response (10ms) Call to downstream service and wait for response (100ms) JSON serialize (8ms) Handle DB response (1ms) Molte applicazioni moderne sono piene di operazioni di input/output (I/O). Cosa sta effettivamente facendo la mia applicazione?
  • 31. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Handler Invoke (120ms) Validate Input Payload (1ms) Insert Row in Database, wait for response (10ms) Call to downstream service and wait for response (100ms) JSON serialize (8ms) Handle DB response (1ms) Running Waiting Running Waiting Running Le applicazioni che fanno I/O spesso trascorrono più tempo in attesa rispetto all'esecuzione del codice sulla CPU Cosa sta effettivamente facendo la mia applicazione?
  • 32. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Cold Start Init Maggiore è l'attività simultanea che ho, maggiori sono i millisecondi di attesa rispetto ai millisecondi di esecuzione delle istruzioni della CPU Cold Start Init Cold Start Init Cold Start Init Cold Start Init Cold Start Init Cold Start Init Quali alternative ci sono?
  • 33. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. I moderni framework applicativi consentono di gestire più richieste simultanee in un unico processo applicativo Event Loop Validate Input Payload (1ms) JSON serialization (8ms) Handle DB response (1ms) Ogni secondo ha 1000 ms di CPU Quando si fa I/O la CPU si dedica ad altro
  • 34. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Validate Input Payload (1ms) JSON serialization (8ms) Handle DB response (1ms) Invece di non fare nulla durante l'attesa, gestisce un altro evento Time Waiting for DB Validate Input Payload (1ms) Waiting for downstream service Waiting for DB Handle DB response (1ms) Waiting for downstream service JSON serialization (8ms) Un singolo processo applicativo può tenere occupato il core della CPU svolgendo altro lavoro (come rispondere a un'altra richiesta HTTP) mentre attende l'I/O Request 1 Request 2
  • 35. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. exports.handler = async function (event, context, callback) { // Validate the event let dbResponse = await db.insert(); // Wait for IO from DB // Handle DB response let downstreamResponse = await downstreamService.put(); // Serialize a JSON response } La parola chiave wait ritorna al ciclo degli eventi per consentire al processo di iniziare a gestire un'altra richiesta mentre attende il completamento dell'I/O. Node.js async/await
  • 36. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. exports.handler = async function (event, context, callback) { // Validate the event let dbResponse = await db.insert(); // Wait for IO from DB // Handle DB response let downstreamService = await downstreamService.put(); // Serialize a JSON response } La quantità di possibile concorrenza per una funzione dipende dal tempo della CPU consumato dalle sue istruzioni 10ms 100ms 1ms 1ms 8ms CPU time: 10ms 1000ms / 10ms = 100 invocazioni di funzioni/sec per singolo thread
  • 37. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Gestione della concorrenza: cosa succede se hai troppe richieste al secondo? Event Loop Code to run Code to run Code to run Code to run Code to run Code to run Code to run Code to run Code to run Code to run CPU 0% 100% Quando la CPU si satura, il tempo di risposta sale alle stelle 50% Response Time Memory Le attività iniziano a essere messe in coda
  • 38. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Soluzione: bilanciare il carico simultaneo su più copie del processo applicativo, ciascuna con il proprio ciclo di eventi Load Balancer Event Loop Event Loop I processi potrebbero essere sia in esecuzione sulla stessa macchina fisica che condividere core separati di una macchina multicore. Oppure potrebbero essere saltri nodi computazionali Application Container Application Container
  • 39. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS App Runner Ogni copia della tua applicazione gestisce molte richieste simultanee
  • 40. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS App Runner gestisce la scalabilità orizzontale Load Balancing (AWS) Event Loop Application Container Client code (Voi) Application code (Voi) MicroVM (AWS) Scaling (AWS) AWS = Gestito da AWS Voi = Vostra responsabilità
  • 41. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Application Container Concurrent Requests Limit Overflow Queue Event Loop Envoy Proxy Load Balancer AWS Voi Voi Application Container Concurrent Requests Limit Overflow Queue Event Loop 429 Too Many Requests La vostra applicazione è protetta dagli aumenti di traffico
  • 42. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Active Active Cold Start Provisioned (Not Active) Stop Provisioned (Not Active) Il traffico termina, entrambe le istanze del contenitore diventano inattive 1 x CPU + Memory 2 x CPU + Memory Il traffico supera il limite di concorrenza della prima istanza del contenitore, quindi ne viene avviata un'altra 1 x Memory App Runner arresta un'istanza inattiva 2 x Memory Traffico nel tempo Inizio traffico
  • 43. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Fargate Serverless containers, but you manage scaling and concurrency
  • 44. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Fargate fornisce microVM on demand Event Loop Application Container Application code (Voi) MicroVM (AWS) Capacità computazionale (AWS) Le patch per gli host e l'infrastruttura sottostanti sono gestite da AWS. Le patch al codice, al runtime o alle librerie nel viostro container sono gestite da voi.
  • 45. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Gestisci il bilanciamento del carico e l'ingresso Load Balancing (Voi) Event Loop Application Container Client code (Voi) Application code (Voi) MicroVM (AWS) AWS = Gestito da AWS Voi = Vostra responsabilità Event Loop Application Container Application code (Voi) MicroVM (AWS)
  • 46. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Scalabilità decisa da voi Event Loop Application Container Application code (Voi) MicroVM (AWS) Event Loop Application Container Application code (Voi) MicroVM (AWS) Underlying compute capacity (AWS) La capacità di calcolo sottostante viene fornita da AWS per garantire che tu possa lanciare container su richiesta Devi decidere quanti containers ti servono e come scalarli
  • 47. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Task Running Cold Start Request Request Request Request Request Stop Request AWS Fargate addebita i costi in base al tempo, non all'attività No requests Costo per richiesta più basso quando il traffico simultaneo è elevato e il codice è efficiente
  • 48. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda AWS App Runner AWS Fargate Isolamento per richiesta Isolamento a livello di processo
  • 49. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Stabilità della concorrenza Intensità della concorrenza AWS Lambda AWS App Runner AWS Fargate Quanto è prevedibile la vostra concorrenza? Quanta concorrenza? Serveless quale strumento?
  • 50. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. GRAZIE!