获取VPS真实CPU频率和RAM大小

Sib*_*Guy 1 linux windows vps

有没有办法获得VPS真实的CPU频率和RAM大小(我对Linux和Windows都感兴趣)?

Pas*_*cal 5

哦,抱歉,我没有仔细阅读问题。但我猜,你可以利用linux中提供的信息来猜测它。但这并不准确,因为根据虚拟化硬件的定义,人们可以“伪造”所提供的所有信息。

假设您可以直接通过 linux ssh 访问 VPS

获取CPU/RAM信息

您可以使用:

cat /proc/cpuinfo 
Run Code Online (Sandbox Code Playgroud)

获取 CPU 速度及其“起源”

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:
Run Code Online (Sandbox Code Playgroud)

要获取 RAM 大小,您只需输入:

free -m 
Run Code Online (Sandbox Code Playgroud)

这将向您显示以下输出:

             total       used       free     shared    buffers     cached
Mem:          1003        177        826          0         14        130
-/+ buffers/cache:         31        971
Swap:         2053          0       2053
Run Code Online (Sandbox Code Playgroud)

有趣的是,lshw 命令显示了一些不同的信息:

 *-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
Run Code Online (Sandbox Code Playgroud)

猜猜CPU

看看bogomips,现在我们可以使用google来猜测CPU的制造商。有了 bogomips,我们就可以开始谷歌搜索 CPU:在这种情况下,似乎是

Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz
Run Code Online (Sandbox Code Playgroud)

我不太相信这一点。由于这是来自 hetzner.de 的 VPS。但是我们只得到了 4 个核心(每个核心频率为 3.07 GHz)中的一个 CPU 频率为 2GHz。