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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 Slide

  11. Congratulations!
    You advance to level 2

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  15. Congratulations!
    You advance to level 3

    View Slide

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

    View Slide

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

    View Slide

  18. Congratulations!
    You advance to level 4

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide