scylladb / scylla-machine-image

Apache License 2.0
20 stars 27 forks source link

Consistent CPU power configuration #550

Open ebenzecri opened 1 week ago

ebenzecri commented 1 week ago

I've noticed that CPU power configuration is not consistent in Scylla Cloud, which as far as I know, it's configured at AMI level. This is totally related to cpufrequtils and scaling governors usage.

Scenarios

Scenario 1: cpufrequtils is installed but using scaling governor is not supported

cpufrequtils is installed, but /sys/devices/system/cpu/cpufreq/policy0/scaling_governor doesn't exist, causing cpufrequtils to exit.

Scenario 2: Using a scaling governor is supported but cpufrequtils is not installed

/sys/devices/system/cpu/cpufreq/policy0/scaling_governor exists but cpufrequtils is not installed and/or not configured as expected (as far as I know, the governor used is performance).

Proposed solution

cpufrequtils must be always installed if using a scaling governor is possible. This must happen when the instance is bootstrapped.

ebenzecri commented 1 week ago

Reference: https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt

gmizrahi commented 6 days ago

The idea behind slowing down the CPU is to save energy (lower wattage), but we either way pay the same for the instance. I would therefore suggest to force the CPU frequency to maximum (not the burst frequency), but still allow the CPU to burst.

mykaul commented 5 days ago

I believe we've implemented https://docs.aws.amazon.com/linux/al2/ug/processor_state_control.html#c-states and we do not need anything else. Am I wrong here?