Skip to content

Instantly share code, notes, and snippets.

View krishnadasm's full-sized avatar
🎯

Krishnadas M krishnadasm

🎯
  • 18:57 (UTC +05:30)
View GitHub Profile
@ozbillwang
ozbillwang / Vagrant.Multi.CPU.rb
Created November 20, 2014 01:27
Vagrant setting - Use all CPU cores and 1/4 system memory
# http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck
config.vm.provider "virtualbox" do |v|
host = RbConfig::CONFIG['host_os']
# Give VM 1/4 system memory & access to all cpu cores on the host
if host =~ /darwin/
cpus = `sysctl -n hw.ncpu`.to_i
# sysctl returns Bytes and we need to convert to MB
mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4