high performance web applications @ minted - slides

35
High Performance Web Applications June 21st, 2017

Upload: kendall-chuang

Post on 22-Jan-2018

52 views

Category:

Software


1 download

TRANSCRIPT

Page 1: High performance Web Applications @ Minted - Slides

High Performance Web ApplicationsJune 21st, 2017

Page 2: High performance Web Applications @ Minted - Slides
Page 3: High performance Web Applications @ Minted - Slides
Page 4: High performance Web Applications @ Minted - Slides
Page 5: High performance Web Applications @ Minted - Slides
Page 6: High performance Web Applications @ Minted - Slides
Page 7: High performance Web Applications @ Minted - Slides

latency

Page 8: High performance Web Applications @ Minted - Slides

latency

task task task task taskt

throughput

Page 9: High performance Web Applications @ Minted - Slides

t

task task task task task

ad-infinitum?

Page 10: High performance Web Applications @ Minted - Slides
Page 11: High performance Web Applications @ Minted - Slides

task task task task taskt

throughput

task task task task task

task task task task task

Page 12: High performance Web Applications @ Minted - Slides

throughput = concurrency ÷ latency

Page 13: High performance Web Applications @ Minted - Slides

time

request rate

capacity

demand

Page 14: High performance Web Applications @ Minted - Slides

time

request rate

queueing

demand

Page 15: High performance Web Applications @ Minted - Slides

time

request rate

queue size

Page 16: High performance Web Applications @ Minted - Slides

time

request rate b

usy workers

Page 17: High performance Web Applications @ Minted - Slides

time

request rate

latency

Page 18: High performance Web Applications @ Minted - Slides

time

request rate

queue size

slow

errorsslowing

Page 19: High performance Web Applications @ Minted - Slides

throughput = concurrency ÷ latency

Page 20: High performance Web Applications @ Minted - Slides

How do we decrease latency?

Page 21: High performance Web Applications @ Minted - Slides

How do we decrease latency?Do less things

Page 22: High performance Web Applications @ Minted - Slides

Do less things

1. Do it later

Page 23: High performance Web Applications @ Minted - Slides

Do less things

1. Do it later (with celery)

Page 24: High performance Web Applications @ Minted - Slides

Do less things

1. Do it later (with celery)

2. Do it once

Page 25: High performance Web Applications @ Minted - Slides

Do less things

1. Do it later (with celery)

2. Do it once (with caching)

Page 26: High performance Web Applications @ Minted - Slides

How do we increase concurrency?

Page 27: High performance Web Applications @ Minted - Slides

How do we increase concurrency?minimize dependencies and scale

Page 28: High performance Web Applications @ Minted - Slides

Determine exactly what you need to complete your tasks.

Page 29: High performance Web Applications @ Minted - Slides

multithreading vs multiprocessing

Page 30: High performance Web Applications @ Minted - Slides

process

multithreading vs multiprocessing

t1

memory

t2 t3 t4 t5

master thread

Page 31: High performance Web Applications @ Minted - Slides

multithreading vs multiprocessing

t1

m1

p1

t1

m1

p1

t1

m1

p1

t1

m1

p1

t1

m1

p1

master process

memory

master thread

Page 32: High performance Web Applications @ Minted - Slides

app-worker

process mastering

thread

memory

master process

memory

master process

app-worker

thread

memory

app-worker

thread

memory

app-worker

thread

memory

network socket

Inter-process communication

Page 33: High performance Web Applications @ Minted - Slides

container

app-worker

containerization

thread

memory

network socket

Inter-process communication

container

app-worker

thread

memory

container

app-worker

thread

memory

network socket network socket

Page 34: High performance Web Applications @ Minted - Slides

throughput = concurrency ÷ latency

Page 35: High performance Web Applications @ Minted - Slides

let’s go code something