
本文共 3800 字,大约阅读时间需要 12 分钟。
LTP和stream性能测试工具
LTP工具安装和使用
http://sourceforge.net/projects/ltp/files/LTP Source/
http://ltp.sourceforge.net/
1、安装编译
tar jxvf ltp-full-20150420.tar.bz2
cd ltp-full-20150420/
./configure
Make && make install
cd /opt/ltp/
./runltp –f commands (测试常规命令)
./runltp –f admin_tools(测试常用管理工具是否正常稳定运行)
./runltp –f fcntl-locktests (测试NFS网络文件系统锁是否正常稳定)
./runltp –f admin_tools (测试常用管理工具是否正常稳定运行)
./runltp –f dio (测试直接IO是否正常稳定)
./runltp –f dma_thread_diotest (测试直接存储器访问线程直接IO是否正常稳定)
./runltp –f fcntl-locktests (测试NFS网络文件系统锁是否正常稳定)
./runltp –f filecaps (测试filecaps是否正常)
预制条件:在/etc/sysctl.conf文件中加一行:
CONFIG_SECURITY_FILE_CAPABILITIES=y后重启电脑
./runltp –f fs (测试文件系统是否正常)
./runltp –f fs_bind (测试fs_bind是否正常)
./runltp –f fs_ext4 (测试fs_ext4是否正常)
./runltp –f fs_perms_simple (简单测试文件系统权限)
./runltp –f fs_readonly (测试文件系统只读)
./runltp –f fsx (对文件系统进行压力测试)
./runltp –f hyperthreading (CPU超线程技术测试)
./runltp –f io (异步IO测试)
./runltp –f io_cd (对CD光驱进行压力测试) 预制条件:将光盘放入光驱
-t:指定测试的持续时间 -t 60s = 60 seconds -t 45m = 45 minutes -t 24h = 24 hours -t 2d = 2 days
./runltp –f lvm.part1 (测试文件系统MSDOS、Reiserfs、EXT2、NFS、Ram Disk、MINIX)
./runltp –f math (数学库测试)
./runltp –f nfs (nfs网络文件系统测试)预制条件:在本机配置nfs文件系统服务
./runltp –f pipes (对管道进行压力测试)
./runltp –f syscalls (测试内核系统调用)
./runltp –f syscalls-ipc (进程间通信测试)
./runltp –f can (测试控制器区域网络的稳定性)
./runltp –f connectors (测试Netlink Connector的功能性及稳定性)
./runltp –f ipv6 (测试IPv6环境下的基本网络功能)
./runltp –f ipv6_lib (IPv6环境网络开发共享库)预制条件:内核支持IPv6
./runltp –f multicast ( 测试多播的稳定性)
预制条件:
(1)设置环境变量export RHOST=<多播目标地址>
(2)/root/.rhosts,/home/user/.rhosts 添加内容:多播目标主机地址,多播目标主机用户,有多少 多播目标主机就写多少条。
./runltp –f network_commands (测试ftp和ssh的稳定性)预制条件:开启ftp和ssh
./runltp –f network_stress.whole ( 网络各个功能的压力性测试 )(2)服务器上运行的服务: ssh DNS http ftp
./runltp –f nptl ( 测试本地POSIX线程库的稳定性 )预制条件:内核支持POSIX本地线程库
./runltp –f pty (测试虚拟终端稳定性)预制条件:内核支持VT console
./runltp –f quickhit (测试系统调用的稳定性)
./runltp –f rpc 和 ./runltp –f rpc_test (测试远程过程调用稳定性 预制条件:内核支持远程过程调
…/runltp –f modules(测试内核模块)
初始测试
./runltp -p -l /tmp/resultlog.20180421 -d /tmp/ -o /tmp/ltpscreen.20180421 -t 1h
或者 ./runalltests.sh
-p:人为指定日志格式,保证日志为可读格式 -l:记录测试日志的文件 -d:指定临时存储目录,默认为/tmp -o:直接打印测试输出到/tmp/ltpscreen.20180421 -t:指定测试的持续时间 -t 60s = 60 seconds -t 45m = 45 minutes -t 24h = 24 hours -t 2d = 2 days
vim /tmp/resultlog.20180421 查看
压力测试:ltp-full-20150420.tar.bz2 用这个包 不成功可能是环境原因。
cd /opt/ltp/testscripts/
yum install gcc-c++ libstdc+±devel 先安装依赖
yum install -y sysstat 在安装这个
./ltpstress.sh -d /tmp/ltpstress.data -l /tmp/ltpstress.log -I /tmp/ltpstress.iostat -i 5 -m 128 -t 1 –S
-d:指定sar或top记录文件,默认/tmp/ltpstress.data -l:记录测试结果到/tmp/ltpstress.log -I:记录"iostat"结果到iofile,默认是/tmp/ltpstress.iostat -i:指定sar或top快照时间间隔,默认为10秒 -m: 指定最小的内存使用,默认为: RAM + 1/2 swap -n:不对网络进行压力测试 -S :用sar捕捉数据 -T:利用LTP修改过的top工具捕捉数据 -t: 指定测试时间,默认为小时
cd /tmp/ 里面会有很多ltpstress文件 查看就行
sar -u -f ltpstress.data 测试cpu 平均使用率

sar -r -f ltpstress.data memory 平均使用率

性能测试工具stream
https://pan.baidu.com/s/15ds1TrGKCvG6YMGqjmlY4Q 取件码:kryj
tar xf stream.tar
1、单线程编译
gcc -O -mcmodel=medium -DSTREAM_ARRAY_SIZE=100000000 -mcmodel=large -DNTIME=20 stream.c -o stream.o
./stream.o 执行

2、多线程编译
gcc -O -mcmodel=medium -fopenmp -DSTREAM_ARRAY_SIZE=100000000 -mcmodel=large -DNTIME=20 stream.c -o stream.o
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nBoofBOR-1620028675088)(C:\Users\DELL\AppData\Roaming\Typora\typora-user-images\image-20210503152344877.png)]
./stream.o 执行
e -DNTIME=20 stream.c -o stream.o
[外链图片转存中…(img-nBoofBOR-1620028675088)]
./stream.o 执行
[外链图片转存中…(img-PUegLBem-1620028675089)]
[外链图片转存中…(img-1boy2cce-1620028675090)]
发表评论
最新留言
关于作者
