Ok so I’ve been running Rails apps on my server for a few months. So far the experience hasn’t been that great. I’m currently running Apache2 & FastCGI. If you’ve been following the discussions on the net you already know this isn’t a very good combo.
Basically FastCGI under Apache2 is a memory leaking, zombie creating mofo. Which translates into kicking over apache on a semi regular basis - or you risk allocating all memory and hanging the box.
So far I’ve managed to keep that from happening (The up time on my server is currently 383 days). I have some more apps to roll out and I figure this is only going to make things worse.
Basically there are a couple of options:
Goto Apache 1.3 - this is a little annoying since I have to run Apache2 for svn already. I would prefer not to have to run two webservers. Plus I’m not sure that FastCGI under Apache 1.3 is any better.
Run LigHTTPD with FastCGI. Basically you proxy the requests thru. Again I would prefer not to run two web servers if possible. This is especially true since I don’t know squat about l lighty. This seems to be the preferred route for people who have to run Apache for other sites on the server. I get the feeling if SCGI doesn’t work out - I’m headed down this route.
Run the apps as CGI. This is possible. They end up being pretty slow. To be honest in some cases you might not notice so much, but I can tell you as soon as you switch to AJAX type stuff it is painfully obvious that you are running in CGI mode.
Run SCGI (More about SCGI & Rails can be found here: SCGI Ruby on Rails Runner). This is a replacement for FastCGI. It follows the same ideas but is built without all the cruft.
I ended up starting using SCGI because I was doing dev work under Windows and Web Brick wasn’t able to handle the load of my test app. SCGI was ridiculously easy to get setup to run under apache on windows. So I figured maybe I should give it a shot on the server.
This weekend I spent some time trying to get SCGI to integrate into switchtower.
I wrote a small wrapper to demonize the scgi start process so that switch tower will work.
It’s still not working exactly right. One problem is that if you call stop/restart and the scgi isn’t running - it raises an expecption and falls down. This also happens if you try to start the scgi and it is already running. This makes it a little akward to script.
I sent some comments along with my simple wrapper to Zed. I’m hoping he is able to help me to get this to work ( I really really don’t want to have to deal with lighty if I can help it - my web server is complicated enough as it is).
Anyone else using SCGI with Apache2 on Linux? I would love to hear from you about your experiences.
Leave a Reply
Moderation Active: Old stuff here... Therefore your comment on this post will be moderated (i.e. don't submit twice !)