• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
High Availability Server Apps
 

High Availability Server Apps

on

  • 3,898 views

Talk we gave Benoit and I at the OSDC/OWF in Paris.

Talk we gave Benoit and I at the OSDC/OWF in Paris.

Statistics

Views

Total Views
3,898
Views on SlideShare
3,896
Embed Views
2

Actions

Likes
10
Downloads
57
Comments
0

1 Embed 2

http://www.techgig.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    High Availability Server Apps High Availability Server Apps Presentation Transcript

    • High Availability Server apps Tarek Ziade & Benoît ChesneauMonday, October 3, 2011 1
    • • The C10K problem • “Its time for web servers to handle ten thousand clients simultaneously, dont you think? After all, the web is a big place now. “ • http://www.kegel.com/c10k.htmlMonday, October 3, 2011 2
    • More & more hitsMonday, October 3, 2011 3
    • More & more mediaMonday, October 3, 2011 4
    • • 1993 - 1998 - CGI (and java applets...) • Apache & Prefork - simple • Multiprocessing - threads vs events A bit of historyMonday, October 3, 2011 5
    • Monday, October 3, 2011 6
    • • 1993 - 1998 - CGI (and java applets...) • Apache & Prefork - simple • Multiprocessing - threads vs events A bit of historyMonday, October 3, 2011 7
    • Clients Socket Port 80 Worker Application MinitelMonday, October 3, 2011 8
    • Waiting...Monday, October 3, 2011 9
    • MoarMonday, October 3, 2011 10
    • ForkMonday, October 3, 2011 11
    • ForkMonday, October 3, 2011 12
    • ForkMonday, October 3, 2011 13
    • ForkMonday, October 3, 2011 14
    • MultiprocessingMonday, October 3, 2011 15
    • multiprocessingMonday, October 3, 2011 16
    • • Threads or Events ? • Apache, Nginx, Node.js, .... (Erlang)Monday, October 3, 2011 17
    • • MPM Prefork $ ab -n 1000000 -c 250 http://127.0.0.1/ $ ps ax|grep apache2|wc -l 152 • MPM Worker (hybride prefork + threads par requêtes) $ ps ax|grep apache2|wc -l 5Monday, October 3, 2011 18
    • • 1 master process, several workers • Prefork • Accepts several connections per worker • EventsMonday, October 3, 2011 19
    • • 1 single thread • 1 event loop (READ/WRITE) • Context switching Event LoopMonday, October 3, 2011 20
    • • Nginx VS Apache • http://blog.webfaction.com/a-little-holiday- presentMonday, October 3, 2011 21
    • Nginx versus Apache (with the worker-MPM) for serving a small static file:Monday, October 3, 2011 22
    • Memory usageMonday, October 3, 2011 23
    • http://www.ostinelli.net/a-comparison-between-misultin-mochiweb-cowboy-nodejs-and-tornadoweb/ ChoiceMonday, October 3, 2011 24
    • • WSGI (PEP 3333) • Prefork - shared socket • async & sync workers (gevent, eventlet, tornado, ...) • Easy to use in Django, Paster, ...Monday, October 3, 2011 25
    • ForkMonday, October 3, 2011 26
    • Fork + asyncMonday, October 3, 2011 27
    • • HTTP Stream • Restartless upgrades ala Nginx • Simple CLI: $ gunicorn -w 3 test:app • greins (https://github.com/meebo/greins)Monday, October 3, 2011 28
    • Monday, October 3, 2011 29
    • Monday, October 3, 2011 30
    • asynchronous or synchronousMonday, October 3, 2011 31
    • • bandwidth-bound & CPU-bound apps • Fast operations required • Needs a way to hold incoming connections (cf nginx + gunicorn sync) synchronousMonday, October 3, 2011 32
    • • websocket, longpolling • apps with long, blocking calls • streaming • slow clients • slowloris & other DoS asynchronousMonday, October 3, 2011 33
    • gevent & eventlet • Network libraries • synchronous API • monkey patch • co-routines • Code is always running async gevent & eventletMonday, October 3, 2011 34
    • twisted • asynchronous library • Events & callbacks • Twisted server == single event loop twistedMonday, October 3, 2011 35
    • Monday, October 3, 2011 36
    • • message passing • greenlets • py.py --withmod-_stackless http://www.grant-olson.net/python/intro-to-stackless-python stacklessMonday, October 3, 2011 37
    • • ulimit is your friend • somaxcon • ... TuningMonday, October 3, 2011 38
    • Monday, October 3, 2011 39
    • Monday, October 3, 2011 40
    • Firefox SyncMonday, October 3, 2011 41
    • Monday, October 3, 2011 42
    • • 10 frontends web • +123 mysql (percona) • 6 Open Ldap servers (2 masters, 4 slaves) • ~1.5 M active users • ~4 M registered users • ~800 RPS for the storage • CPU: 20% !!! ETooMuchMonday, October 3, 2011 43
    • • silverlining (http://cloudsilverlining.org/) by @ianb • kraftwerk (http://kraftwerk-wsgi.org) DeployMonday, October 3, 2011 44
    • • libcloud (http://libcloud.apache.org/): deploy on the “clouds” • juju (https://juju.ubuntu.com/) : ubuntu cloud (openstack + ensemble or ec2) DeployMonday, October 3, 2011 45
    • • Apache Bench (ab) • httperf • Apache Jmeter • Grinder • Funkload BenchMonday, October 3, 2011 46
    • FunkloadMonday, October 3, 2011 47
    • FunkloadMonday, October 3, 2011 48
    • Thanks ! • @benoitc • @tarek_ziade Moar ???Monday, October 3, 2011 49