scheduler performance testing
Scheduler Performance Test Manual
主机测试
1. 并行任务
time make -jX #监测并行任务的runtime
perf stat make -jX #统计并行任务的数据
以并行任务数量X为横轴,测得的runtime(Y)为纵轴,绘制曲线图。
举例:
通过make -jX
来跑并行任务。我这里通过编译qemu-5.1.0来测试性能。
cd qemu-5.1.0
mkdir build
cd build
../configure --target-list=x86_64-softmmu
perf stat make -jX
2. IPC之管道通信
基于pipe()
测试进程间IPC性能。
Ingo Molar的pipe-test-1m.c程序如下:
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<signal.h>
#include<sys/wait.h>
#include<linux/unistd.h>#define LOOPS 1000000int main(int argc, char *argv[])
{unsigned long long t0, t1;int pipe_1[2], pipe_2[2];int m = 0, i;pipe(pipe_1);pipe(pipe_2);if(!fork()){for(i = 0; i < LOOPS; i++){read(pipe_1[0], &m, sizeof(int));write(pipe_2[1], &m, sizeof(int));}}else{for(i = 0; i < LOOPS; i++){write(pipe_1[1], &m, sizeof(int));read(pipe_2[0], &m, sizeof(int));}}return 0;
}
现在perf中以及基于该pipe-test-1m.c程序集成了pipe()性能测试工具。
perf bench sched pipe -l 10000 #在两个进程之间执行10000个pipe通信操作
但光有pipe()函数的测试还不够,还需要并行执行该pipe()测试
#!/bin/shpairs=$1
loops=1000000file="test-"$pairs"-"$loops
cat /dev/null > $filefor((i=1; i<=${pairs}; i++));
do(echo "$(date +%H:%M:%S) | $(perf bench sched pipe -l $loops | grep "Total time" | awk '{print $3}') | $(date +%H:%M:%S)" >> $file) &
done
可以利用上面的脚本,生成测试文件,然后读取文件中最早时间戳和最晚时间戳之差"与"执行最长时间"两个值较大值。
对"test-$pairs-1000000"的处理脚本如下:
#!/bin/shcat /dev/null > fifo_pipe.txtfor((i=1; i<=50; i++))
do(echo -n "$i " >> fifo_pipe.txt && echo $(cat "test-$i-1000000" | cut -d'|' -f2 | sort -nr | sed -n '1p') >> fifo_pipe.txt)
done
绘图:X轴是并行pairs任务数量,Y轴是runtime执行时间。
3. 调度性能及IPC机制
perf中有基于hackbench的相关测试。
Suite for evaluating performance of scheduler and IPC mechanisms. Based on hackbench by Rusty Russell.
perf bench sched messaging -g 10 #400个threads, 10 groups == 400 processesperf bench sched messaging -t -g 15 #600个threads perf bench sched messaging -t -g 20 #800个threads, 20 groups == 800 threadsperf bench sched messaging -t -g 25 #1000个threads
测试脚本:
#!/bin/shif [ $1 -gt 25 ]; thenecho "error: too many groups"exit 0
figroups=${1:-10}for((i=1; i<=${groups}; i++))
doecho -n "$i "perf bench sched messaging -t -g $i | grep "Total time:" | awk {'print $3'}
done
绘图:X轴是groups数量,Y轴是runtime执行时间。
4. benchmark压力测试
这里使用sysbench工具,可以测试 文件I/O性能、CPU性能、内存性能、线程子系统性能、以及mutex性能测试。
举例
cpu测试举例
[root@localhost sysbench]# sysbench cpu --threads=20 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)Running the test with following options:
Number of threads: 20
Initializing random number generator from current timePrime numbers limit: 10000Initializing worker threads...Threads started!CPU speed:events per second: 16461.50General statistics:total time: 10.0012stotal number of events: 164704Latency (ms):min: 1.15avg: 1.21max: 3.0395th percentile: 1.39sum: 199951.66Threads fairness:events (avg/stddev): 8235.2000/124.07execution time (avg/stddev): 9.9976/0.00
mutex调度程序性能举例
[root@localhost sysbench]# sysbench mutex --threads=48 --mutex-num=1024 --mutex-locks=50000 --mutex-loops=100000 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)Running the test with following options:
Number of threads: 48
Initializing random number generator from current timeInitializing worker threads...Threads started!General statistics:total time: 5.1528stotal number of events: 48Latency (ms):min: 1847.95avg: 3603.47max: 5148.7295th percentile: 3773.42sum: 172966.62Threads fairness:events (avg/stddev): 1.0000/0.00execution time (avg/stddev): 3.6035/0.41
qemu虚机环境测试
1. latency延迟
可以用perf sched latency来测试qemu虚机的延迟数据。
2. load balance
可以自编工具来监测qemu进程的CPU迁移热力图。
3. perf kvm
perf kvm模块可以测试虚拟机环境下的性能。
scheduler performance testing相关推荐
- 性能测试(Performance Testing)杂谈
尽管笔者在知名外企已经从事软件测试工作七八年了,具体到性能测试也有几年经验了,期间在公司也做过几次Tech Talk:不过还真没有写过有关Performance Testing的博客, 正好借助这个平 ...
- why performance testing?
从我进入软件测试行业到现在有一年半的时间了,在这一年半的时间里,我做过三个月左右的手机测试,和一年多的winform项目的测试. 1. 做手机测试的时候感觉就是玩手机,找bug(不需要自己设计test ...
- Notes: harddisk performance testing
2019独角兽企业重金招聘Python工程师标准>>> 1. nspecting disk IO performance with fio https://www.linux.com ...
- 性能测试总结(performance testing)(一)
1.为什么要做性能测试? 1)目前绝大多数应用都是基于网络的分布式应用,我们无法知道用户数量,用户场景的不确定性,导致系统测试时,不仅仅是功能,业务逻辑,接口测试,还要测试系统性能.一个用户没问题,但 ...
- Software Performance Testing - 全链路压测知识点整理
分享一个大牛的人工智能教程.零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 什么是全链路压测 基于实际的生产业务场景.系统环境( ...
- 性能测试---搬运自Performance Testing Guidance for Web Applications,作者J.D. Meier, Carlos Farre, Prashant Ban
原文地址:https://docs.microsoft.com/en-us/previous-versions/msp-n-p/bb924375(v=pandp.10) 翻译软件:百度翻译 本指南介绍 ...
- Software Performance Testing - Gatling测试脚本编写
分享一个大牛的人工智能教程.零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 脚本示例 import io.gatling.cor ...
- Software Performance Testing - Gatling基本使用
分享一个大牛的人工智能教程.零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 介绍 Gatling是一款基于Scala开发的高性能 ...
- The evolution of cluster scheduler architectures--转
原文地址:http://www.firmament.io/blog/scheduler-architectures.html cluster schedulers are an important c ...
最新文章
- Guava Cache缓存的移除与读取
- 第59件事 运营驱动产品调优案例
- 完美,竟然用一个脚本就把系统升级到https了,且永久免费!
- android StringBuilder的Capacity的使用
- [转]白话阿里巴巴Java开发手册高级篇
- Innodb ibdata数据文件误删,如何恢复
- secucrecrt配置文件导入和保存
- 不需要英语的计算机行业,北京评职称不再考外语计算机 将涉及300多万人
- 借助Sigar API获取网络信息
- kotlin android中文文档,Android studio 生成带Kotlin文档的实现方式
- 单片机的C语言应用程序设计实训教程,单片机的c语言程序设计实训
- matlab:圆形的图像识别(二)
- 安装Ubuntu后必须要做的几件事(一)--基础应用篇
- 电机电缆M12航空插头
- 关于x86、x86_64、x64、amd64和arm64、aarch64
- 北京科技大学计算机专业选课要求,2020年北京科技大学在北京招生专业选科要求对照表...
- 无法加载文件 C:\Users\*****\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。——VScode终端问题解决办法
- nginx出现403错误的解决方法(亲测有效)
- 硬盘分区怎么分?新手该如何操作?
- 猜数字(Bulls and Cows)游戏