The Barrettocracy
Barrett's Writings and Stuffs

VPS Baby (Cacheing Is Cool)

Posted on May 17, 2008 at 11:22 PM

I am on my Dreamhost VPS now. I can see how heavy Apache or a Rails app is as I monitor my memory usage with top. I have a handful of rails apps running on my VPS, and I am more mindful of these sorts of things all of the sudden. I think I may have been one of those jackasses sucking down the shared host resources.... Sorry other people on lara.

Simplelog is a lightweight rails blogging app, and it's the one that I use. Typo on the other hand leakssssss. I have 3 instances of ruby running right now, though, and they are taking up about all the memory I have allotted for this VPS.

So I am learning about cacheing in a rails app, which is nice. Anything that you cache lives in the public folder of the app. Anything that is in the public folder is served by the web server rather than the rails app. So you can keep ruby/rails from spinning up and sucking down your resources for a page that can be cached. Sweet.

Note that anytime you deploy a new version of the app you reset your cache because you're pushing up a fresh copy of your public folder. That is if you didn't check in the cache from your development app. You would have had to turn cache on in development in order to do that, though.

VPS is cool, and I am not my administrator on Slicehost. Yay.

Hierarchy: previous, next

Comments

There is 1 comment on this post. Post yours →

Update: 3 rails apps became 1 rails app with 2 plain-jane sites. Server-Side includes are a good thing. I was using rails for those 2 sites where a straight-up html site would have done. I think I may use rails to get my sites pulled together more often, though. Just turn cacheing on in dev, and before you know it you have your static site. Just go back through and cut it up for SSI. It saved me a lot of time on 1 of the sites.

Post a comment

Required fields in bold.