Tag Archive for 'dreamhost'

Tickling ruby apps every 5 minutes

I posted a while ago about the problems on DreamHost killing my ruby applications’ start-up. Currently I have a solution, yet it is experimental and certainly not reliable. To tickle the application every 5 minutes, the application processes won’t be idle and won’t be turned off by DreamHost. Since my application don’t get much traffic, I need this desperate measure to keep the application from dying. In return, I can access the applications in an instant as if they were  PHP applications.

My web application is small and lightweight since it uses Sinatra which is a very light framework, so I know it won’t be needing much resources. The starting up is the only problem, since running ruby applications on DreamHost creates a sudden spike on the ram by starting up.

To tickle the application, you need to create a cron job that will visit the application every 5 minutes.

*/5 * * * * /usr/bin/curl http://your-domain.com/ -s -o /dev/null

I noticed some odd behavior though. When you try to run another ruby application on the same server, the loading of my ‘tickled’ applications are also being delayed.

I had this idea a long while ago, and when I saw that this method being used by other ruby users hosted on DreamHost, I decided to try it out too.

Thinking of purchasing VPS Hosting

DreamHost has changed their rules lately. They have a script running which  kills processes that goes over their limit of 153600.00. That is of course since I’m hosted on a shared server, so they’re killing the processes calling my ruby applications.

2009-11-13 11:37:52 procwatch2 INFO: Process(pid=26603, name=’ruby1.8′, uid=thisismyid(#####), tty=None, cpu=4.6, rss=100552.0, vsize=174236.0): kill for total RAM (50276.00 self, 157280.00 total exceeds limit 153600.00)

When trying to access any of my ruby applications, even the Sinatra-powered ChanLu Dev, it takes more than a minute to load compared before when the loading time took only five seconds. There are other ruby applications I’m using, like Tracks and Redmine that I can’t live without. Also, I really don’t want to use other programming language for ChanLu. Let’s just say Ruby got me, and it took my heart away.

I know that I do need a private server if I want to host ruby applications, DreamHost also advised me to get one. I’m planning to purchase a VPS plan on another hosting company, because they’re more affordable. I just hope to have some more money to finance on this.

Symfony on Dreamhost

I’m amazed on how easy it is to install the Symfony PHP Framework on Dreamhost. I have been thinking of coding my portfolio site using PHP and this framework instead of Ruby due to the server’s loading time delay, since mod_rails is being turned off on a shared server. If you want to install Symfony, you can follow the tutorial found on the Dreamhost Wiki itself, it is very detailed and step by step. You won’t be lost nor are there complicated steps that only technical people would know.

No personal comments for Symfony yet, since I can’t try it out due to some difficulties. I’ll be posting here about my experiences after coding something using Symfony.