FAQ
Hi all,

This relates to a discussion we are having in the Redmine ticket
https://projects.puppetlabs.com/issues/11612.

I am extending the processorcount, physicalprocessorcount and processorX
facts that exist for Linux and Solaris.

I personally find the behaviour of the processor facts on Solaris
surprising -

myhost# facter |grep proc
physicalprocessorcount => 1
processor0 => SPARC64-VII
processor1 => SPARC64-VII
processor2 => SPARC64-VII
processor3 => SPARC64-VII
processor4 => SPARC64-VII
processor5 => SPARC64-VII
processor6 => SPARC64-VII
processor7 => SPARC64-VII
processorcount => 4


We can see that physicalprocessorcount is returning the number of physical
CPUs which is good, the processorX array is getting populated with virtual
CPUs, and processorcount is returning the number of cores. The command
used to set processorcount is essentially kstat cpu_info |grep core_id
sort -u.
However, I suspect Solaris sysadmins are more familiar with using commands
like psrinfo, prtdiag, and mpstat to get CPU count, and these all report
the number of CPUs as 8 rather than 4.

If I was writing this from scratch I would have a fact called something
like ProcessorCoreCount and have that report 4 and then a separate fact
ProcessorCount that would report 8 - as psrinfo is doing.

Therefore I am interested to know if others out there regard this behaviour
as a 'bug or feature', and also get some feedback on how people are using
these facts out there.

Thanks in advance.

Best regards,
Alex Harvey

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/WlRmUVNCey4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Alex Harvey at Dec 3, 2012 at 2:03 am

    On Tuesday, November 20, 2012 12:02:21 PM UTC+11, Alex Harvey wrote:
    Hi all,

    This relates to a discussion we are having in the Redmine ticket
    https://projects.puppetlabs.com/issues/11612.

    I am extending the processorcount, physicalprocessorcount and processorX
    facts that exist for Linux and Solaris.

    I personally find the behaviour of the processor facts on Solaris
    surprising -

    myhost# facter |grep proc
    physicalprocessorcount => 1
    processor0 => SPARC64-VII
    processor1 => SPARC64-VII
    processor2 => SPARC64-VII
    processor3 => SPARC64-VII
    processor4 => SPARC64-VII
    processor5 => SPARC64-VII
    processor6 => SPARC64-VII
    processor7 => SPARC64-VII
    processorcount => 4


    We can see that physicalprocessorcount is returning the number of physical
    CPUs which is good, the processorX array is getting populated with virtual
    CPUs, and processorcount is returning the number of cores. The command
    used to set processorcount is essentially kstat cpu_info |grep core_id
    sort -u.
    However, I suspect Solaris sysadmins are more familiar with using commands
    like psrinfo, prtdiag, and mpstat to get CPU count, and these all report
    the number of CPUs as 8 rather than 4.

    If I was writing this from scratch I would have a fact called something
    like ProcessorCoreCount and have that report 4 and then a separate fact
    ProcessorCount that would report 8 - as psrinfo is doing.

    Therefore I am interested to know if others out there regard this
    behaviour as a 'bug or feature', and also get some feedback on how people
    are using these facts out there.
    There were no responses here - I'd like to bump this up for a second go at
    getting some responses.

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/tD9YuRt9PWcJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Andrew Beresford at Dec 3, 2012 at 3:09 pm
    Feature :)

    This all comes down to the architecture of your processor.

    Your SPARC64-VII processors is a quad-core, two-way SMT processor. So, you
    have one physical CPU, four cores, and 8 threads.

    physicalprocessorcount is derived from the output of psrinfo -p

    and processorcount is derived from the *unique* list of core_ids in the
    output of /usr/sbin/kstat cpu_info - there are two for any given core_id,
    one for each thread that core can handle.

    If you do;

    /usr/bin/kstat cpu_info | grep core_id

    you will see duplicate entries for each core;

    [x@y ~]$ /usr/bin/kstat cpu_info | grep core_id
    core_id 0
    core_id 0
    core_id 2
    core_id 2
    core_id 4
    core_id 4
    core_id 6
    core_id 6
    core_id 8
    core_id 8
    core_id 10
    core_id 10
    core_id 12
    core_id 12
    core_id 14
    core_id 14
    core_id 32
    core_id 32
    core_id 34
    core_id 34
    core_id 36
    core_id 36
    core_id 38
    core_id 38
    core_id 40
    core_id 40
    core_id 42
    core_id 42
    core_id 44
    core_id 44
    core_id 46
    core_id 46

    Hope that helps!

    Andrew
    On Monday, 3 December 2012 02:03:25 UTC, Alex Harvey wrote:


    On Tuesday, November 20, 2012 12:02:21 PM UTC+11, Alex Harvey wrote:

    Hi all,

    This relates to a discussion we are having in the Redmine ticket
    https://projects.puppetlabs.com/issues/11612.

    I am extending the processorcount, physicalprocessorcount and processorX
    facts that exist for Linux and Solaris.

    I personally find the behaviour of the processor facts on Solaris
    surprising -

    myhost# facter |grep proc
    physicalprocessorcount => 1
    processor0 => SPARC64-VII
    processor1 => SPARC64-VII
    processor2 => SPARC64-VII
    processor3 => SPARC64-VII
    processor4 => SPARC64-VII
    processor5 => SPARC64-VII
    processor6 => SPARC64-VII
    processor7 => SPARC64-VII
    processorcount => 4


    We can see that physicalprocessorcount is returning the number of
    physical CPUs which is good, the processorX array is getting populated with
    virtual CPUs, and processorcount is returning the number of cores. The
    command used to set processorcount is essentially kstat cpu_info |grep
    core_id |sort -u.

    However, I suspect Solaris sysadmins are more familiar with using
    commands like psrinfo, prtdiag, and mpstat to get CPU count, and these all
    report the number of CPUs as 8 rather than 4.

    If I was writing this from scratch I would have a fact called something
    like ProcessorCoreCount and have that report 4 and then a separate fact
    ProcessorCount that would report 8 - as psrinfo is doing.

    Therefore I am interested to know if others out there regard this
    behaviour as a 'bug or feature', and also get some feedback on how people
    are using these facts out there.
    There were no responses here - I'd like to bump this up for a second go at
    getting some responses.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/mRciCXn_60YJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Alex Harvey at Dec 5, 2012 at 4:37 am

    On Monday, December 3, 2012 9:54:49 PM UTC+11, Andrew Beresford wrote:
    Feature :)

    I do understand what the code is doing but question whether that's what it
    should be doing. While it's ultimately a matter of opinion, it violates
    the 'principle of least surprise' for me and also my Solaris colleagues.

    At any rate, I finally managed to find a multi-core linux box I could try
    this on and have confirmed that the associated linux facts behave in the
    way I would have expected them to on Solaris -

    physicalprocessorcount => 1
    processor0 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor1 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor2 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor3 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor4 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor5 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor6 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor7 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processorcount => 8

    This is a 4-core CPU with 8 threads.

    See the spec for the i7-2600
    http://ark.intel.com/products/52213

    So I do think the Solaris behaviour is in error.

    Maybe we need a 'processorcorecount' fact instead?

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/oCN9JSsfcsgJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Andrew Beresford at Dec 5, 2012 at 3:18 pm
    Apologies,

    I re-read your post and understand what you mean.

    I prefer the core count definition, but whatever it is, it should be
    consistent between Linux and Solaris.

    Andrew
    On Wednesday, 5 December 2012 04:37:19 UTC, Alex Harvey wrote:


    On Monday, December 3, 2012 9:54:49 PM UTC+11, Andrew Beresford wrote:

    Feature :)

    I do understand what the code is doing but question whether that's what it
    should be doing. While it's ultimately a matter of opinion, it violates
    the 'principle of least surprise' for me and also my Solaris colleagues.

    At any rate, I finally managed to find a multi-core linux box I could try
    this on and have confirmed that the associated linux facts behave in the
    way I would have expected them to on Solaris -

    physicalprocessorcount => 1
    processor0 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor1 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor2 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor3 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor4 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor5 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor6 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processor7 => Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    processorcount => 8

    This is a 4-core CPU with 8 threads.

    See the spec for the i7-2600
    http://ark.intel.com/products/52213

    So I do think the Solaris behaviour is in error.

    Maybe we need a 'processorcorecount' fact instead?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/TIBwZzTypiIJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Alex Harvey at Dec 7, 2012 at 12:58 am

    I prefer the core count definition, but whatever it is, it should be
    consistent between Linux and Solaris.
    Yes it certainly should be the same on all platforms - the question is if
    we change it who is going to be impacted and how can we manage the change?
    I believe the vast majority of Puppet users run linux so probably the
    Solaris code needs to be changed to conform to the linux rather than vice
    versa. Unless lots of people think the linux fact is in fact the one
    that's 'wrong'?

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/zZSTUqGrMRAJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Andrew Beresford at Dec 7, 2012 at 10:05 am
    How about creating a processorcorecount and processorthreadcount with
    "correct" meanings? That then leaves the option to deprecate
    processorcount.

    I've realised that at some point in the past I have created a
    processorthreadcount fact because I needed a consistent source of this
    information on both Solaris and Linux.
    On 7 December 2012 00:58, Alex Harvey wrote:

    I prefer the core count definition, but whatever it is, it should be
    consistent between Linux and Solaris.

    Yes it certainly should be the same on all platforms - the question is if we
    change it who is going to be impacted and how can we manage the change? I
    believe the vast majority of Puppet users run linux so probably the Solaris
    code needs to be changed to conform to the linux rather than vice versa.
    Unless lots of people think the linux fact is in fact the one that's
    'wrong'?

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/zZSTUqGrMRAJ.

    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Alex Harvey at Dec 9, 2012 at 1:12 pm

    On Friday, December 7, 2012 9:05:32 PM UTC+11, Andrew Beresford wrote:
    How about creating a processorcorecount and processorthreadcount with
    "correct" meanings? That then leaves the option to deprecate
    processorcount.

    I've realised that at some point in the past I have created a
    processorthreadcount fact because I needed a consistent source of this
    information on both Solaris and Linux.
    I'm not sure - certainly I'd agree those would be good names for the facts
    if we were starting again (and should the 'processorX' facts be renamed as
    well)? I think for the moment I'm just going to implement the HP-UX facts
    to work the same way as the linux facts and create a thread on the puppet
    developers list to see what others think should be done about this cores vs
    threads connundrum.

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/xUqTLQbfJwUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jakov Sosic at Dec 12, 2012 at 12:53 am

    On 12/07/2012 11:05 AM, Andrew Beresford wrote:
    How about creating a processorcorecount and processorthreadcount with
    "correct" meanings? That then leaves the option to deprecate
    processorcount.

    I've realised that at some point in the past I have created a
    processorthreadcount fact because I needed a consistent source of this
    information on both Solaris and Linux.
    +1


    --
    Jakov Sosic
    www.srce.unizg.hr

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedNov 20, '12 at 1:02a
activeDec 12, '12 at 12:53a
posts9
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase