(as context to this information, apparently this particularly bad
performance experienced with 'powersave' happens when the BIOS power
control is set to the default, and goes away when in the BIOS you set
power management to 'os control' - so there is some additional
information needed to determine why this particular case offers bad
performance, when as shown below, powersave/performance governors should
not normally present more than a few percent performance difference)

I would have not expected the governor choice (powersave or otherwise)
to limit performance so severely as to prevent a VM from booting/working
usefully. I would expect the frequency governor settings to see make a
difference in benchmarks and power usage, not general interactive
performance. The phoronix data referred to later supports that view (the
performance difference is minimal generally). The behavior you
experienced is really a bug in my view.

On modern Intel CPUs (Sandy Bridge and newer, many 2011/2012+ models but
varies depending on the exact CPU) the Intel "Pstate" driver is used
which is significantly different to the older "cpufreq" driver. This is
important to note as you have the two different drivers in use based on
which CPU you have - rather than OS (Xenial/Bionic use the same
settings).

Although both drivers have governor modes with the name "powersave" and
"performance" they are similar in name only and their behavior is quite
different and they do not share any code. To that end you may find
different behavior between some kind of test/lab environment which is
not unlikely to have much older hardware and current new hardware FCBs.
It would also be good to know for this specific badly broken system
which scaling_driver was in use and what the precise processor model
information from /proc/cpuinfo.

This article from Phoronix was released recently which compares the performance 
with various different benchmarks as well as power-usage of the various driver 
and governor mode combinations (it's a good read separately)
https://www.phoronix.com/scan.php?page=article&item=linux50-pstate-cpufreq

It has a few interesting observations. In the majority of benchmarks the
performance between the two is very similar, and in fact the p-state
powersave governor is slightly faster (!) than the pstate performance
governor in many of the tests by a small margin. Another major
observation from the phoronix data is that the CPUfreq-powersave
governor is VERY significantly slower, by a factor of 4-5 times in most
cases.

While the *cpufreq*-powersave (which remember, is different to the
intel_pstate-powersave governor, which should be used) governor is very
slow, it should also not be used by default on any Xenial or Bionic
system from what I can see unless I am missing another script/tool that
is changing the governor somewhere (I couldn't see any scripts in the
charm or qemu packages that do so). If we read the code of the systemd
service on bionic to set the CPU scheduler, we find that the script
/lib/systemd/set-cpufreq (which is an Ubuntu/Debian addition, not
systemd upstream, xenial uses more or less the same script at
/etc/init.d/ondemand) it is quite simple and will basically prefer
"interactive", "ondemand" and "powersave" in that order if they exist.
This should result in non-pstate systems using ondemand (correct) and
pstate systems using powersave (also correct). So it seems the bug is
most likely not in the script, but some strange interaction with the
BIOS that needs to be investigated further.

To that end if anyone with an affected system with noticeably worse performance 
in powersave/ondemand, I'd love to either get access or see the following data:
 - Output of "sudo dmidecode"
 - A copy of /sys/devices/system/cpu/cpufreq (tar is fine) with particular 
attention to the values of scaling_driver and scaling_governor 
 - A basic CPU benchmark, run under 'powertop' to collect information on the 
frequency and idle states. You can run that like so "sudo powertop -C test.csv 
-r test.html  --workload=/usr/bin/updatedb" - it will output a CSV and HTML 
file with the data. But we probably need a better benchmark that updatedb and 
I'm not 100% sure off the top of my head what we could use - I suggest we could 
try a few things on a "broken" machine to figure out benchmark we can use that 
reflects the poor performance - updatedb may well do the job but it's not what 
I'd actually suggest we use.

Ideally we would collect this information in a matrix of all 4
combinations of: CPU Governor (Default Ubuntu, User Optimised) and BIOS
setting (OS Control, BIOS Default) so we can understand why we get the
pathologically bad performance in some cases of BIOS Default +
powersave.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1806012

Title:
  set-cpufreq: 'powersave' governor configuration sanity on ubuntu
  server

Status in systemd package in Ubuntu:
  In Progress
Status in systemd source package in Xenial:
  In Progress
Status in systemd source package in Bionic:
  In Progress
Status in systemd source package in Cosmic:
  In Progress
Status in systemd source package in Disco:
  In Progress

Bug description:
  Whilst debugging 'slow instance performance' on a Ubuntu Bionic based
  cloud, I observed that the default cpu governor configuration was set
  to 'powersave'; toggling this to 'performance' (while in not anyway a
  particularly green thing todo) resulted in the instance slowness
  disappearing and the cloud performance being as expected (based on a
  prior version of the deploy on Ubuntu Xenial).

  AFAICT Xenial does the same thing albeit in a slight different way,
  but we definitely did not see the same performance laggy-ness under a
  Xenial based cloud.

  Raising against systemd (as this package sets the governor to
  'powersave') - I feel that the switch to 'performance' although
  appropriate then obscures what might be a performance/behavioural
  difference in the underlying kernel when a machine is under load.

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: systemd 237-3ubuntu10.9
  ProcVersionSignature: Ubuntu 4.15.0-39.42-generic 4.15.18
  Uname: Linux 4.15.0-39-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.5
  Architecture: amd64
  Date: Fri Nov 30 10:05:46 2018
  Lsusb:
   Bus 002 Device 002: ID 8087:8002 Intel Corp. 
   Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
   Bus 001 Device 003: ID 413c:a001 Dell Computer Corp. Hub
   Bus 001 Device 002: ID 8087:800a Intel Corp. 
   Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  MachineType: Dell Inc. PowerEdge R630
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=C.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.15.0-39-generic 
root=UUID=a361a524-47eb-46c3-8a04-e5eaa65188c9 ro hugepages=103117 iommu=pt 
intel_iommu=on
  SourcePackage: systemd
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 11/08/2016
  dmi.bios.vendor: Dell Inc.
  dmi.bios.version: 2.3.4
  dmi.board.name: 02C2CP
  dmi.board.vendor: Dell Inc.
  dmi.board.version: A03
  dmi.chassis.type: 23
  dmi.chassis.vendor: Dell Inc.
  dmi.modalias: 
dmi:bvnDellInc.:bvr2.3.4:bd11/08/2016:svnDellInc.:pnPowerEdgeR630:pvr:rvnDellInc.:rn02C2CP:rvrA03:cvnDellInc.:ct23:cvr:
  dmi.product.name: PowerEdge R630
  dmi.sys.vendor: Dell Inc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1806012/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to