当前位置:网站首页>Stress - system pressure simulation tool
Stress - system pressure simulation tool
2022-06-12 12:09:00 【Just want to call Yoko】
Welcome to my personal website for a better typesetting experience : https://pengrl.com/p/42434/ (stress - System pressure simulation tool | yoko blog)
Preface
stress It is a tool for deliberately creating system pressure . It provides a series of parameters for configuring how to make CPU, Memory ,IO operation , Disk pressure .
install
# centos platform
$yum install epel-release
$yum install stress
Parameter description
-c, --cpu N
spawn N workers spinning on sqrt()
start-up n individual worker Loop execution sqrt Calculation , Used to simulate cpu Type process
-i, --io N
spawn N workers spinning on sync()
Loop execution sync, simulation io Type process
-m, --vm N
spawn N workers spinning on malloc()/free()
Cycle call malloc and free Apply and release memory
--vm-bytes B
malloc B bytes per vm worker (default is 256MB)
How much memory is requested each time
--vm-stride B
touch a byte every B bytes (default is 4096)
One byte is forced to be read and written for every number of bytes , Avoid the application release of empty operation being optimized
--vm-hang N
sleep N secs before free (default none, 0 is inf)
How long will the application be released
--vm-keep
redirty memory instead of freeing and reallocating
Apply for release only once
-t, --timeout N
timeout after N seconds
How many seconds to execute before exiting the program
.
.
.
stress Medium worker All of them are implemented through multiple processes , Every worker Is an independent child process .
Use scenarios
Examples of simulating various scenarios
# 8 individual cpu Type process ,4 individual io Type process ,2 A process that constantly requests to free memory , Every time you apply 128M Size memory ,10 After exit stress Program
$stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
simulation cpu application
# Turn on 1 individual cpu Type process
$stress -c 1 -t 600
# Turn on 8 individual cpu Type process
$stress -c 8 -t 600
simulation io application
$stress -i 1 -t 600
other
About -i Parameter cannot simulate io High scene
This is because strss Is called by a loop sync Function to simulate io High scene .sync The function of is to write the buffer of all changes to the file to the file system .
However, if the system has little buffer for file changes , Then you can't simulate io High scene .
in addition , Because it is an endless loop call sync The function called by this system will cause cpu sys elevated .
sync Function description : sync(2): commit buffer cache to disk - Linux man page
About implementation
stress The amount of code is small , only one 760 Yes c file , If you are interested or do not understand the parameters, you can directly look at the code .
There is a download link in the following page : stress project page
Reference link
stress(1): impose load on/stress test systems - Linux man page (https://linux.die.net/man/1/stress)
Linux stress command - sparkdev - Blog Garden (https://www.cnblogs.com/sparkdev/p/10354947.html)
Linux Stress testing software Stress Use guide - Beauty of operation and maintenance (https://www.hi-linux.com/posts/59095.html)
System technology is not amateur research - Give you the Linux On the system stress (http://blog.yufeng.info/archives/2023)
Linux Pressure test tools stress The parameters of - 51CTO.COM (http://os.51cto.com/art/201507/485967.htm)
边栏推荐
- 机器学习之线性模型
- 如何确定首页和搜索之间的关系呢?首页与搜索的关系
- TinyMCE series (II) TinyMCE plug-in development
- 树的前序,中序,后序遍历
- 点击产生4位随机数,验证码设置
- How to select standard products and non-standard products, the importance of selection, and how to layout the store
- Automatic generation of folder directory structure
- 第六章 数据类型(五)
- 【Leetcode】416. Split equal sum subset
- Preliminary study on Regional Simulation of crop model
猜你喜欢

無重複字符的最長字符串(LeetCode 3)

IP地址管理

5G NR協議學習--TS38.211下行通道

创建Servlet项目

Dom+js+ carousel map + no time

QT添加QObject类(想使用信号和槽)遇到的问题汇总,亲测解决有效error: undefined reference to `vtable for xxxxxx(你的类名)‘

Cookies and sessions

无重复字符的最长字符串(LeetCode 3)

Open source project - (erp+ Hotel + e-commerce) background management system

【深度学习基础】神经网络的学习(4)
随机推荐
Jump instruction of arm instruction set
Node crawler puppeter usage
ARP protocol data processing process of neighbor subsystem
A. Prefix range
Promise understanding has used promise to realize picture preloading (sequential loading)
【QNX Hypervisor 2.2 用户手册】4 构建QNX Hypervisor系统
for in 与Object.keys()的区别
MVC mode, encryption, jsonwebtoken
mysql复习
TinyMCE series (III) introduction to common TinyMCE APIs
[foundation of deep learning] back propagation method (1)
Why is there no traffic after the launch of new products? How should new products be released?
AutoLock 解决加锁后忘记解锁问题
Chapter VI data type (V)
Video JS library uses custom components
Visio 2019 uses PJ
Chaîne la plus longue sans caractères dupliqués (leetcode 3)
QML学习 第一天
ARM指令集之Load/Store指令寻址方式(一)
The direction of this