cpupower

cpupower frequency-set -g performance
cpupower frequency-set -g powersave


Install setPL.sh


# execute as root
apt install -y linux-tools
apt install -y devmem2 msr-tools
cd /root
wget https://raw.githubusercontent.com/horshack-dpreview/setPL/master/setPL.sh
chmod +x ./setPL.sh
mv setPL.sh /usr/local/sbin

Usage example

setPL.sh 15 55

Output example

root@server7:~# setPL.sh 55 55
**** Current PL values from 'turbostat'
cpu0: MSR_PKG_POWER_LIMIT: 0x4281b800dd8078 (UNlocked)
cpu0: PKG Limit #1: ENabled (15.000 Watts, 28.000000 sec, clamp ENabled)
cpu0: PKG Limit #2: ENabled (55.000 Watts, 0.002441* sec, clamp DISabled)
**** Setting PL1=55000000 and PL2=55000000 in /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_*_power_limit_uw
**** PL1 and PL2 already enabled in MSR_PKG_POWER_LIMIT
**** New PL values from 'turbostat'
cpu0: MSR_PKG_POWER_LIMIT: 0x4281b800dd81b8 (UNlocked)
cpu0: PKG Limit #1: ENabled (55.000 Watts, 28.000000 sec, clamp ENabled)
cpu0: PKG Limit #2: ENabled (55.000 Watts, 0.002441* sec, clamp DISabled)
**** MCHBAR is 0xfedc0001
**** Current value of PACKAGE_RAPL_LIMIT_0_0_0_MCHBAR_PCU = 0x80000000:0x00000000
**** MMIO limit reg locked with PL1/PL2 disabled on previous invocation (expected)

i7z

apt install -y i7z
Cpu speed from cpuinfo 3686.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 3686 MHz
  CPU Multiplier 37x || Bus clock frequency (BCLK) 99.62 MHz

Socket [0] - [physical cores=16, logical cores=16, max online cores ever=16]
  TURBO ENABLED on 16 Cores, Hyper Threading OFF
  Max Frequency without considering Turbo 3785.62 MHz (99.62 x [38])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4/5/6 Cores is  54x/54x/51x/51x/51x/51x
  Real Current Frequency 4577.10 MHz [99.62 x 45.94] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %  Temp      VCore
        Core 1 [0]:       1504.16 (15.10x)         1    94.5       0    5.05    46      0.6831
        Core 2 [1]:       1723.58 (17.30x)         1      99       0       1    46      0.6931
        Core 3 [2]:       1749.96 (17.57x)         1     100       0       0    46      0.6957
        Core 4 [3]:       1791.41 (17.98x)         1     100       0       0    46      0.6831
        Core 5 [4]:       1634.01 (16.40x)         1    98.9       0       1    46      0.6831
        Core 6 [5]:       1690.35 (16.97x)         1     100       0       0    46      0.6831
        Core 7 [6]:       4232.86 (42.49x)         1    0.094      0    99.8    44      1.1025
        Core 8 [7]:       4577.10 (45.94x)         0    0.00929    0     100    44      1.1025
        Core 9 [8]:       4074.36 (40.90x)         1    3.14       0    96.4    44      1.1025
        Core 10 [9]:      4004.11 (40.19x)         1    0.88       0      99    44      0.6150
        Core 11 [10]:     4152.00 (41.68x)         1    0.0115     0    99.9    44      1.0825
        Core 12 [11]:     4358.49 (43.75x)         0    0.00432    0     100    44      1.0825
        Core 13 [12]:     3718.25 (37.32x)         1    1.33       0    98.6    44      1.0825
        Core 14 [13]:     2391.74 (24.01x)         1    12.7       0    87.1    44      1.0825
        Core 15 [14]:     1093.09 (10.97x)         1    0.298      0    99.6    41      0.0000
        Core 16 [15]:     1103.80 (11.08x)         1    0.234      0    99.7    41      0.0000