Archive

Posts Tagged ‘util-linux-ng’

lscpu – CPU architecture information查看器

December 5th, 2011 No comments

原创文章,转载请注明: 转载自系统技术非业余研究

本文链接地址: lscpu – CPU architecture information查看器

很多时候我们要了解CPU的型号,NUMA架构, L1,L2,L3 Cache大小等信息, 为服务器程序的编写和设置做决策。
Linux下除了 /proc/cpuinfo提供的信息以外,还有intel自己的工具: 参间 CPU拓扑结构的调查: http://blog.yufeng.info/archives/666

但是这些都不是很方便, 同样来自util-linux-ng包的lscpu很清晰的告诉你上面的信息. RHEL 6.1 已经预先安装好了。

man lscpu

DESCRIPTION
lscpu gathers CPU architecture information like number of CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches, CPU family,
model, bogoMIPS, byte order and stepping from sysfs and /proc/cpuinfo, and prints it in human-readable format. It supports both online and
offline CPUs. Alternatively, it can print out in parsable format including how different caches are shared by different CPUs, which can also be
fed to other programs.

我们来演示下:

$ uname -r
2.6.32-131.0.15.el6.x86_64
$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    2
Core(s) per socket:    4
CPU socket(s):         2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Stepping:              2
CPU MHz:               2394.164
BogoMIPS:              4787.83
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15

numa什么的在那里分布很清晰,赞下!

祝玩得开心!

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Linux, 工具介绍 Tags: ,

Linux下方便的块设备查看工具lsblk

December 5th, 2011 3 comments

原创文章,转载请注明: 转载自系统技术非业余研究

本文链接地址: Linux下方便的块设备查看工具lsblk

之前在Linux下看有什么块设备,通常都用fdisk什么的或者直接ls /dev/ 人肉去看看, 很土,不方便。 前二天在江枫的网站上看到了介绍的lsblk,这玩意不错,推荐给大家。
这个工具属于util-linux-ng包,在RHEL 6.1上是安装好的啦,直接用就好。 ubuntu高版本下也有。

这个工具最大的特别是把所有的块设备列出,而且还能显示他们之间的依赖关系,演示下:

$ uname -r
2.6.32-131.0.15.el6.x86_64
$ lsblk
NAME   MAJ:MIN RM   SIZE RO MOUNTPOINT
sda      8:0    0   931G  0 
├─sda1   8:1    0   128M  0 /boot
├─sda2   8:2    0   3.9G  0 /
├─sda3   8:3    0     2G  0 [SWAP]
├─sda4   8:4    0     1K  0 
├─sda5   8:5    0   9.8G  0 /usr
├─sda6   8:6    0   9.8G  0 /var
├─sda7   8:7    0   3.9G  0 /opt
├─sda8   8:8    0   3.9G  0 /tmp
└─sda9   8:9    0 897.6G  0 /home
sdc      8:32   0 148.5G  0 
└─md0    9:0    0   594G  0 /u01
sdd      8:48   0 148.5G  0 
└─md0    9:0    0   594G  0 /u01
sde      8:64   0 148.5G  0 
└─md0    9:0    0   594G  0 /u01
sdb      8:16   0 148.5G  0 
└─md0    9:0    0   594G  0 /u01
sr0     11:0    1  1024M  0 

看出来md0依赖于sdb, sdc,sdd,sde, 而sda1依赖sda,很爽!

祝玩得开心!

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Linux, 工具介绍 Tags: ,