Build a scalable architecture with Amazon's EC2 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Build a scalable architecture with Amazon's EC2

Description:

5 years blogging http://www.webdevref.com/blog. 3 years at Duo ... http://www.apsis.ch/pound/ Zeroflux.com articles. Risk it! 3 weeks with no change ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 20
Provided by: adamh1
Category:

less

Transcript and Presenter's Notes

Title: Build a scalable architecture with Amazon's EC2


1
Build a scalable architecture with Amazon's EC2
  • Adam Howitt
  • www.adamhowitt.com

2
About Adam Howitt
  • Over 7 years ColdFusion
  • 5 ½ years blogging http//www.webdevref.com/blog
  • 3 years at Duo Consulting in Chicago
  • Independent Consultant since 9/24/07
  • Google technologies, SEO, Load testing
  • CF, AJAX, JS, MySQL, Apache, SQL Server 2000-2005
  • http//www.adamhowitt.com
  • WalkJogRun on BlueDragon
  • 125,000 running routes worldwide
  • Approximately 3,000 visitors per day
  • http//www.walkjogrun.net

3
I Have Never
  • hosed a dev box and had to reinstall
  • hosed a prod box and spent all night fixing it
  • tried a new patch of a server version and had to
    roll it all back or reinstall
  • moved an app to linux without being able to test
    it
  • launched an app without load testing because we
    didn't have the time to configure a test machine
    and had it crash

4
How Would You Like To
  • Try CF8 or BD7?
  • New features
  • Test existing apps
  • Try Ruby on Rails, PHP, MySQL?
  • Test your application on Linux machines?
  • Cheaper OS, stability, hacker protection
  • Load test an application?
  • Solve your Slashdot / Wall Street Journal problem?

5
Introducing Amazon EC2
  • Spin up a basic server for about 2.50 per day /
    0.10 per hour
  • Install what you want
  • Use the server
  • Optionally save a snapshot
  • Shut it down

6
Basic Server Architecture
  • Linux based virtual machines
  • 1.7Ghz x86 processor
  • 1.75GB of RAM
  • 160GB of local disk
  • 250Mb/s of network bandwidth
  • 0.10 per hour per machine bandwidth

7
Other Available Architectures
  • Large Instance
  • 7.5 GB of memory,
  • 4 EC2 Compute Units (2 virtual cores with 2 EC2
    Compute Units each),
  • 850 GB of instance storage,
  • 64-bit platform
  • 0.40 per instance-hour consumed or partial hour
    consumed
  • Extra Large Instance
  • 15 GB of memory,
  • 8 EC2 Compute Units (4 virtual cores with 2 EC2
    Compute Units each),
  • 1690 GB of instance storage,
  • 64-bit platform
  • 0.80 per instance-hour consumed or partial hour
    consumed

8
Tools You Need
  • Get an Amazon EC2 account
  • http//www.amazonaws.com
  • Get Putty for Windows
  • http//www.chiark.greenend.org.uk/sgtatham/putty/
  • Get Amazon EC2UI for Firefox
  • http//developer.amazonwebservices.com/connect/ent
    ry.jspa?entryID609

9
Boot a Machine
  • Open EC2UI
  • Generate a .pem key
  • Boot an instance
  • amhimages/ubuntu704-apache.manifest.xml

10
Login
  • SSH Client (Putty)
  • Convert Key to .ppk with PuttyGen
  • Start Apache
  • /usr/local/apache2/bin/apachectl start
  • Test Apache
  • http//ec2-67-202-27-135.compute-1.amazonaws.com/i
    ndex.html

11
Install ColdFusion
  • cd downloads
  • chmod x coldfusion-80-lin.bin
  • ./coldfusion-80-lin.bin
  • /opt/coldfusion8/bin/coldfusion start
  • Test ColdFusion RDS
  • http//ec2-67-202-27-135.compute-1.amazonaws.com/i
    ndex.cfm
  • WinSCP http//winscp.net/
  • Logout and shutdown

12
Results for 4,000 visits/day site
  • Cost Day Month
  • Machine instances 2.40 72
  • Traffic in and out 0.28 8.40
  • Load testing HTML
  • Transactions                  23582
    hitsResponse time                  0.01 secs
  • Load testing CFM
  • Transactions                  19466
    hitsResponse time                  0.12 secs

13
The Benefits
  • Cheap 80.40 per machine
  • Scalable As many servers as you need
  • Beefy Upgrade to more virtual processors
  • Fault tolerant Failover machines
  • No hardware required
  • Experiment!

14
The Drawbacks
  • Non-persistent storage
  • Persistent Machine Images
  • Random IP Addresses

15
Tips for Living Without Persistence
  • Install everything you need to persist
  • Create boot scripts
  • Pull code from source control
  • S3 as a mounted drive
  • S3.cfc to save and retrieve assets
  • MySQL S3
  • Bundle and Boot
  • http//docs.amazonwebservices.com/AWSEC2/2007-08-2
    9/GettingStartedGuide/creating-an-image.html

16
Tips for Living with unstable IP
  • Use the public DNS name
  • Have offsite DNS / load balancing
  • Use a CNAME e.g. www.walkjogrun.net
  • Points to public DNS name
  • Avoid using no CNAME e.g. http//walkjogrun.net
  • Reduce domain TTL
  • Run pound to control images
  • http//www.apsis.ch/pound/
  • Zeroflux.com articles
  • Risk it! 3 weeks with no change

17
Dream Architecture
  • 2 x Replicated MySQL Servers
  • Large instances (4 cores, 7.5 gb RAM each)
  • Hourly backups
  • 2 x ColdFusion Servers
  • Application code in Source control
  • Small /Basic instances (1 core, 1.7 gb RAM each)
  • Dynamic assets at S3
  • Software Load Balancer
  • Small /Basic instances (1 core, 1.7gb RAM each)
  • Total Cost 11x80 880 per month!

18
Summary
  • Cheap
  • Scalable
  • Beefy
  • Fault tolerant
  • Experiment!

19
Questions?
  • Adam Howitt
  • adam_at_adamhowitt.com
  • http//www.adamhowitt.com
  • http//www.webdevref.com/blog
  • http//www.walkjogrun.net
Write a Comment
User Comments (0)
About PowerShow.com