Lessons for Rails Deployment
Found an article called Real Lessons for Rails Deployment today via Peter’s blog, (although I think I may have come across it earlier while searching for help getting my Rails apps under control). In my experience, the hardest thing about developing an application in Rails is actually launching it on your server.
There are a ton of options, but from what I’ve read, the best ones require a dedicated server or a VPS. Like most people, I can’t afford that; I’ve got shared hosting. Unfortunately, Rails is tricky to deploy on a shared server.
The best option I have on my host (I suspect this goes for a lot of people) is to use FCGI with Apache. Lighttpd and SCGI apparently are much better and more stable, but my host doesn’t support them for shared accounts.
The problem with FCGI, despite it’s speediness, is that it’s unreliable. This details of this are a bit beyond me, but from what I’ve read, the library is a bit stale (hasn’t been updated in a while) and has some wierd quirks that make it go bonkers if it runs too long.
I run two Rails apps on my shared account, Feedmarker and Teacherly. If I don’t periodically kill my FCGI dispatchers, they’ll just grow and grow and eat up memory until the server crashes. This is bad.
When I noticed this happening, I set up a bash script to find so-called “zombie” dispatcher.fcgi processes and kill them. I run this via cron every half hour. Ever since I started doing this, both apps have been humming along fine, and the load on my server is far lower.
Links:
- Script to kill rogue FCGI processes
- Thread on solving some FCGI problems on Apache (hint: use ActiveRecord based sessions instead of tmp files)
- Using SCGI
Comments (No comments)
There are no comments for this post so far.
Post a comment