aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <ADD_EMAIL_HERE>2015-03-09 09:24:30 +0000
committerGareth Rees <ADD_EMAIL_HERE>2015-03-09 09:24:30 +0000
commit72fe6ebc5c0a2dfaf9237d4a49694ba2c81b0ba2 (patch)
treeb5e448c3de8b87d9f212ab2dd78de31ba8053382
parent394895887ff6cf8a52f64bdf078b9654aac9cd4c (diff)
parentace94c0df33837f47c727f4a8a8e36809bb25b88 (diff)
Merge branch 'vagrant-performance' into rails-3-develop
-rw-r--r--Vagrantfile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Vagrantfile b/Vagrantfile
index 0fcf73de0..33fca39bc 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -97,7 +97,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# The bundle install fails unless you have quite a large amount of
# memory; insist on 1.5GiB:
config.vm.provider "virtualbox" do |vb|
+ host = RbConfig::CONFIG['host_os']
+ # Give VM access to all cpu cores on the host
+ if host =~ /darwin/
+ cpus = `sysctl -n hw.ncpu`.to_i
+ elsif host =~ /linux/
+ cpus = `nproc`.to_i
+ else # sorry Windows folks, I can't help you
+ cpus = 1
+ end
+
vb.customize ["modifyvm", :id, "--memory", ALAVETELI_MEMORY]
+ vb.customize ["modifyvm", :id, "--cpus", cpus]
end
# Fetch and run the install script: