Search code examples
rubyjrubyvmware

Ruby slow startup performance on VMware


my old netbook (AMD C-60) when starting Sinatra apps would starts in 5-7 seconds (Ruby), 23-24 seconds (JRuby)

OS (netbook): 32-bit Arch Linux 3.4.62-1 i686 PAE (2GB RAM)

my developmen PC (AMD A8-6600K) starts at 1-2 seconds (Ruby), 12-16 seconds (JRuby)

OS (pc): 32-bit Arch Linux 3.11.1-1 i686 PAE (8GB RAM)

When i add vmware on my development PC, starts at 0.9-2 seconds (Ruby), 7 seconds (JRuby)

Guest OS (vm-pc): 32-bit Arch Linux 3.11.1-2 i686 (1.5GB RAM)

when using 32-bit guest under 64-bit VMware under (i3-3220, that should be many times faster than my old netbook), it starts in 45-46 seconds (Ruby), and 30-37 seconds (JRuby)..

Guest OS (vm-i3): 32-bit Arch Linux 3.11.1-2 i686 (1.5GB RAM)

Host OS: 64-bit Ubuntu Linux 3.8.0.19 x86_64 13.04 (2GB RAM, only running Unity, VMware and gnome-terminal)

When running a single script (generating 12MB of data to database), the performance was normal:

real/user/sys
netbook: ruby: 4:25/2:13/0:02 jruby: 13:21/11:46/0:09
pc:      ruby: 1:39/0:31/0:05 jruby:  3:52/ 3:38/0:03
vm-pc:   ruby: 0:40/0:31/0:06 jruby:  3:25/ 3:12/0:02
vm-i3:   ruby: 1:18/0:21/0:05 jruby:  3:16/ 2:19/0:35

The configuration:

Ruby: using Thin web server, ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]

JRuby: using Trinidad web server, jruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK Client VM 1.7.0_40-b31 +indy [linux-i386]

what are the possibilities the cause of this startup slowness on vm-i3?


Solution

  • The problem was on /etc/hosts file, forgot to add a line containing localhost/hostname