Why is Ruby running on a Windows server much slower than on a windows dev machine?

First of all, I would switch to Linux if I could, but I cannot, due to a third-party dependency.

I am involved in the processing and deployment of the rails application on a Windows 2008 server. When testing on the server, the application is very slow, with requests taking from 2 to 5 seconds each. This is nowhere near this slow on my development machine, and as far as I can tell, the slowness is inside the Rails themselves, i.e. I see logging, for example Completed 200 OK in 1859ms (Views: 1687.5ms)on the server, compared to Completed 200 OK in 347ms (Views: 298.0ms)on my dev machine.

I know that Rails should be slower on Windows than on Linux, but why will it be slower on a Windows server than on my Windows 7 dev?

In development, I run WEBrick, on the server I run under Apache. I also tried working on my dev machine and it is faster than WEBrick. Has anyone received any suggestions on what could cause such a significant slowdown or what to see? Anything would be greatly appreciated.

Update: It seems that Ruby itself on the server is much slower. Doing the following in irb takes 0.6 seconds on my dev machine, but on average more than 3 seconds on the server:

n = Time.now ; x = 0 ; 10000000.times { x += 1 } ; puts Time.now - n

What can make Ruby run so slower (over 3x) on the server? Maybe this is a version of Windows? Or something different? Ruby version is exactly the same: ruby 1.9.2p290 (2011-07-09) [i386-mingw32].

Refresh again:

Feel stupid if you don't mention it before, but it's a VPS. However, although I am ready to accept this, it will slow it down a bit - more than 3 times slower realistic?

+5

All Articles