[Groonga-mysql-commit] mroonga/mroonga at 97f9e79 [master] apt: support to customize available cpus

Back to archive index

Kentaro Hayashi null+****@clear*****
Tue Aug 29 11:55:25 JST 2017


Kentaro Hayashi	2017-08-29 11:55:25 +0900 (Tue, 29 Aug 2017)

  New Revision: 97f9e794956e3bd20c93159e9af5597660c9a314
  https://github.com/mroonga/mroonga/commit/97f9e794956e3bd20c93159e9af5597660c9a314

  Message:
    apt: support to customize available cpus

  Modified files:
    packages/apt/Vagrantfile

  Modified: packages/apt/Vagrantfile (+10 -0)
===================================================================
--- packages/apt/Vagrantfile    2017-08-29 10:28:54 +0900 (59d4171f)
+++ packages/apt/Vagrantfile    2017-08-29 11:55:25 +0900 (10a6faba)
@@ -33,6 +33,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       node.vm.box_url = vm[:box_url] if vm[:box_url]
       node.vm.provision(:shell, :path => "build-deb.sh")
       node.vm.provider("virtualbox") do |virtual_box|
+        system_n_cpus = 1
+        if File.exist?("/proc/cpuinfo")
+          system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size
+        end
+        if system_n_cpus > 1
+          vm_n_cpus = system_n_cpus / 2
+        else
+          vm_n_cpus = 1
+        end
+        virtual_box.cpus = (ENV["VM_CPUS"] || vm_n_cpus).to_i
         virtual_box.memory = (ENV["VM_MEMORY"] || 768).to_i
       end
     end
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-mysql-commit mailing list
Back to archive index