Osdc 2011 michael_neale

1,553 views

Published on

Error and exception handling examined - looking at how erlang works

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,553
On SlideShare
0
From Embeds
0
Number of Embeds
334
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Osdc 2011 michael_neale

    1. 1. @michaelnealewww.CloudBees.com
    2. 2. @michaelnealegithub.com/michaelnealecurrently: trying to make less reliable things morereliable.
    3. 3. Some things we use to get it done:- scala (back end apps)- ruby (chef, rails, proxymachine, lots)- java (jenkins and plugins)- erlang (“agents” and lots more..)
    4. 4. Exceptions. Errors.What The Hell Is That Process Doing?and how it relates to..
    5. 5. On Call PTSD
    6. 6. Exception handling is wrong...
    7. 7. But it seems harmless...
    8. 8. Erlang says no no no...
    9. 9. Question: a process on server not respondingAnswer:1) panic2) take time thinking about underlying cause3) bounce the bastard and pray **
    10. 10. FACT: Answer#3 will often work so well, youoften don’t really spend time to think aboutdoing #2**** FibreError?
    11. 11. Imagine a programming environment: - unlimited process spawning - concurrency someone else’s problem - don’t try to handle errors - let it fail
    12. 12. ErlangBuilt for stability, and not bothering me.Anything else is gravyI wasn’t an erlang programmer
    13. 13. Process isolation- it works so well- nothing shared- has worked so well for so long with OSes- in erlang - each ‘process’ is like a process !
    14. 14. nginx Example: My Host OS haproxy Erlang process supervisor ... p1 p999Each: own heap, garbage collector
    15. 15. Erlang is:- A vm based runtime (light !)- language with prolog heritage (!)- compiler- interpreter- debug tools - batteries included- OTP - an application (server?) platform
    16. 16. Erlang is:- Not OO- no shared state **- state kept in “term stores” - mini DBs- processes easy to hot swap- Quasi functional programming (immutable variables, higher order)- distributed (if you want)
    17. 17. OTP- Open Telecommunications Platform- not about telco !- network stacks/apis, supervisor trees- toolkit for reliable servers (middleware)- behaviours
    18. 18. State in erlangfiles Host + real kernel Erlang processDETS supervisor ...ETS p1 p999 Send Receive
    19. 19. Erlang processes, like OS processes- Can only send messages to each other- Can fail independently- Can be restarted, safely, independently- Easy to write apps for - Old School !
    20. 20. Better- Tiny overhead (can have 100K+ of them !)- perfect for supervisory agents- distribute: run on every box if you like !- lots of processes == lots of concurrency- if you need to block, block !
    21. 21. Have used erlang for- Supervisory agents - controllers- Autoscaling services (realtime data analytics)- misc backend systems- fun command line tools !- is “lite” VM (startup, footprint)
    22. 22. Supervisor configuration- Declare rules for restarting, failure- So you don’t have to intervene !- can hot reload changes- can have dependent processes
    23. 23. Restart just busted process
    24. 24. Program 1 (module with behaviour)
    25. 25. Program 2 (module with behaviour)
    26. 26. Anyway, that is why we use Erlang, also...- RabbitMQ- Riak (nosql DB)- CouchDB (nosql DB)- Probably your telephone exchange
    27. 27. Alternative approaches:- Use “native” with daemontools/monit etc- Akka (Scala) has similar supervisor- library for your favourite language- ephemeral “state less” apps- Write software without bugs- Or just restart everything 400 times a day
    28. 28. What is not awesome:- OTP boiler plate- VM not as fast as some- No one seems to like the language- tools? IDEs?
    29. 29. Thank you

    ×