Presentation is loading. Please wait.

Presentation is loading. Please wait.

What it takes Linux Mongrel Lots of memory (~50 megs / Mongrel) Good monitoring tools Monit ( Munin (

Similar presentations

Presentation on theme: "What it takes Linux Mongrel Lots of memory (~50 megs / Mongrel) Good monitoring tools Monit ( Munin ("— Presentation transcript:


2 What it takes Linux Mongrel Lots of memory (~50 megs / Mongrel) Good monitoring tools Monit ( Munin ( 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 (doesnt scale) No control (sometimes non-root SSH) Support team doesnt know Rails Youll outgrow that in no time (ask Marc-André) I simply DONT 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. Dont be cheap: it will backfire.

7 VPS: My favorite VPS provider! And damn cheap too! PlanRAMStorageBandwidthPrice/mo 256slice256MB10GB100GB$20 512slice512MB20GB200GB$ slice1024MB40GB400GB$ slice2048MB80GB800GB$140

8 VPS: 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 dont allow full root access.

10 VPS: Demo

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 (who wouldve 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 my personal favorite they are giving MoR folks VIP treatment! 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) TypeRAMCPUStoragePlatform$/hour$/mo Small Instance 1.7 GB1 core * 1 CU160 GB32-bit$0.10~$73 Large Instance 7.5 GB2 cores * 2 CU (4)850 GB64-bit$0.40~$293 Extra Large Instance 15 GB4 cores * 2 CU (8)1.69 TB64-bit$0.80~$585 One EC2 Compute Unit (CU) provides the equivalent CPU capacity of a GHz 2007 Opteron or 2007 Xeon processor. This is also the equivalent to an early GHz Xeon processor.

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 ( Ubuntu Gutsy 7.10, Apache 2.2, Mongrel Cluster, MySQL 5 Rightscales Rails all-in-one (

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

21 EC2: Confusing, huh? Yes, its confusing, but its not so bad! Read, read, read 01/GettingStartedGuide/ 01/GettingStartedGuide/ (blog section) Understand the drawbacks, their implications and the solutions Use the right tools I recommend Or just ask me!

22 EC2: No static IP? New instance, new IP They dont 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:,, 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

25 Links AWS Zone RubyWorks Production Stack on EC2 Amazon EC2 ephemeral storage (/mnt) and MySQL Amazon EC2 ephemeral storage (/mnt) and MySQL How to backup your MySQL server to S3 (not for large db) How to backup your MySQL server to S3 EC2 Walkthrough Installing and configuring nginx and Mongrel for Rails Installing and configuring nginx and Mongrel for Rails Amazon EC2 Gem Slicehost wiki WeoCEO Elastic Rails

Download ppt "What it takes Linux Mongrel Lots of memory (~50 megs / Mongrel) Good monitoring tools Monit ( Munin ("

Similar presentations

Ads by Google