Archive

Archive for the ‘mongrel’ Category

Mongrel to THIN

April 14th, 2008

For Rails applications I am using THIN on my local machine since a couple of weeks and found it better than Mongrel. I’ve started replacing mongrel with THIN on servers as well. THIN leverages the best of the available resources… It uses mongrel’s parser along with the Eventmachine and the Rack Ruby libraries which together provide better speed, greater requests/sec and certainly consumes lesser memory.

Install THIN by issuing

  sudo gem install thin

THIN accepts more or less similar switches as that of mongrel. You start THIN by issuing

  thin start -p 9090 -d -e production

-p — port, defaults to 3000
-e — environment, defaults to development
-d — daemonize mode

THIN provides an in built support for clustering and running multiple servers for the same applications. You can start say 3 servers for the single application by providing the -s switch as…

  thin start -p 9090 -d -e production -s 3

And similar to mongrel it will start three servers on the ports 9090, 9091 and 9092.

sur mongrel, thin