Since some time back (I think since I upgraded to rails 1.2, but not sure?) I am finding that Rails performance is dreadful on my 2 XP machines. However, everything is quite snappy on my linux machine? Same environment and rails version. Any ideas why? Using Firefox on XP to browse to mongrel started in development mode on an XP machine takes around 60+ seconds to startup initially and then 7+ seconds per page thereafter. Starting up the console takes a similar age and running any rake tasks is just agonising (1 min+) Starting up same version of mongrel on my linux machine and browsing to it from the same XP machine is 1-2 secs per page and the mongrel startup time is just a few seconds. I haven't tested fully, but the console takes just a few seconds to start (dev mode). I have recently tried uninstalling Ruby completely on one of the XP machines and re-installing using Ruby 1.8.6 and the latest rails. Seems to have made no difference though What could account for such slow performance on the XP machines? neither ram nor processor are stressed. Both XP machines are decent (one high end AMD, the other a 2Ghz Core Duo, both with 1GB ram). Grateful for any pointers Ed W
on 2007-04-20 14:45
on 2007-04-20 15:49
Ed: This is normal. I've been working on this for more than a year... Ruby is just really slow on XP, especially with older processors. I have a P4 2.6ghz machine that just dogs. Our servers perform equally slow (dual xeon 2ghz). However, our workstations with AMD dual-core chips or the dual core Intel chips seem to perform much better. Less waiting when running test, scripts, rake, or the console. Linux or OS X still runs circles around it, but it is an improvement. We were able to acheive much better performance numbers on our 64bit servers as well (even though the Ruby we used was not optimized for 64bit chips). It's an unfortunate fact of life that peformance on Windows is not that great. I have been very successful doing deployment on Windows, but you do end up using a lot of extra resources to get the job done. I always advise Windows folks to deploy on Windows first to get comfortable, and then invest some of that time that Rails saves them and install a Linux-based server solution. Feel free to contact me off-list if you want to talk about this some more.
on 2007-04-20 16:00
Hi Guys, > This is normal. I've been working on this for more than a year... Ruby is > just really slow on XP, especially with older processors. I agree. I've used Rails on Debian and Ubuntu on obsolete hardware and got better performance than WinXP on new hardware. I'm reasonably sure it's related to OS issues, because even on the same hardware Linux performs better. I have a WinXP box with VMWare player installed and an Ubuntu VM. Running Rails in the Ubuntu VM is faster than running Rails on its WinXP host! It might be something to do with Windows' workstation editions allocating a higher priority to GUI processes, so that Windows "feels" faster for the end user. Regards, Dave
on 2007-04-20 16:01
Hi > This is normal. I've been working on this for more than a year... Ruby > is just really slow on XP, especially with older processors. > > I have a P4 2.6ghz machine that just dogs. Our servers perform > equally slow (dual xeon 2ghz). > > However, our workstations with AMD dual-core chips or the dual core > Intel chips seem to perform much better. Less waiting when running > test, scripts, rake, or the console. Linux or OS X still runs circles > around it, but it is an improvement. I don't think what I am seeing is "just a tad slower"!! I just ran a rake task and it took 1-2 minutes on a fairly decent AMD on XP. But it takes just a few seconds on my P2.8Ghz linux box? (both in dev mode). Surely this isn't normal? Seriously how does anyone get any development done on windows if this is "normal"? It takes 1-2 minutes to run the rake task to generate a new model/controller, etc - is this the kind of performance that other windows users are seeing on decent hardware? Please tell me that others aren't seeing this kind of performance? There must be some simple bottleneck that can be removed? I can't see what it's doing for all those minutes anyway - there is no CPU load for example...?? Ed W
on 2007-04-20 16:10
Ed: Okay... a couple of minutes is an indication that something's wrong. There is a significant difference in speed, but it's not a minute for a generator. What version of Ruby, what version of Rails, and how did you install them?
on 2007-04-20 17:02
I find that ruby takes a 10 seconds or so to start up in XP, no matter what I'm doing. The actual task that I've asked ruby to do is pretty quick. I can tell this by comparing how long ruby takes to do tasks of varying complexity. A simple script/generate takes very nearly as long as something far more complex. Maybe it's worth you making similar comparisons to see if you have the same issue (but worse). -Nathan
on 2007-04-20 17:14
email@example.com wrote: > I find that ruby takes a 10 seconds or so to start up in XP, no matter > what I'm doing. The actual task that I've asked ruby to do is pretty > quick. I can tell this by comparing how long ruby takes to do tasks of > varying complexity. A simple script/generate takes very nearly as long > as something far more complex. Maybe it's worth you making similar > comparisons to see if you have the same issue (but worse). Yes, this is exactly the problem. Startup time of the rails environment is circa 1 min+ This only happened "recently", but it's the same on two different machines so I can't really figure out what the similarity is. Also I removed my complete ruby installation on one machine and re-installed the latest Ruby-one-click plus rails. So other people are just seeing about 10 secs plus for a rails console to appear then (say). With my setup it's about 1-2 mins... Ed W
on 2007-04-20 17:33
Brian Hogan wrote: > Ed: > > Okay... a couple of minutes is an indication that something's wrong. > There > is a significant difference in speed, but it's not a minute for a > generator. > > What version of Ruby, what version of Rails, and how did you install > them? Is your database local or on another machine? That can take a significant amount of time.
on 2007-04-21 08:23
I am also noticing a bit of slowdown on my XP machine. Most command line processes, such as starting mongrel, hang for several seconds before executing. Web requests seem fast enough though, I don't notice a huge difference overall compared to Debian. My hardware is a fairly recent intel core2 duo, with 2GB ram. Could it be the particular build of Ruby for windows I am running? I've also run PHP and Perl interpreters on this machine in the past and did not notice this problem. What's strange is I get better performance with the ruby interpreter running linux inside vmware workstation with XP as the host. I'm running Ruby 1.8.4 installed via the "one-click" installer. Rails is the latest gem.
on 2007-04-21 13:08
i'm running 1.8.5 on windows xp as my dev box and i have no such performance issues. but i saw this on a crappy win 2k3 server this week. it had an on-access virus scanner running causing rails to slow down to a crawl. if you're running a virus scanner that works that way try excluding the ruby dir and your rails application directories from being constantly scanned.
on 2007-04-21 13:55
After a bit more probing it seems that using a wifi network card is causing the slowdown... Switching to hardwired networking and now it takes only 10 secs or so to startup the console. I'm guessing that this points to something which has changed on my samba server... Anyone else can confirm that a wifi card *can* work ok with rails on XP? ie files are on the network drive, app is running on the XP machine... I know the latency rises quite a bit with a wifi card, but the slowdown here is massive. For example my app is near instant in dev mode plugged into the network, yes RJS templates take perhaps 7 secs plus when using the files over wifi... Anyone seen something on samba which can cause this? Cheers Ed W