How to Display the Number of Processors (vCPU) on Linux VPS

Share this Article :

Question :

How to display the number of Virtual processor(vCPU) on linux Virtual Private Server (VPS) or Virtual Dedicated Server (VDS) ?

Answer :

To display the number of virtual processor(cpu) on linux vps, you have to run any of this command :

1. This command will display exact number of virtual cpu (vCPU) :

[[email protected] ~]# cat /proc/cpuinfo | grep processor | wc -l
2

2. This command will grep any available vCPU. First cpu will start with 0.

Example of linux CentOS server with 1 vCPU :

[[email protected] ~]# cat /proc/cpuinfo | grep processor
processor       : 0

Example of linux CentOS server with 2 vCPU :

[[email protected] ~]# cat /proc/cpuinfo | grep processor
processor       : 0
processor       : 1

or this command will return the same result as steps (2).

[[email protected] ~]# grep processor /proc/cpuinfo
processor       : 0

For additional information, you can display the number of cores on each CPU. Either Duo/Quad?

[[email protected] ~]# cat /proc/cpuinfo |grep cpu\ cores |uniq
cpu cores       : 4

Leave a Reply