Mongrel now available on DreamhHost PS!

software development

#1

Woot! Dallas announces a “new feature”:

There is more information at http://wiki.dreamhost.com/Mongrel

–rlparker


#2

The current wiki documentation is very quick, but should be enough to get people going. If anyone has any questions or comments about our Mongrel setup, fire away!

  • Dallas
  • DreamHost Head Honcho/Founder

#3

Very nice! I just tried this the other day and it works very well. Thanks guys!

Any chance of being able to set up a Mongrel cluster somewhere in the near future?


#4

We’ll definitely be looking into more advanced options like Mongrel clustering soon. The current setup should meet most website needs but clearly there are applications that will not run well with only a single Mongrel instance.

  • Dallas
  • DreamHost Head Honcho/Founder

#5

When I setup a mongrel, the path is not saved.

My application has new code push via capistrano, however it isn’t picking up the changes since I moved from fastcgi to mongrel.

My guess is the path not being saved from the panel interface is the problem.

(yes i’ve restarted mongrel)


#6

i second that…only setting up one proxy + one mongrel is like telling a super market “One customer at a time…the rest of you wait outside”.


#7

Well sorta… it’s a fair analogy if the people in the super market shop really really fast such that there’s rarely a line outside and when there is, it’s not very long. :sunglasses:

In reality a single mongrel is fine for most applications. You are correct that busier applications may not work acceptably, though For a busier application Passenger may work better.

  • Dallas
  • DreamHost Head Honcho/Founder

#8

We have upgraded our host to a Dreamhost PS to improve our Rails performance. I had the expectation that using Mongrel would allow our app to start up immediately when you hit the page, and continue running, (unlike FasCGI which has to start up first). However, whenever I hit our Rail application, the first time I hit it for the day, it takes 30sec to 60 sec to start up. After that, it responds much more quickly.

I poked around our config directory, and didn’t find a config.yml file. How can I check to see if my Rails app is running FastCGI or Mongrel?

When I checked my log files, I found that all of these files development.log mongrel.log
fastcgi.crash.log production.log MYSERVER.potiondesign.com__ MYSERVER.potiondesign.com_cms_3000-mongrel.pid

had all been modified today.

So I feel like it is possible that some of my application is being executed in FastCGI and other parts in Mongrel?


#9

Mongrel is continuously running so there is no start-up time when using it. You have the right expectation there.

I see two mongrel servers running on your PS server so it is at least set up. If it’s not working as expected you should contact our support team so they can diagnose the issue for you.

  • Dallas
  • DreamHost Head Honcho/Founder

#10

Thanks for answering my question. It took some time to figure out how to properly configure the Mongrel server and Rails application. This is what I had to do. The web panel is very useful, but there is no documentation on exactly what steps you have to take to make sure Mongel is running properly, or how to tell if it is working.

  1. Create a directory “my_dir” in my web account. ( If the director. does not exist, then the mongrel-start, and stop apps don’t appear in the directory.).
  2. Copy the rails application code to the directory, with the config and public appearing in the “my_dir” directory.
  3. Go to the web panel and use the form to specify the directory “http/my_dir” from the root of the user’s account and the url for the application “www.mysite.com/my_rails_app” or leave blank for “www.mysite.com” to be proxied to the rails port. Although this is automatically done, there is not explanation that this is what is happening.
  4. After the proxy is set up (and the information appears in the Monrel list, and the port number is listed), then ssh back into your site and you should find “mongrel-start, mongrel-stop, and mongrel-restart” applications copied into your “my_dir” directory.
  5. execute mongrel-start from the command line
  6. visit “www.mysite.com:300X” where 300X is your mongel port. This should connect directly to your rails application and launch it via mongrel.
  7. Finally, test that “www.mysite.com/my_rails_app” properly connects and proxies to your rails application. (or “www.mysite.com” if you want the root to work).

I am not sure exactly where this information should go, but I had to go through a lot of trial and error until I finally got this to work. What is most tricky, is that if the mongrel is not proxied properly, and you go to your application, it will launch via FastCGI, and appear to be working, even though it is not running through mongrel. When I would connect to the mongrel port directly “www.mysite.com:300X”, I would see a DIFFERENT site, and I knew that my application wasn’t running properly.

In any case, I think this is working now, and if there is an appopriate place to this to be posted in the wiki, I would be happy to post it, or for someone else to add it to the right place…

Thanks…
-phillip


#11

If you already have your application uploaded to the server, Mongrel should be started automatically and you shouldn’t need to go through so many steps.

Also, note that going to the mysite.com:300X does NOT start Mongrel. Mongrel does not start on demand like FastCGI and Passenger do. It has to be started directly from the command-line. Our web panel setup does that automatically but if it was unable to start for some reason (such as if some files it was expecting to see are missing) you would have to do it by hand. You also have to restart it by hand whenever you make code changes.

  • Dallas
  • DreamHost Head Honcho/Founder

#12

Yes, I encountered that issue, that makes sense. The web panel is great, but our issue came up when one of my developers thought that he had set up the server properly, but in fact there was no proxy set up for www.mysite.com was not pointing to the mongrel instance.


#13

Cool. Well, thanks for sharing your experience with it! Mongrel is not as ‘plug and play’ as it could be but we tried to make it easier.

Passenger is closer to plug and play but it has a built-in timeout so it may not be the best option for applications that are not accessed frequently.

Feel free to post your findings to the wiki as well if you’re so inclined.

  • Dallas
  • DreamHost Head Honcho/Founder

#14

Hello there. I am having issues getting Mongrel to work. I have followed these steps verbatim, a handful of times and never get the mongrel control files to be installed.

Am I not creating my rails app directory in the correct place? I have a user, lets call them foo and I am creating the rails app directory in foo’s home folder. In step three, what does the http refer to?

Ryan