Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Abusing the Cloud for Fun and Profit

476 views

Published on

How to make successful use of the cloud for your software startup. Based on 4 years of using various cloud services. Includes advice, war stories, and best practices.

Presented at CoderFaire Atlanta 2013.

Published in: Technology, Business
  • Be the first to comment

Abusing the Cloud for Fun and Profit

  1. 1. 4/20/2013Abusing the Cloudfor Fun& ProfitCoderFaire Atlanta Alan Pinstein, Founder & CTO, TourBuzzhttp://www.tourbuzz.nethttp://www.showcaseIDX.com@apinsteinapinstein@mac.com
  2. 2. What is the cloud?
  3. 3. What is the cloud?
  4. 4. Utility Computing✤ Bare Metal✤ Dedicated Server✤ VM/Shared Hosting✤ SaaS / Software-as-a-Service✤ PaaS / Platform-as-a-Service?
  5. 5. Know your place in the Stack✤ Heroku vs EC2
  6. 6. Know your place in the Stack✤ Heroku vs EC2✤ Don’t try to devops your sysadmin if youaren’t a sysadmin
  7. 7. Know your place in the Stack✤ Heroku vs EC2✤ Don’t try to devops your sysadmin if youaren’t a sysadmin✤ Move down the stack only as soon asneeded
  8. 8. Monetary Considerationshttp://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  9. 9. Monetary Considerations✤ No up-front capital costshttp://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  10. 10. Monetary Considerations✤ No up-front capital costs✤ But, more expensive cost perunit-of-workhttp://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  11. 11. Monetary Considerations✤ No up-front capital costs✤ But, more expensive cost perunit-of-work✤ Matches Cost To Usage, notCapacityhttp://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  12. 12. Monetary Considerations✤ No up-front capital costs✤ But, more expensive cost perunit-of-work✤ Matches Cost To Usage, notCapacity✤ Lots of things are metered thatyou aren’t used to - “what getsmeasured gets managed”http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  13. 13. Monetary Considerations✤ No up-front capital costs✤ But, more expensive cost perunit-of-work✤ Matches Cost To Usage, notCapacity✤ Lots of things are metered thatyou aren’t used to - “what getsmeasured gets managed”✤ Potential lower TCOhttp://readwrite.com/2011/01/02/how-to-save-money-by-migrating
  14. 14. FreeTier FTW✤ Heroku: 1 free web workerhttps://www.heroku.com/pricing✤ Mandrill: SMTP SaaS up to 12k/mohttp://mandrill.com/pricing/✤ AWS: Free Tierhttp://aws.amazon.com/free/
  15. 15. You cannot do this on your own.
  16. 16. Performance Characteristics✤ You must understand your app’sperformance characteristics
  17. 17. Performance Characteristics✤ You must understand your app’sperformance characteristics✤ You must understand the performancecharacteristics of your cloud resource
  18. 18. Performance Characteristics✤ You must understand your app’sperformance characteristics✤ You must understand the performancecharacteristics of your cloud resource✤ If they don’t match, and you haveproblems...I TOLD YOU SO.
  19. 19. AWS/EBSVolatilityhttp://www.stratalux.com/2012/08/09/putting-amazon’s-provisioned-iops-to-the-test/
  20. 20. Opaque stack: performance tuning is hard✤ Used to dedicated hardware? Get ready for shared VMperformance volatility!
  21. 21. Opaque stack: performance tuning is hard✤ Used to dedicated hardware? Get ready for shared VMperformance volatility!✤ No idea what resource limits you’re given
  22. 22. Opaque stack: performance tuning is hard✤ Used to dedicated hardware? Get ready for shared VMperformance volatility!✤ No idea what resource limits you’re given✤ Often support is hard to get or cagy about how stuffworks
  23. 23. Opaque stack: performance tuning is hard✤ Used to dedicated hardware? Get ready for shared VMperformance volatility!✤ No idea what resource limits you’re given✤ Often support is hard to get or cagy about how stuffworks✤ Documentation is typically not very detailed
  24. 24. Opaque stack: performance tuning is hard✤ Used to dedicated hardware? Get ready for shared VMperformance volatility!✤ No idea what resource limits you’re given✤ Often support is hard to get or cagy about how stuffworks✤ Documentation is typically not very detailed✤ See: RapGenius v Heroku
  25. 25. ✤ September 18th:Dedicated (Xen) to AWS/EC2✤ December 10th:m1.xlarge > c1.medium✤ March 3rd:Offload image processing toautoscaling Heroku app
  26. 26. Should it AutoScale?
  27. 27. Should it AutoScale?✤ Volatile load (minutes/hours/days)
  28. 28. Should it AutoScale?✤ Volatile load (minutes/hours/days)✤ Volatile load (months/years)
  29. 29. Should it AutoScale?✤ Volatile load (minutes/hours/days)✤ Volatile load (months/years)✤ Scaling up vs Scaling down
  30. 30. Should it AutoScale?✤ Volatile load (minutes/hours/days)✤ Volatile load (months/years)✤ Scaling up vs Scaling down✤ Cost
  31. 31. Should it AutoScale?✤ Volatile load (minutes/hours/days)✤ Volatile load (months/years)✤ Scaling up vs Scaling down✤ Cost✤ Performance
  32. 32. Will it AutoScale?
  33. 33. Will it AutoScale?✤ Decouple independent processes
  34. 34. Will it AutoScale?✤ Decouple independent processes✤ Inter-app communication must be robustDesign for Failure, and Nothing will Fail.
  35. 35. Using the Cloud Successfully meansChanging the way you build apps
  36. 36. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.
  37. 37. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.
  38. 38. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.✤ DEVOPS is sustainable, but requires expertise.
  39. 39. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.✤ DEVOPS is sustainable, but requires expertise.✤ Programmable infrastructure
  40. 40. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.✤ DEVOPS is sustainable, but requires expertise.✤ Programmable infrastructure✤ Not just for the data center (vagrant)** go to Nic’s talk later today **
  41. 41. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.✤ DEVOPS is sustainable, but requires expertise.✤ Programmable infrastructure✤ Not just for the data center (vagrant)** go to Nic’s talk later today **✤ Automation is FREEDOM.
  42. 42. Using the Cloud Successfully meansChanging the way you build apps✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.✤ DEVOPS is sustainable, but requires expertise.✤ Programmable infrastructure✤ Not just for the data center (vagrant)** go to Nic’s talk later today **✤ Automation is FREEDOM.✤ From vendor lock-in, employee turnover,cost of starting from scratch
  43. 43. Tales from the cloud...
  44. 44. Arg.x1000
  45. 45. Arg.✤ CDN --> many reports of servingpartial content.x1000
  46. 46. Arg.✤ CDN --> many reports of servingpartial content.✤ Debugging real problems withvendors is hard.x1000
  47. 47. Arg.✤ CDN --> many reports of servingpartial content.✤ Debugging real problems withvendors is hard.✤ We had to revert.x1000
  48. 48. WTF.$ heroku ps:scale workers=20
  49. 49. WTF.$ heroku ps:scale workers=20
  50. 50. WTF.$ heroku ps:scale workers=20
  51. 51. WTF.$ heroku ps:scale workers=20$ heroku ps:scale workers=10
  52. 52. WTF.$ heroku ps:scale workers=20$ heroku ps:scale workers=10
  53. 53. WTF.$ heroku ps:scale workers=20$ heroku ps:scale workers=10
  54. 54. WTF.$ heroku ps:scale workers=20$ heroku ps:scale workers=10#fail
  55. 55. WTF!# mac laptop~ $ time cat /dev/random | head -c 10000K > /dev/nullreal 1.03suser 0.00ssys 1.01s
  56. 56. WTF!# heroku~ $ time cat /dev/random | head -c 100 > /dev/nullreal 0m8.430suser 0m0.020ssys 0m0.000s# mac laptop~ $ time cat /dev/random | head -c 10000K > /dev/nullreal 1.03suser 0.00ssys 1.01s
  57. 57. WTF!# heroku~ $ time cat /dev/random | head -c 100 > /dev/nullreal 0m8.430suser 0m0.020ssys 0m0.000s# mac laptop~ $ time cat /dev/random | head -c 10000K > /dev/nullreal 1.03suser 0.00ssys 1.01s✤ Heroku has very little entropy✤ Caused sleep & usleep to be “lazy”; use nanosleep instead.
  58. 58. WTF?!$ s3cmd put file.jpg s3://mybucket/file.jpg=> 200 OK$ curl http://mybucket/file.jpg=> 404 file not found$ sleep 5 && curl http://mybucket/file.jpg=> 200 OKEventually consistent....
  59. 59. Stuff that went right✤ Increased application performance✤ Sleep better at night✤ Save a lot of money✤ Clear path for scaling as we grow that should avoid hair-on-fireemergencies✤ FREEDOM: options and flexibility
  60. 60. Plan your trip in the cloud✤ “Design for failure, and nothing will fail”
  61. 61. Plan your trip in the cloud✤ “Design for failure, and nothing will fail”✤ Choose vendors carefully
  62. 62. Plan your trip in the cloud✤ “Design for failure, and nothing will fail”✤ Choose vendors carefully✤ Expectations - from your team and vendors
  63. 63. Plan your trip in the cloud✤ “Design for failure, and nothing will fail”✤ Choose vendors carefully✤ Expectations - from your team and vendors✤ Architecture
  64. 64. Plan your trip in the cloud✤ “Design for failure, and nothing will fail”✤ Choose vendors carefully✤ Expectations - from your team and vendors✤ Architecture✤ Contingency plans
  65. 65. We are hiring!
  66. 66. Q & AAlan Pinstein@apinsteinapinstein@mac.comhttp://www.tourbuzz.nethttp://www.showcaseIDX.com

×