Saturday, May 24, 2008

A word about eventmachine gem for Rails

I was working recently in a project that required special purpose server to be implemented from scratch. so i got down to business and started coding. But instead of reinventing the wheel, I started the implementation using the event machine gem for Ruby On Rails . After finishing the coding and basic testing, I got an unexpected problem. The server Always crash!!

First I tried to look back into my code, may be the problem is there. I have tried to repeat a certain request several times and log the server results. Some requests are served and some are not, then the server just stop responding. When I shut it down, It seems to be buffering the rest of the requests. So what happens is that it sends the rest of the requests and then terminate.

The solution to my problem was very simple, Switch OS!!!!!! What I did was installing the Rails environment and deploying my project on Ubuntu machine, then testing with the same sequence. It didn't crash. I even made my stress testing even more aggressive by initiating a request loop for around 10,000,000 requests from two different machines each and the server still RESPONDS!

I think you already have guessed what platform i was using for development. It was WINDOWS of course.

Viva Microsoft !!!


Mustafa said...

May be it's error of the implementation on the Windows OS!, not the responsibility of Microsoft!

Post a Comment