转载自DHH的blog http://www.loudthinking.com/arc/000479.html
I've said it before, but it bears repeating: There's nothing interesting about how Ruby on Rails scales. We've gone the easy route and merely followed what makes Yahoo!, LiveJournal, and other high-profile LAMP stacks scale high and mighty.
Take state out of the application servers and push it to database/memcached/shared network drive (that's the whole Shared Nothing thang). Use load balancers between your tiers, so you have load balancers -> web servers -> load balancers -> app servers -> load balancers -> database/memcached/shared network drive servers. (Past the entry point, load balancers can just be software, like haproxy).
In a setup like that, you can add almost any number of web and app servers without changing a thing.
Scaling the database is the "hard part", but still a solved problem. Once you get beyond what can be easily managed by a decent master-slave setup (and that'll probably take millions and millions of pageviews per day), you start doing partitioning.
Users 1-100K on cluster A, 100K-200K on cluster B, and so on. But again, this is nothing new. LiveJournal scales like that. I hear eBay too. And probably everyone else that has to deal with huge numbers.
So the scaling part is solved. What's left is judging whether the economics of it are sensible to you. And that's really a performance issue, not a scalability one.
If your app server costs $500 per month (like our dual xeons does) and can drive 30 requests/second on Rails and 60 requests/second on Java/PHP/.NET/whatever (these are totally arbitrary numbers pulled out of my...), then you're faced with the cost of $500 for 2.6 million requests/day on the Rails setup and $250 for the same on the other one.
Now. How much is productivity worth to you? Let's just take a $60K/year programmer. That's $5K/month. If you need to handle 5 million requests/day, your programmer needs to be 10% more productive on Rails to make it even. If he's 15% more productive, you're up $250. And this is not even considering the joy and happiness programmers derive from working with more productive tools (nor that people have claimed to be many times more productive).
Of course, the silly math above hinges on the assumption that the whateverstack is twice as fast as Rails. That's a very big if. And totally dependent on the application, the people, and so on. Some have found Rails to be as fast or faster than comparable "best-of-breed J2EE stacks".
The point is that the cost per request is plummeting, but the cost of programming is not. Thus, we have to find ways to trade efficiency in the runtime for efficiency in the "thought time" in order to make the development of applications cheaper. I believed we've long since entered an age where simplicity of development and maintenance is where the real value lies.
其实正如zhangc之前说,理论的问题都清楚,关键还是实践!
分享到:
相关推荐
RoR(Ruby on Rails)是一种流行的开源Web开发框架,以其高效和简洁的代码著称。然而,随着网站规模的增长,性能优化成为必不可少的环节。在本文中,我们将探讨一些RoR性能优化的关键方面,主要基于JavaEye网站在...
NULL 博文链接:https://xuxiangpan888.iteye.com/blog/266696
**Ruby on Rails(简称RoR)中文资料** Ruby on Rails(RoR)是一个基于Ruby编程语言的开源Web应用框架,遵循MVC(Model-View-Controller)架构模式,旨在简化Web开发过程,提高开发效率。RoR强调“约定优于配置”...
**神经网络Ror ResNet模型详解** 在深度学习领域,ResNet(残差网络)模型是具有里程碑意义的创新,由He et al.在2015年提出。该模型解决了深度神经网络训练中的梯度消失问题,允许构建非常深的网络结构。而“Ror”...
Ruby on Rails(RoR)是一种基于Ruby语言的开源Web应用程序框架,它遵循MVC(Model-View-Controller)架构模式,旨在简化Web开发过程。在这个选题方向中,我们主要探讨的是与RoR相关的源代码分析和学习。源代码是...
在Ruby on Rails(ROR)开发环境中,安装和配置正确的依赖包是至关重要的。这个压缩包包含了一系列用于ROR框架的基础组件,但不包括Ruby本身。让我们深入了解一下这些包的作用和重要性。 首先,`actionpack`是Rails...
Ruby on Rails(简称RoR或Rails)是一种基于Ruby语言的开源Web应用框架,它遵循Model-View-Controller(MVC)架构模式,旨在提高开发效率并提供简洁、优雅的代码结构。"ror实例"可能指的是在学习或实践中,通过创建...
**初探ROR** Ruby on Rails(简称ROR)是一个基于Ruby编程语言的开源Web应用程序框架,它遵循MVC(模型-视图-控制器)架构模式,旨在促进开发过程的简洁性和效率。Ruby on Rails的核心理念是“Don't Repeat ...
基于RoR的博客系统,代码风格简单清晰,前后太完善,适合初学者。
### Windows上搭建Ruby on Rails(ROR)环境详解 #### 一、引言 随着Web开发技术的不断发展,Ruby on Rails(简称Rails或ROR)作为一种高效、简洁且优雅的Web开发框架,受到了广大开发者的青睐。然而,在Windows...
ROR环境 Ruby version 1.9.3 (java) RubyGems version 1.8.24 Rack version 1.4 Rails version 3.2.12 JavaScript Runtime therubyrhino (Rhino) Active Record version 3.2.12 Action Pack version 3.2.12 ...
### ROR 文件的上传与下载:深入解析与实践 在Ruby on Rails(简称ROR)框架下,处理文件的上传与下载是一项常见的需求,尤其是在构建包含媒体内容的应用程序时。本文将基于给定的文件信息,详细阐述如何在Rails...
FreeMIS是一个基于Ruby on Rails(RoR)框架构建的管理信息系统(MIS)。RoR是由David Heinemeier Hansson开发的一个开源Web应用程序框架,它遵循“Don't Repeat Yourself”(DRY)原则,强调简洁和生产力。RoR使用...
在IT行业中,Ruby on Rails(简称ROR)是一款基于Ruby语言的开源Web应用程序框架,它遵循MVC(Model-View-Controller)架构模式,旨在简化Web应用开发过程,提高开发效率。本文将深入探讨如何配置ROR开发环境,以及...
《机遇ROR的图书管理系统》是一份以Ruby on Rails(简称ROR)技术为核心,旨在构建高效、便捷的图书管理解决方案的学习资料。Ruby on Rails,是基于Ruby编程语言的开源Web应用框架,它遵循MVC(Model-View-...
### RoR培训课程PPT知识点概述 #### 一、课程概览与背景介绍 - **课程性质**:本课程为为期五天的Ruby on Rails(简称RoR)入门级培训,适合初学者快速掌握RoR的基本概念和技术要点。 - **讲师信息**:由Peter ...
破解版本的JAR包,放到本地磁盘,ECLIPUS直接用,到JVM设置直接加 -noverify -javaagent:D:\javarebel.jar
Ruby on Rails,简称RoR,是由David Heinemeier Hansson基于Ruby语言开发的一款开源Web应用程序框架,它遵循MVC(模型-视图-控制器)架构模式,旨在提高开发效率和可读性,使得开发者能够更快速地构建功能丰富的web...
"ror留言板程序"是一个基于Ruby on Rails框架开发的简单应用,它主要用于实现用户在网站上留言和查看他人留言的功能。Ruby on Rails(简称RoR)是用Ruby语言编写的开源Web应用程序框架,遵循MVC(Model-View-...