]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/attributes/default.rb
Increase sleep interval when rails workers have nothing to do
[chef.git] / cookbooks / hardware / attributes / default.rb
index d86e0347e999a4ff2a2cbd6b996c27d545d1ff90..d2c1b36bd22c90d244dd9876ea7a934da104b035 100644 (file)
@@ -57,3 +57,13 @@ if File.exist?("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor") &&
   default[:sysfs][:cpufreq_ondemand][:parameters][:"devices/system/cpu/cpufreq/ondemand/up_threshold"] = "25"
   default[:sysfs][:cpufreq_ondemand][:parameters][:"devices/system/cpu/cpufreq/ondemand/sampling_down_factor"] = "100"
 end
+
+energy_perf_bias = Dir.glob("/sys/devices/system/cpu/cpu*/power/energy_perf_bias")
+
+unless energy_perf_bias.empty?
+  default[:sysfs][:cpu_power_energy_perf_bias][:comment] = "Set CPU Energy-Performance Bias Preference to performance"
+
+  energy_perf_bias.sort.each do |path|
+    default[:sysfs][:cpu_power_energy_perf_bias][:parameters][path.sub(%r{^/sys/}, "")] = "0"
+  end
+end