Posterous lessons learned. There are a bunch of basic functional elements to building out a popular Rails app that I've never really seen explained in one place, but we had to learn the hard way while building Posterous. Here's a rundown of what we've learned, in the hopes that some Google linkjuice may bring an intrepid wanderer to this forlorn part of the woods and help you out. Static StorageS3 is awesome. Yes, you can host everything off S3. Is it a little more expensive? Probably. But if you're engineer constrained (and if you're a startup, you absolutely are) -- set it and forget it. If you absolutely must have local storage across app servers, then MogileFS, GFS, or HDFS or even NFS (yuck) are possibilities. Images, files, whatever. HTTP Cache ControlThe HTTP protocol lets you tell browsers what static content they can cache. SearchYou're not going to run full text search out of your DB. Fix your DB bottlenecks with query_reviewer and New RelicThis basically saves your ass completely.
Then what happens? Se Scale rails from one box to three, four and five. Plugins - Memcache fragments with time expiry - Agile Web Develo. About memcache_fragments is a very simple plugin (10 lines of code!) That makes rails fragment caching play nice with robot coop’s memcache-client by wrapping its get/set methods with read/write methods that rails expects. makes it easy to do time based fragment expiry using this syntax: 10.minutes do %> ... Installing and using memcache_fragments You’ll first need the memcache-client gem from robot coop $ sdo gem install memcache-client Now install the plugin $ script/plugin install memcache_fragments Alternatively, you can use the gem $ sudo gem install memcache_fragments # in environment.rb require 'memcache_fragments' Setting up the fragment cache See the docs from memcache-client, but I found placing this in your environment.rb (or specific environment) to be the easiest:
Testing rails? It’s bleak to have leaks. third update Please see here for up-to-date documentation. second update There is now a pure-C heap instrumentation as well as the Ruby/ObjectSpace one. You really should be using the C version. Update I had to junk Rublique because it was introducing its own leaks (via method unbinding) and used an unreliable delta algorithm. A gem version is now available, too. Postscript You can report any issues on the forum. That’s all. Sribd, Scaling Rails Presentation. How to scale your web app » SlideShare. SqlSessionStore now available as a plugin. Posted on 09/15/2006 Rails core team member Rick Olson, the author of many rails plugins, mephisto and techno-weenie, has turned SQLSessionStore into a plugin and sent his code for me to publish. Thanks a lot Rick! I incorporated the latest changes from my sql session store implementation, most notably postgresql support, and added sql_session_store to my trac installation.
Using sql_session_store is now easier than ever before. Check it out into your vendor/plugins directory: svn co \ sql_session_store and follow the instructions in the README file. If you find any problems with the plugin, which would be entirely my own fault, not Rick’s, please use Trac to report them. BTW, I’d love to get support in for additional database adapters, especially Oracle. Comments <a href=" blog comments powered by.