The
goal of Rubinius, said Phoenix, is to write an environment that is much
more open and to build a better Ruby environment in terms of
performance, execution speed and such features as garbage collection.
"As we see more adoption of the language it's time for us to start to grow up the environment a little," Zygmuntowicz said.
ADVERTISEMENT
Engine Yard has "solved a lot of these problems over and over
again," including issues of scaling Ruby and Ruby on Rails
applications, said Ezra Zygmuntowicz. He recently co-authored the book
"Deploying Rails Applications," which provides tips on scaling Rails
applications.
According to a description of the book by its publisher, O'Reilly
Media, "Until now, the information you needed to deploy a Ruby on Rails
application in a production environment has been fragmented and
contradictory. This book changes all of that by providing a consistent,
level-headed book containing advice you can trust. You'll get the
inside angle from those that have built, deployed, and maintained some
of the largest Rails apps in production, anywhere."
Zygmuntowicz said of the book: "It helps with starting off with
Rails all the way up to scaling to clusters and multiple MySQL
instances."
Regarding claims that Rails doesn't scale and that the popular Twitter social networking
and messaging application is suffering outages and problems because of
Rails scalability issues, Zygmuntowicz said: "Mostly that's kind of BS.
You just have to architect properly for it. In most Rails applications
the database becomes the bottleneck before anything else."
Moreover, "There's no language that scales; languages don't scale, architectures do," he said.
"Twitter's problems have nothing to do with Rails," Zygmuntowicz
said. Twitter is "right down the block" from Engine Yard in San
Francisco's South Park neighborhood, and he said he has worked closely
with Twitter engineers and has seen the issue firsthand.
Scaling Rails
To initially scale Rails applications, Zygmuntowicz said, "You have
a number of Rails application processes behind a load balancer, so to
scale you add more servers and application processors." Yet, the problem with Rails is "with the database becoming a central point of contention."
However, the first way to get around that is to "get a bigger
database box, which is scaling vertically," Zygmuntowicz said. "Next is
to add a couple of slave databases that replicate all the data written
to the master," but that doesn't cure all ills, he said.
"Twitter scaled their database to as big a box as they could get,
but they have so much data being written all the time that they have a
hard time keeping up," Zygmuntowicz said. They also have a "sharded
database” to scale horizontally to many databases, which helps
alleviate some of the strain on the system.
"In general, I host many large applications with 4 million to 5
million transactions a day, and Rails scales just fine," Zygmuntowicz
said.