[Groonga-commit] groonga/groonga at 8105a62 [master] apt: support to customize available cpus

Back to archive index

Kentaro Hayashi null+****@clear*****
Tue Aug 29 11:53:45 JST 2017


Kentaro Hayashi	2017-08-29 11:53:45 +0900 (Tue, 29 Aug 2017)

  New Revision: 8105a6258cfd8ef11ed077c2068d6c24ee846be7
  https://github.com/groonga/groonga/commit/8105a6258cfd8ef11ed077c2068d6c24ee846be7

  Message:
    apt: support to customize available cpus

  Modified files:
    packages/apt/Vagrantfile

  Modified: packages/apt/Vagrantfile (+10 -0)
===================================================================
--- packages/apt/Vagrantfile    2017-08-29 06:09:12 +0900 (c0f0244a5)
+++ packages/apt/Vagrantfile    2017-08-29 11:53:45 +0900 (d09a817f9)
@@ -35,6 +35,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       node.vm.boot_timeout = 1 * hour_in_seconds
       node.vm.provision(:shell, :privileged => false, :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"] || 1024).to_i
       end
     end
-------------- next part --------------
HTML����������������������������...
下载 



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