high performance web applications @ minted - slides

Post on 22-Jan-2018

52 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

High Performance Web ApplicationsJune 21st, 2017

latency

latency

task task task task taskt

throughput

t

task task task task task

ad-infinitum?

task task task task taskt

throughput

task task task task task

task task task task task

throughput = concurrency ÷ latency

time

request rate

capacity

demand

time

request rate

queueing

demand

time

request rate

queue size

time

request rate b

usy workers

time

request rate

latency

time

request rate

queue size

slow

errorsslowing

throughput = concurrency ÷ latency

How do we decrease latency?

How do we decrease latency?Do less things

Do less things

1. Do it later

Do less things

1. Do it later (with celery)

Do less things

1. Do it later (with celery)

2. Do it once

Do less things

1. Do it later (with celery)

2. Do it once (with caching)

How do we increase concurrency?

How do we increase concurrency?minimize dependencies and scale

Determine exactly what you need to complete your tasks.

multithreading vs multiprocessing

process

multithreading vs multiprocessing

t1

memory

t2 t3 t4 t5

master thread

multithreading vs multiprocessing

t1

m1

p1

t1

m1

p1

t1

m1

p1

t1

m1

p1

t1

m1

p1

master process

memory

master thread

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

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

throughput = concurrency ÷ latency

let’s go code something

top related