Jan 022009
 

In Solaris 10, if you want to find the processor type and the number of physical processors installed on the system and the number of Virtual Processors available on the system then the psrinfo command does job for you.

To simply display the number of Physical processors, simply run the command with the -p option as follows:

root@sunserver # psrinfo -p
2

where 2 implies that there are 2 physical processors installed on the system.

If you would like to check the number of Virtual Processors on each of these Physical processors then type the command with the “-pv” arguement as follows:

root@ server:/root$ uname -a

SunOS server 5.10 Generic_137111-02 sun4v sparc SUNW,SPARC-Enterprise-T5120

root@server:/root$ psrinfo -pv

The physical processor has 32 virtual processors (0-31)

  UltraSPARC-T2 (cpuid 0 clock 1165 MHz)

The above indicates that there was only one physical processor (UltraSPARC-T2) on the T5120 server which has 32 Virtual processors. Each virtual processor is an entity with its own interrupt ID, capable of executing independent threads.

In simple terms, the number of Virtual Processors supported by a physical CPU is

“Number of Core” x “Number of threads”

For instance, the above is on a T5120 server with the UltraSPARC-T2. This CPU  has 4 cores and each core can support 8 threads and that gives us 32 Virtual processors.

The number of Virtual processors on a Server is simply the total Virtual processors supported on each of the physical processor.

In the following T5140 server there are 2 Physical UltraSPARC-T2+ processors with 6 cores, each supporting 8 threads which means we get 48 Virtual processors per Physical processor and hence a total of 96 Virtual processors (sum of VPs on individual processors) for the server:

root@ bserver:/root$ uname -a

SunOS bserver 5.10 Generic_137111-02 sun4v sparc SUNW,T5140

root@ bserver:/root$ psrinfo -pv

The physical processor has 48 virtual processors (0-23 32-55)

  UltraSPARC-T2+ (cpuid 0 clock 1167 MHz)

The physical processor has 48 virtual processors (64-71 80-119)

  UltraSPARC-T2+ (cpuid 64 clock 1167 MHz)

In earlier versions of Solaris, the -p arguement is not supported and hence wouldn’t provide this summarised output on the counts of the physical and Virtual CPUs.

  14 Responses to “psrinfo – Find number of Physical & Virtual Processors in Solaris 10”

  1. So, there is no way to find the actual number of cores on the cpu? I mean without going through ‘uname -a’ and then googling up for the processors data sheet.

  2. I’m sure this memconf perl script does:

    http://www.4schmidts.com/memconf.html

  3. Number of cores implied in command “kstat cpu_info”.
    This script does that: http://blogs.sun.com/sistare/entry/cpu_to_core_mapping

  4. Thanks for the useful info. But, this doesn’t work on Sol10 U5 and earlier.

  5. Personally, I prefer to simply use uname -X to get the total cores from NumCPU. kstat cpu_info is just a bit too verbose.

  6. Why NumCPU=32 for the command output uname -X in T5220 server?.
    Where as actual number of processor is one

  7. The NumCPU is # of virtual processors

  8. # kstat cpu_info|grep core_id|uniq

    Use this to get number of cores….:)

  9. Dear,
    i have a question about this server, can i close an ethernet port like ETH1 with a command? please if you have an answer feedback to me

  10. close it means disable the ethernet port

  11. ifconfig eth1 down

  12. Thanks. It helps.

  13. thanks this is helpful.

    i just have a query. when i do a “psrinfo -pv”, i get:

    The physical processor has 1 virtual processor (0)
    UltraSPARC-III+ (portid 0 impl 0x15 ver 0xb1 clock 1200 MHz)
    The physical processor has 1 virtual processor (2)
    UltraSPARC-III+ (portid 2 impl 0x15 ver 0xb1 clock 1200 MHz)

    the numbers in parenthesis (after the “virtual processor” words) isn’t they supposed to be number 0 and 1 respectively?

  14. To Rino: I think the number in parentheses is the chip_id, it also shows in the kstat cpu_info (if you have that command available). I suppose it’s desirable to have your chip_id values in sequential order, but it’s probably not necessary.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)