SCALING RAILSA topic no longer as amusingly controversial as when I first started speaking on         the topic, but Twitte...
@johnbarton      http://goodfil.mshttp://whoisjohnbarton.com
Why me?Because shut up, that’s why.
Because the EnvatoMarketplaces are really big in   traffic and workload...
... and I helped make the     computer machines do thatAt a point in time where people thought Rails couldn’t do that beca...
50 Million Dynamic Requests a       week when I left         or 80ish requests a second
Before that I did loads of performance work at   MyCareer.com.au
After that I’m building ROFLscale social network thingo.                      You know, for movies. Go sign up at http://g...
There is a risk of me veering into  my grand theory of software development and the universe         and everything.
What does “Scaling Rails”        mean?
Predictably serving more customers (with your rails app)next week/month/year than you        have right now
It’s a game of tradeoffs Cost vs. Performance vs. Reliability vs. Flexibility
“Complex systems that workevolve from simple systems that             work”
Growing a stack for scale is a similar exercise in managing   complexity as a growingcodebase and you can use the     same...
Coupling is the #1 enemy andbeating it is an elaborate game    of divide and conquer
Anyway, so some concrete   things about Rails  I can save the hand-wavy stuff for a devops meetup
Step #0Measure everything you can    afford to measure        I would hope that goes without saying.   New Relic and Scout...
Step #0.5Actually check up on what you        are measuring  And learn how to interpret that data correctly (read books).
Step #1             YAGNI          You Aint Gonna Need it(with caveats - you need a wee safety buffer)
Know your end game              Based on what kind of app you are working on.Social Network, Online News, Ecommerce all ha...
Know your techniquesYou need to know how to get yourself out of trouble when your metrics say        that you are in it. I...
Then you fake it till you make it
Deploy to the cloud   Probably Rackspace or Amazon,    Heroku if you are lazy and rich
Avoid vendor lock in for the full            stackBut it can be OK for smaller independent components. You will want to mo...
JB’s Golden Mini Stackone “magic vendor cloud load balancer” + 2 app servers + one datastore +                           f...
Rent the high memoryinstances for app servers    it’s almost invariably the limiting factor
Stick with SQLRails tooling is heavily biased that way and you will get the most stuff for free.
IT DOES NOT MATTER IF YOU    CHOOSE MYSQL OR POSTGRESQL BOTH WORK   FINE AND BOTH SCALE
Use DB backed queues...      delayed_job or roll your own     DBAs will roll their eyes at this
... for the short to mid termit is a simpler “whole stack” at the expense of doing things right
Put job queue workers on your          app slices......in direct proportion to the amount of jobs your web processes can m...
Then build a brand spanking            “job system”With Redis and whatever else magic job shit you want, and dedicated mac...
Caching is your get out of jail          free card
Be careful, it can hide genuine   performance problems   and once caching runs out... you are well and truly cooked
YMMV“I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they’ve                            always wor...
BOOKS•Building Scalable Web Sites (only if totally new to this)•Release it!: Design and Deploy Production-Ready Software•S...
INTERWEBS•http://akfpartners.com/techblog/•http://highscalability.com/•http://codeascraft.etsy.com/•http://instagram-engin...
Thanks!http://goodfil.ms ● http://whoisjohnbarton.com ● @johnbarton
Upcoming SlideShare
Loading in …5
×

Scaling Rails for Melbourne RORO

3,388 views

Published on

A talk I gave at the August meeting of the Melbourne RORO group on scaling a rails application.

It's a quick overview of what I think you need to do early in the life of a rails app to be ready for scale further down the road. Read http://jrb.tumblr.com/post/30570014929/scaling-rails-at-melbourne-roro to add more context to the slides.

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Votre Cette tempête de neige a balayé Mars travers la le long de nike requin tn pas cher la hémisphère nord et et aussi ce une sorte de vers le vers l'intérieur avec Mars 2012. Le Royaume-Uni gouvernement principale scientifiques mécanicien , John blanchi qui l' températures sont généralement la normale , que chacun de nous rencontre l'expérience plus la sécheresse, les inondations et ainsi que , en plus de tempêtes de neige. Blanc Paddington mentionné , crise réponse mesures

    Mars 26 , Metropolis , préfecture d'Okayama, au Japon machines placé a bouton tout avec Lieu cabinet, a déclaré l'entreprise développé l' le premier n'avez pas besoin , sort systèmes de panneau solaire robots. Le jour de l' du sur le spectacle à l' la vers sur l' Logiciel test articles marchandise. La société société plans d' placé dans placé dans le fonctionnement avec 2014.

    Mars cette spécifiques à l'intérieur du du printemps, cependant, l'hiver nike requin hiver pas pour congé. A inhabituel extraordinaire neige malheureuse sombre Grande-Bretagne, la France, les tn requin foot locker États-Unis et supplémentaires une autre les implantations internationales lieux. Grand nombre d' volume de vol en raison de l' chaussure tn pas cher poussés Grand public atteint une impasse, et alimentation d'énergie dans la plupart . Les météorologues mentionné exceptionnel Marche depuis 1963. Dans ce qui concerne, le expert Université ou le collège côtière et Les disciplines scientifiques , a fait sortir disponibles, est le votre ce lower océan ice amplitude phénomène météorologique a conduit à Haute N hémisphère.

    Future appareils société, a déclaré la compagnie l'entreprise sur la terre Expo à avec Aichi, une fenêtre nettoyage aide placée sur la paroi structure de paroi . Au temps que , à aller à l' 'nettoyage des panneaux solaires Ainsi , ne commence à déve panneau solaire Logiciel .

    Les scientifiques ont trouvé trouve que comme le polaire , section rencontré l'atmosphère Environnement , nombreuses travers le Retour dans votre froid oxygène l'océan de surface, de sorte que dont du sur l'Arctique. Le réchauffement chauffe pression instabilité et le changement l'air entre votre requin pas cher Arctique endroit à le au sud, par la suite causant finalement habitudes changent . Les tn nike pas cher climatologues estiment que estiment supposer que cela.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
3,388
On SlideShare
0
From Embeds
0
Number of Embeds
1,248
Actions
Shares
0
Downloads
17
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Scaling Rails for Melbourne RORO

  1. 1. SCALING RAILSA topic no longer as amusingly controversial as when I first started speaking on the topic, but Twitter does still have the odd lolz (ha ha, scala!)
  2. 2. @johnbarton http://goodfil.mshttp://whoisjohnbarton.com
  3. 3. Why me?Because shut up, that’s why.
  4. 4. Because the EnvatoMarketplaces are really big in traffic and workload...
  5. 5. ... and I helped make the computer machines do thatAt a point in time where people thought Rails couldn’t do that because Twitter crashed a lot and that’s all people thought of when they said “Big Rails”
  6. 6. 50 Million Dynamic Requests a week when I left or 80ish requests a second
  7. 7. Before that I did loads of performance work at MyCareer.com.au
  8. 8. After that I’m building ROFLscale social network thingo. You know, for movies. Go sign up at http://goodfil.ms, so I don’t get rusty at web scale.
  9. 9. There is a risk of me veering into my grand theory of software development and the universe and everything.
  10. 10. What does “Scaling Rails” mean?
  11. 11. Predictably serving more customers (with your rails app)next week/month/year than you have right now
  12. 12. It’s a game of tradeoffs Cost vs. Performance vs. Reliability vs. Flexibility
  13. 13. “Complex systems that workevolve from simple systems that work”
  14. 14. Growing a stack for scale is a similar exercise in managing complexity as a growingcodebase and you can use the same mental models
  15. 15. Coupling is the #1 enemy andbeating it is an elaborate game of divide and conquer
  16. 16. Anyway, so some concrete things about Rails I can save the hand-wavy stuff for a devops meetup
  17. 17. Step #0Measure everything you can afford to measure I would hope that goes without saying. New Relic and Scout are my favourite tools for that.
  18. 18. Step #0.5Actually check up on what you are measuring And learn how to interpret that data correctly (read books).
  19. 19. Step #1 YAGNI You Aint Gonna Need it(with caveats - you need a wee safety buffer)
  20. 20. Know your end game Based on what kind of app you are working on.Social Network, Online News, Ecommerce all have different work loads and optimal stacks. There is no one size fits all stack at the pointy end.
  21. 21. Know your techniquesYou need to know how to get yourself out of trouble when your metrics say that you are in it. I will give a reading list for that the end.
  22. 22. Then you fake it till you make it
  23. 23. Deploy to the cloud Probably Rackspace or Amazon, Heroku if you are lazy and rich
  24. 24. Avoid vendor lock in for the full stackBut it can be OK for smaller independent components. You will want to move hosting companies in your future. Probably more than once.
  25. 25. JB’s Golden Mini Stackone “magic vendor cloud load balancer” + 2 app servers + one datastore + frequent backups
  26. 26. Rent the high memoryinstances for app servers it’s almost invariably the limiting factor
  27. 27. Stick with SQLRails tooling is heavily biased that way and you will get the most stuff for free.
  28. 28. IT DOES NOT MATTER IF YOU CHOOSE MYSQL OR POSTGRESQL BOTH WORK FINE AND BOTH SCALE
  29. 29. Use DB backed queues... delayed_job or roll your own DBAs will roll their eyes at this
  30. 30. ... for the short to mid termit is a simpler “whole stack” at the expense of doing things right
  31. 31. Put job queue workers on your app slices......in direct proportion to the amount of jobs your web processes can make. Ifeach “app” box can do all of the ruby work for N number of requests, you can keep adding boxes until your database explodes.
  32. 32. Then build a brand spanking “job system”With Redis and whatever else magic job shit you want, and dedicated machines to working off that queue, and probably split your codebase too.
  33. 33. Caching is your get out of jail free card
  34. 34. Be careful, it can hide genuine performance problems and once caching runs out... you are well and truly cooked
  35. 35. YMMV“I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they’ve always worked for me”
  36. 36. BOOKS•Building Scalable Web Sites (only if totally new to this)•Release it!: Design and Deploy Production-Ready Software•Scalability Rules: 50 Principles for Scaling Web Sites•High Performance MySql•PostgreSQL 9.0 High Performance•PostgreSQL 9 Admin Cookbook
  37. 37. INTERWEBS•http://akfpartners.com/techblog/•http://highscalability.com/•http://codeascraft.etsy.com/•http://instagram-engineering.tumblr.com/•http://www.mysqlperformanceblog.com/•http://blog.newrelic.com/category/performance-tech-tips/
  38. 38. Thanks!http://goodfil.ms ● http://whoisjohnbarton.com ● @johnbarton

×