Download - Abusing the Cloud for Fun and Profit
![Page 1: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/1.jpg)
4/20/2013
Abusing the Cloudfor Fun & Profit
CoderFaire Atlanta Alan Pinstein, Founder & CTO, TourBuzz
http://www.tourbuzz.nethttp://www.showcaseIDX.com
![Page 2: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/2.jpg)
What is the cloud?
![Page 3: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/3.jpg)
What is the cloud?
![Page 4: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/4.jpg)
Utility Computing
✤ Bare Metal
✤ Dedicated Server
✤ VM/Shared Hosting
✤ SaaS / Software-as-a-Service
✤ PaaS / Platform-as-a-Service
?
![Page 5: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/5.jpg)
Know your place in the Stack
✤ Heroku vs EC2
![Page 6: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/6.jpg)
Know your place in the Stack
✤ Heroku vs EC2
✤ Don’t try to devops your sysadmin if you aren’t a sysadmin
![Page 7: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/7.jpg)
Know your place in the Stack
✤ Heroku vs EC2
✤ Don’t try to devops your sysadmin if you aren’t a sysadmin
✤ Move down the stack only as soon as needed
![Page 8: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/8.jpg)
Monetary Considerations
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 9: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/9.jpg)
Monetary Considerations
✤ No up-front capital costs
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 10: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/10.jpg)
Monetary Considerations
✤ No up-front capital costs
✤ But, more expensive cost per unit-of-work
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 11: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/11.jpg)
Monetary Considerations
✤ No up-front capital costs
✤ But, more expensive cost per unit-of-work
✤ Matches Cost To Usage, not Capacity
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 12: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/12.jpg)
Monetary Considerations
✤ No up-front capital costs
✤ But, more expensive cost per unit-of-work
✤ Matches Cost To Usage, not Capacity
✤ Lots of things are metered that you aren’t used to - “what gets measured gets managed”
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 13: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/13.jpg)
Monetary Considerations
✤ No up-front capital costs
✤ But, more expensive cost per unit-of-work
✤ Matches Cost To Usage, not Capacity
✤ Lots of things are metered that you aren’t used to - “what gets measured gets managed”
✤ Potential lower TCO
http://readwrite.com/2011/01/02/how-to-save-money-by-migrating
![Page 14: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/14.jpg)
Free Tier FTW
✤ Heroku: 1 free web workerhttps://www.heroku.com/pricing
✤ Mandrill: SMTP SaaS up to 12k/mo http://mandrill.com/pricing/
✤ AWS: Free Tierhttp://aws.amazon.com/free/
![Page 15: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/15.jpg)
You cannot do this on your own.
![Page 16: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/16.jpg)
Performance Characteristics
✤ You must understand your app’s performance characteristics
![Page 17: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/17.jpg)
Performance Characteristics
✤ You must understand your app’s performance characteristics
✤ You must understand the performance characteristics of your cloud resource
![Page 18: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/18.jpg)
Performance Characteristics
✤ You must understand your app’s performance characteristics
✤ You must understand the performance characteristics of your cloud resource
✤ If they don’t match, and you have problems...
I TOLD YOU SO.
![Page 19: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/19.jpg)
AWS/EBS Volatility
http://www.stratalux.com/2012/08/09/putting-amazon’s-provisioned-iops-to-the-test/
![Page 20: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/20.jpg)
Opaque stack: performance tuning is hard
✤ Used to dedicated hardware? Get ready for shared VM performance volatility!
![Page 21: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/21.jpg)
Opaque stack: performance tuning is hard
✤ Used to dedicated hardware? Get ready for shared VM performance volatility!
✤ No idea what resource limits you’re given
![Page 22: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/22.jpg)
Opaque stack: performance tuning is hard
✤ Used to dedicated hardware? Get ready for shared VM performance volatility!
✤ No idea what resource limits you’re given
✤ Often support is hard to get or cagy about how stuff works
![Page 23: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/23.jpg)
Opaque stack: performance tuning is hard
✤ Used to dedicated hardware? Get ready for shared VM performance volatility!
✤ No idea what resource limits you’re given
✤ Often support is hard to get or cagy about how stuff works
✤ Documentation is typically not very detailed
![Page 24: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/24.jpg)
Opaque stack: performance tuning is hard
✤ Used to dedicated hardware? Get ready for shared VM performance volatility!
✤ No idea what resource limits you’re given
✤ Often support is hard to get or cagy about how stuff works
✤ Documentation is typically not very detailed
✤ See: RapGenius v Heroku
![Page 25: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/25.jpg)
✤ September 18th:Dedicated (Xen) to AWS/EC2
✤ December 10th: m1.xlarge > c1.medium
✤ March 3rd:Offload image processing to autoscaling Heroku app
![Page 26: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/26.jpg)
Should it AutoScale?
![Page 27: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/27.jpg)
Should it AutoScale?
✤ Volatile load (minutes/hours/days)
![Page 28: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/28.jpg)
Should it AutoScale?
✤ Volatile load (minutes/hours/days)
✤ Volatile load (months/years)
![Page 29: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/29.jpg)
Should it AutoScale?
✤ Volatile load (minutes/hours/days)
✤ Volatile load (months/years)
✤ Scaling up vs Scaling down
![Page 30: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/30.jpg)
Should it AutoScale?
✤ Volatile load (minutes/hours/days)
✤ Volatile load (months/years)
✤ Scaling up vs Scaling down
✤ Cost
![Page 31: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/31.jpg)
Should it AutoScale?
✤ Volatile load (minutes/hours/days)
✤ Volatile load (months/years)
✤ Scaling up vs Scaling down
✤ Cost
✤ Performance
![Page 32: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/32.jpg)
Will it AutoScale?
![Page 33: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/33.jpg)
Will it AutoScale?
✤ Decouple independent processes
![Page 34: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/34.jpg)
Will it AutoScale?
✤ Decouple independent processes
✤ Inter-app communication must be robust
Design for Failure, and Nothing will Fail.
![Page 35: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/35.jpg)
Using the Cloud Successfully means Changing the way you build apps
![Page 36: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/36.jpg)
Using the Cloud Successfully means Changing the way you build apps
✤ Automate everything. You will start from scratch frequently.
![Page 37: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/37.jpg)
Using the Cloud Successfully means Changing the way you build apps
✤ Automate everything. You will start from scratch frequently.✤ DBA, sysadmin. Implies people doing manual work.
![Page 38: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/38.jpg)
Using the Cloud Successfully means Changing 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.
![Page 39: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/39.jpg)
Using the Cloud Successfully means Changing 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
![Page 40: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/40.jpg)
Using the Cloud Successfully means Changing 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 **
![Page 41: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/41.jpg)
Using the Cloud Successfully means Changing 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.
![Page 42: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/42.jpg)
Using the Cloud Successfully means Changing 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
![Page 43: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/43.jpg)
Tales from the cloud...
![Page 44: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/44.jpg)
Arg.
x1000
![Page 45: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/45.jpg)
Arg.
✤ CDN --> many reports of serving partial content.
x1000
![Page 46: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/46.jpg)
Arg.
✤ CDN --> many reports of serving partial content.
✤ Debugging real problems with vendors is hard.
x1000
![Page 47: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/47.jpg)
Arg.
✤ CDN --> many reports of serving partial content.
✤ Debugging real problems with vendors is hard.
✤ We had to revert.
x1000
![Page 48: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/48.jpg)
WTF.
$ heroku ps:scale workers=20
![Page 49: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/49.jpg)
WTF.
$ heroku ps:scale workers=20
![Page 50: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/50.jpg)
WTF.
$ heroku ps:scale workers=20
![Page 51: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/51.jpg)
WTF.
$ heroku ps:scale workers=20
$ heroku ps:scale workers=10
![Page 52: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/52.jpg)
WTF.
$ heroku ps:scale workers=20
$ heroku ps:scale workers=10
![Page 53: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/53.jpg)
WTF.
$ heroku ps:scale workers=20
$ heroku ps:scale workers=10
![Page 54: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/54.jpg)
WTF.
$ heroku ps:scale workers=20
$ heroku ps:scale workers=10
#fail
![Page 55: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/55.jpg)
WTF!
# mac laptop~ $ time cat /dev/random | head -c 10000K > /dev/nullreal 1.03suser 0.00ssys 1.01s
![Page 56: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/56.jpg)
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
![Page 57: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/57.jpg)
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.
![Page 58: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/58.jpg)
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 OK
Eventually consistent....
![Page 59: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/59.jpg)
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-fire emergencies
✤ FREEDOM: options and flexibility
![Page 60: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/60.jpg)
Plan your trip in the cloud
✤ “Design for failure, and nothing will fail”
![Page 61: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/61.jpg)
Plan your trip in the cloud
✤ “Design for failure, and nothing will fail”
✤ Choose vendors carefully
![Page 62: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/62.jpg)
Plan your trip in the cloud
✤ “Design for failure, and nothing will fail”
✤ Choose vendors carefully
✤ Expectations - from your team and vendors
![Page 63: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/63.jpg)
Plan your trip in the cloud
✤ “Design for failure, and nothing will fail”
✤ Choose vendors carefully
✤ Expectations - from your team and vendors
✤ Architecture
![Page 64: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/64.jpg)
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
![Page 65: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/65.jpg)
We are hiring!
![Page 66: Abusing the Cloud for Fun and Profit](https://reader033.vdocuments.us/reader033/viewer/2022052905/5586dc93d8b42a04178b45b1/html5/thumbnails/66.jpg)
Q & AAlan Pinstein
http://www.tourbuzz.nethttp://www.showcaseIDX.com