Paris hackers Meetup #12 - How to handle large audience

32
How to handle large audience © 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com Conseil |Infogérance | Hébergement

Transcript of Paris hackers Meetup #12 - How to handle large audience

How to handle large audience

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Conseil |Infogérance | Hébergement

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

#ManagedServices #Hosting

#DevOps #Agile

#Opensource #Web

References

Performances

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Record of January 2015

56 000 request / secondeon one customer

157Millions visits

28 millions visits

46 Millions visits

42 Millions visits

41 Millions visits

References

Performances

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

700 Mbps

250 K pps

20 K requests / second

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

The ChallengeProduce consistent quality

Whatever the audience

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Visitors Limited ressources

Efficiency

$

1. Continuous improvement

2. Caching

3. Technical zoom on Varnish

Efficiency

Continuous improvement

Definition of the KPI

PERFORMANCE MEASUREMENT & MONITORING

Business indicators

WEBSITECAPACITY

KPI

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

– Maximum response time

– Capacity of the website without UX degradation

– Capacity of the increase load (ex : 1000 connexions in 5 minutes)

– Response time on the increase load

– Tracking this KPI in short and long term

Continuous improvement

Detect the improvement leverages

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Application

Define referencesvalues with loadtests

0

Infrastructure

Continuous improvement

Some tools

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Mais aussi• Siege • Apache Bench

© 2015 - Oxalide - Conseil | Infogérance |

Hébergement - http://www.oxalide.com -

01.75.77.16.66 /

http://www.twitter.com/oxalide

Challenge

Effiency

TOWER DEFENSE

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Improve response time

Ressources protections

APC

Memcached

Query

Cache

10 %100 % 90 %

1st rampart 2nd rampart 3rd rampart 4th rampart

Curious ContributorsReader Trolls

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Benefits

Huge leverage

Improve the response timeImprove the UX

Multiply yourwebsite

capacity

Reduce time of processing

x 100 / Y

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

© 2015 - Oxalide - Conseil | Infogérance |

Hébergement - http://www.oxalide.com -

01.75.77.16.66 /

http://www.twitter.com/oxalide

Increase your website capacityScalable architecture

Increase your website capacity

Scalable architecture

Application

Front applicationFront Cache Application cache

Backend

Backoffice

Application

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

© 2015 - Oxalide - Conseil | Infogérance |

Hébergement - http://www.oxalide.com -

01.75.77.16.66 /

http://www.twitter.com/oxalide

Fine tuning

Oxalide Best Practices

Effiency mindset

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Server tuning

FROM LOW TO HIGH LEVEL

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Architecture

Hardware / Firmware

Kernel

Varnish

System

Mindset

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Il semble que la perfection soit atteinte non

quand il n'y a plus rien à ajouter, mais quand il

n'y a plus rien à retrancher.

Antoine de Saint Exupéry

«

«

It seems that perfection is attained

not when there is nothing more to add,

but when there is nothing more to remove.

antoine-st-exupery.eng.srt

Under the server : ressources protection

Network Architecture

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

NoTrack / RAW

VLAN / DMZ VLAN VLAN

Cache Front Back

Load Balancer

Firewall

L3/L4

Load BalancerFirewall

L7

Higher level

2 Varnish levels

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Apache

Apache

Level 1High Capacity

Level 2Intelligence

Tuning

BIOS

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Choose your hardware

Low latency

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

NIC 10 GbpsHigh FrequencyLow latency

On the server

Kernel Config

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

• Init congestion Window TCP (initcwnd)

• Network Interface Queuing / RPS

• Sysctl IP/TCP

• Syn Proxy

On server application

Varnish tuning

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Boost the ressources (FD, threads, buffers)

Monitoring your miss/hit rate very carefully

DevOps needed !

Dominos effect (www-0x)

Continuous improvement

Infrastructure KPI

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Memory usageCPU Load Consumption

bandwidth

Usage of the

middleware

Continuous improvement

Infrastructure KPI

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Monitor your life bar

Get ready for everything

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

Expected & Acceptable values

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

© 2015 - Oxalide - Conseil | Infogérance | Hébergement - 01.75.77.16.66 - http://www.oxalide.com

[email protected]