Linux – Get VPS real CPU frequency and RAM size

linuxvpswindows

Is there any way to get VPS real CPU frequency and RAM size (I'm interested in both Linux and Windows)?

Best Answer

Oh sorry, I didn't read the question thoroughly. But I guess, you can guess it using the information provided in the linux. But this is not accurate, because per definition of virtualizing hardware, one can "fake" all the information provided.

Assuming you have direct linux ssh access to the VPS

Get CPU/RAM information

You can use:

cat /proc/cpuinfo 

to get the CPU speed and it's "origin"

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 2
model name  : QEMU Virtual CPU version 0.12.3
stepping    : 3
cpu MHz     : 3074.290
cache size  : 4096 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 4
wp      : yes
flags       : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm up rep_good pni cx16 popcnt hypervisor lahf_lm
bogomips    : 6148.58
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

to get the Ram size you can simply type:

free -m 

which will show you this output:

             total       used       free     shared    buffers     cached
Mem:          1003        177        826          0         14        130
-/+ buffers/cache:         31        971
Swap:         2053          0       2053

Interestingly, the lshw command shows a bit different information:

 *-cpu
      description: CPU
      product: QEMU Virtual CPU version 0.12.3
      vendor: Intel Corp.
      physical id: 401
      bus info: cpu@0
      slot: CPU01
      size: 2GHz
      capacity: 2GHz
      width: 64 bits
      capabilities: fpu fpu_exception wp de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx x86-64 up rep_good pni cx16 popcnt hypervisor lahf_lm
 *-memory
      description: System Memory
      physical id: 1000
      size: 1GiB
      capacity: 1GiB
    *-bank
         description: DIMM RAM
         physical id: 0
         slot: DIMM 0
         size: 1GiB
         width: 64 bits

Guess the CPU

Looking at the bogomips, now we can use google to guess the maker of the CPU. With the bogomips we can start googling the CPU: In this case it seems to be, the

Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz

I don't quite believe this. Since this from a VPS from hetzner.de.. But we're only getting a single CPU with 2ghz out of the 4 cores with 3.07 ghz each.