Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-2980

Facter 4 outputs the processors.speed fact differently on Linux

    XMLWordPrintable

Details

    • Manual Test
    • Needs Assessment

    Description

      Note: This might be an issue only on non-virtualized systems (with processors that support variable frequency)

      facter 3

      $ /usr/bin/facter processors.speed
      4.20 GHz
      

      facter 4 (2 consecutive queries)

      $ bundle exec facter processors.speed
      3.18 GHz
      $ bundle exec facter processors.speed
      1.06 GHz
      

      Facter 4 reads from /proc/cpuinfo which reports the current speed of the processors:

      $ grep 'cpu MHz' /proc/cpuinfo
      cpu MHz		: 1724.163
      cpu MHz		: 1899.271
      cpu MHz		: 2135.291
      cpu MHz		: 1625.782
      cpu MHz		: 1729.682
      cpu MHz		: 1817.039
      cpu MHz		: 1729.482
      cpu MHz		: 1993.369
      

      Facter 3 reads the max speed from the first CPU (in kHz, then converts it):

      $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
      4200000
      

      Facter 3 relevant code path: https://github.com/puppetlabs/facter/blob/3.x/lib/src/facts/linux/processor_resolver.cc#L192
      Facter 4 relevant code path: https://github.com/puppetlabs/facter/blob/5f092a30cd5c33c2715619cada943bc1a8e0fa04/lib/facter/resolvers/processors.rb#L75

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              luchian.nemes Luchian Nemes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support