sosreport 收集系统信息
snmpconf 配置snmp
cfgmaker --ifref=name --global
L=AW 队列长度=到达率X等待时间
W=Q S 等待时间=队列时间 服务时间
W=Q (Tsys Tuser)
iostat 命令需要安装sysstat软件包
which iostat
rpm -qf /usr/bin/iostat 查看命令所用的软件包是什么
strace -fc elinks -dump http://example.com 需安装strace软件包
strace -fc dd if=/dev/zero of=test2 bs=1M count=100
四种调度算法:NOOP CFQ DEADLINE anticipatory
deadline 适合写入小文件多的系统
anticipatory 适合大文件 适合WEB SERVER
watch -n 1 ls -lh bigfile
noop 适合san存储
cfq 算法中可以调整IO优先级,class1,class2,class3 0-7 0最高,7最低 ,用如下命令
ionice -p1 -n7 -c2
p1 1代表进程号
n7 优先级为7
c2 class2
B=X O 带宽=速率 开销
带宽=data overhead 数据 开销
修改默认的IO调度算法
There are two ways to change the I/O scheduler – at boot time, or with new kernels at runtime. For all Linux kernels, appending ‘elevator={noop|deadline}’ to the kernel boot string sets the I/O elevator.
With GRUB, append the string to the end of the kernel command:
title Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)
root (hd0,0)
kernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro
root=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline
With newer Linux kernels (Red Hat Enterprise Linux v3 Update 3 does not have this feature. It is present in the main Linux tree as of 2.6.15), one can change the scheduler while running. If the file /sys/block/<DEVICE>/queue/scheduler exists (where DEVICE is the block device you wish to affect), it will contain a list of available schedulers and can be used to switch the schedulers.
(sda is the <disk>):
[root@cfs2]# cat /sys/block/sda/queue/scheduler
noop [anticipatory] deadline cfq
[root@cfs2 ~]# echo deadline > /sys/block/sda/queue/scheduler
[root@cfs2 ~]# cat /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq
The other schedulers (anticipatory and cfq) are better suited for desktop use.
查看当前的IO调度算法
dmesg | grep -i schedular256
英文信息copy from lustre manual
yum -y install sg3_utils
sginfo -a /dev/sda 查看硬盘硬件信息
sysctl -w vm.drop_caches=3 清空内存缓存
blockdev --getra /dev/sda
256
cd /sys/block/sda/queue
more read_ahead_kb
128
yum -y install kernel-doc
dumpe2fs /dev/sda2 查看磁盘BLOCK分组信息
filefrag -v /root/filename 查看文件存放的BLOCK位置
tune2fs -l /dev/sda 查看磁盘挂载过的次数
stat filename 查看文件的时间戳
RAID chunk size 计算
iostat -x /dev/sda 查看 avgrq-sz 直接查看的是扇区数 需换成kb,
如数值是48,组成RAID的共三个磁盘, 则,48*512/1024=24KB
chunk=24/3=8 KiB/disk
chunk size=avgrq-sz/RAID磁盘个数
chunk为2的n次方,n>1
mdadm -C /dev/md1 -l0 -n3 --chunk=8 /dev/sd[abc] -a yes
stride=chunk/block大小=8/4=2 blocks/chunk (一般磁盘默认block大小为4KB)
mke2fs -j -b 4096 -E stride=2 /dev/md1
yum -y install x86info
x86info -c 查看CPU详细信息
rpm -ivh cache-lab-xxx.rpm
yum -y inst |