Where To Deploy Rails On The Cheap

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

  • + guest2907b8 guest2907b8 9 months ago
    http://www.railsgeek.com/2009/1/29/amazon-aws-ec2-rails-a...
    As you may know, standard template “Amazon EC2 Rails-All-in-one-trial” by Amazon AWS is not good… yeap, it is. Let me show you how fix it by your hads :)

    Let’s start. We have a useful EC2 based on CentOS 5.2. Great enterprise linux for the Rails application. But Ruby 1.8.5 on aboard, it’s deeply out-of-date…

    http://rubyonrails.org/download We recommend Ruby 1.8.7 for use with Rails. Ruby 1.8.6, 1.8.5, 1.8.4 and 1.8.2 are still usable too, but version 1.8.3 is not.
Post a comment
Embed Video
Edit your comment Cancel

6 Favorites

Where To Deploy Rails On The Cheap - Presentation Transcript

  1.  
  2. What it takes
    • Linux
    • Mongrel
    • Lots of memory (~50 megs / Mongrel)
    • Good monitoring tools
      • Monit (http://tildeslash.com/monit/)
      • Munin ( http://munin.projects.linpro.no/ )
    • Capistrano
    • And MORE memory.
  3. Hosting options
    • Shared hosting
      • One Linux installation for many users
    • VPS (Virtual Private Server)
      • Many Linux installations on a single server (virtualized)
    • Amazon EC2
      • VPS on steroids!
    • Dedicated server
      • Your own unshared server; rented or owned
      • Not covered today
  4. Shared hosting
    • Pros:
      • Cheap
      • Maintenance taken care of by your provider
  5. Shared hosting
    • Cons:
      • You get what you pay for (not much!)
      • Slow, slow, slow
      • Not enough memory can be allocated to you
      • Often uses FastCGI or a single Mongrel (doesn’t scale)
      • No control (sometimes non-root SSH)
      • Support team doesn’t know Rails
      • You’ll outgrow that in no time (ask Marc-André)
    • I simply DON’T recommend shared hosting for Rails.
  6. Virtual Private Server
    • Great place to start!
    • ~$20/mo and up
    • Choose your provider carefully:
      • Make sure you have dedicated and guaranteed resources
      • Read plenty of reviews.
        • http://webhostingtalk.com
      • Don’t be cheap: it will backfire.
  7. VPS: Slicehost.com
    • My favorite VPS provider!
    • And damn cheap too!
    Plan RAM Storage Bandwidth Price/mo 256slice 256MB 10GB 100GB $20 512slice 512MB 20GB 200GB $38 1024slice 1024MB 40GB 400GB $70 2048slice 2048MB 80GB 800GB $140
  8. VPS: Slicehost.com
    • That money gets you “slices” of:
      • A Quad-core 64-bit servers (8+ghz) running Xen virtualization instances
      • RAID1 disk storage
      • Gigabit network backbone
    • Your own distro
    • Full root access
    • Between 7 and 24 users / server (vs 1000s for shared)
    • Awesome community and support (really)
  9. VPS: What kind of slice?
    • Minimum of 256 megs of RAM
      • Probably limited to 1 or 2 sites with that
    • No Apache! Go nginx and/or Swiftiply instead.
    • Keep memory usage at a minimum (ie: MySQL) and keep it for Mongrel.
    • Beware of VPS providers that don’t allow full root access.
  10. VPS: Slicehost.com Demo
    • http://manage.slicehost.com
  11. VPS: Pros and Cons
    • Pros:
      • Only pay for what you need
      • Enough resources to run Rails effectively
      • Easy upgrade/downgrade
      • VERY easy to get started
      • You control everything
      • Affordable (great bang for your buck)
      • GreatSlicehostwikiwith plenty of information
        • http://wiki.slicehost.com (who would’ve guessed?)
    • Cons:
      • You have to build your slice from scratch
      • Can be outgrown rapidly if your world-changing app really takes off
      • IO
      • Not cost effective when you become big
  12. Recommended VPS providers
    • Slicehost.com
      • my personal favorite
      • they are giving MoR folks VIP treatment!
    • Rimuhosting.com
      • heard great things
      • more expensive (for no apparent benefit)
  13. Amazon EC2
    • EC2 = Elastic Computing Cloud
    • Similar to a Slicehost VPS
      • Your own distro (even Windows!)
      • Full root access
      • Shared machines with Xen
    • But sometimes better
      • Auto-scaling
      • Hourly billing
      • Minimum 1.7 gigs of RAM!
  14. EC2: Pricing (CPU) One EC2 Compute Unit (CU) provides the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor. This is also the equivalent to an early-2006 1.7 GHz Xeon processor. Type RAM CPU Storage Platform $/hour $/mo Small Instance 1.7 GB 1 core * 1 CU 160 GB 32-bit $0.10 ~$73 Large Instance 7.5 GB 2 cores * 2 CU (4) 850 GB 64-bit $0.40 ~$293 Extra Large Instance 15 GB 4 cores * 2 CU (8) 1.69 TB 64-bit $0.80 ~$585
  15. EC2: Pricing (bandwidth)
    • Incoming data (download)
      • $0.10/GB
    • Outgoing data (upload to users)
      • $0.18/GB for first 10 TB / month
      • $0.16/GB for next 40 TB / month
      • $0.13/GB for over 50 TB / month
    • Transfer between EC2-EC2 or EC2-S3 is free
  16. EC2: The AMI
    • Stands for Amazon Machine Image
      • A Linux installation bundled up and ready to be booted
    • EC2 on Rails
      • ( http://ec2onrails.rubyforge.org/ )
      • Ubuntu Gutsy 7.10, Apache 2.2, Mongrel Cluster, MySQL 5
    • Rightscale’s Rails all-in-one
      • (http://info.rightscale.com/2007/9/20/rails-on-ec2-standard)
  17. EC2: What's to love?
    • Complete control
    • You pay hourly, not monthly (more on that later)
    • Almost instant instances
    • Lots of RAM per dollar
      • (remember, you need a lot of it!)
  18. EC2: What's to love? (cont'd)
    • Plenty of disk space
    • Easy integration with S3 (unlimited storage!)
    • API to control your instances
      • Scaling can be automated
    • Amazing firewall features
    • Many great “base” AMI available
  19. EC2: Change your mindset!
    • Rebuild/deploy new servers with no downtime
    • Test in a real-world scenario
    • Turn your staging servers into production servers
    • Auto-scale your app
    • …and the database too!
    • Backup like a champ (S3)
  20. EC2: Drawbacks
    • Very confusing at first
    • No static IP
    • No permanent storage
    • IO
    • Not for email
  21. EC2: Confusing, huh?
    • Yes, it’s confusing, but it’s not so bad!
    • Read, read, read
      • http://docs.amazonwebservices.com/AWSEC2/2007-03-01/GettingStartedGuide/
      • http://developer.amazonwebservices.com/ec2/forums
      • http://info.rightscale.com (blog section)
    • Understand the drawbacks, their implications and the solutions
    • Use the right tools
      • I recommend RightScale.com
    • Or just ask me!
  22. EC2: No static IP?
    • New instance, new IP
    • They don’t change that often anyways
      • If they do, you have another problem!
    • Give all your instances host names
    • Use low TTL = minimal downtime
    • Plenty of good DNS servers:
        • dnsmadeeasy.com, everydns.net, zoneedit.com
      • I realized that static IPs were not a necessity.
  23. EC2: Lack of persistent storage
    • Your instance dies, your data dies with it!
      • The 10/150 rule
    • Put growing data on /mnt
      • Symlinks
      • Logrotate to /mnt
    • Backup, backup, backup
      • S3
      • Replicate DB to remote location
      • Rebundling your instance is not a good solution
  24. EC2+RightScale Demo
    • http://rightscale.com
  25. Links

+ cmerciercmercier, 2 years ago

custom

2015 views, 6 favs, 0 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 2015
    • 2015 on SlideShare
    • 0 from embeds
  • Comments 1
  • Favorites 6
  • Downloads 0
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories