Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adventurer in the Land of Production Environment

Adventurer in the Land of Production Environment

If your background is software development, the first time you need to run code on a server and serve it to the world can be pretty intimidating. Just as if you suddenly found yourself in a strange land, full of magic and composed of dungeons…

Maciej Pasternacki

May 17, 2013
Tweet

More Decks by Maciej Pasternacki

Other Decks in Technology

Transcript

  1. Adventurer in the Land
    of Production Environment
    Maciej Pasternacki
    DjangoCon 2013 Circus Edition
    3ofcoins
    @mpasternacki

    View full-size slide

  2. e weather is mild and comfortable.
    A slight wind is blowing. A server.
    $ _

    View full-size slide

  3. e weather is mild and comfortable.
    A slight wind is blowing. A server.
    $ sudo su -
    # _

    View full-size slide

  4. e weather is mild and comfortable.
    A slight wind is blowing. A server.
    $ sudo su -
    # screen
    # _

    View full-size slide

  5. e weather is mild and comfortable.
    A slight wind is blowing. A server.
    $ sudo su -
    # screen
    # ./manage.py runserver 80
    _

    View full-size slide

  6. e weather is mild and comfortable.
    A slight wind is blowing. A server.
    $ sudo su -
    # screen
    # ./manage.py runserver 80
    [detached]
    $ _

    View full-size slide

  7. Congratulations!
    You advance to level 1.
    $ sudo su -
    # screen
    # ./manage.py runserver 80
    [detached]
    $ _

    View full-size slide

  8. Quest: is it up?
    – http://pingdom.com/
    – http://host-tracker.com/
    – http://monitor.us/
    – …lots of alternatives. Use whichever.

    View full-size slide

  9. Examine inventory
    # ./manage.py runserver 80
    Runs as root: -33 Strength
    Single-threaded: -10 Dexterity
    Static files served by Django: -15 Speed

    View full-size slide

  10. Use XP to upgrade:
    gunicorn
    fcgi
    uwsgi
    mod_wsgi
    nginx
    lighttpd
    apache
    +5 Mana +8 Dexterity
    http://raingna.deviantart.com/art/FiM-style-Django-pony-318540512
    Static
    les
    Not root,
    high port #

    View full-size slide

  11. Congratulations!
    You advance to level 2

    View full-size slide

  12. Put on some armor
    – Isolate your code in virtualenv
    – Get Immune to Surprise Upgrades:
    pip freeze or vendor libraries

    View full-size slide

  13. Amulet of Life Saving
    – runit
    – supervisord
    – daemontools
    – upstart
    – systemd
    – monit
    – god
    – bluepill

    View full-size slide

  14. Stun Immunity
    – runit
    – cron @reboot
    – upstart
    – init script
    – systemd

    View full-size slide

  15. Congratulations!
    You advance to level 3

    View full-size slide

  16. Teleport Control
    –Fabric
    –Capistrano
    –Mina
    –Git-deploy

    View full-size slide

  17. Acquire skill: Alchemy
    – Plain Old Shell ScrollsScripts
    –     devstructure/blueprint
    – Chef, Puppet
    – Ansible

    View full-size slide

  18. Congratulations!
    You advance to level 4

    View full-size slide

  19. e Final Boss
    http://en.wikipedia.org/wiki/Slashdot_effect

    View full-size slide

  20. e Final Boss: Gear Up!
    – Chef/Puppet
    – MCollective/Salt
    – Rundeck
    – Nagios Icinga
    – Graphite
    – Statsd
    – Logstash

    View full-size slide

  21. Beyond the map
    – High Availability
    – Resiliency
    – Autoscaling
    – Self-healing
    Need a guide, sir?
    http://3ofcoins.net/
    [email protected]

    View full-size slide