怎么使用Linux平台下的压力测试工具stress-ng
发表于:2025-01-21 作者:千家信息网编辑
千家信息网最后更新 2025年01月21日,这篇文章主要讲解了"怎么使用Linux平台下的压力测试工具stress-ng",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"怎么使用Linux平台下的压
千家信息网最后更新 2025年01月21日怎么使用Linux平台下的压力测试工具stress-ng
这篇文章主要讲解了"怎么使用Linux平台下的压力测试工具stress-ng",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"怎么使用Linux平台下的压力测试工具stress-ng"吧!
安装很简单,在CentOS下,通过yum -y install stress-ng即可安装此工具.
安装成功后,执行man stress-ng可查看该工具的帮助信息.
NAME stress-ng - a tool to load and stress a computer system stress-ng是计算机系统进行压力测试的工具.SYNOPSIS stress-ng [OPTION [ARG]] ... 使用方法:stress-ng [OPTION [ARG]] ...DESCRIPTION stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the var‐ ious operating system kernel interfaces. stress-ng also has a wide range of CPU specific stress tests that exercise floating point, integer, bit manipulation and control flow. stress-ng was originally intended to make a machine work hard and trip hardware issues such as thermal overruns as well as operating system bugs that only occur when a system is being thrashed hard. Use stress-ng with caution as some of the tests can make a system run hot on poorly designed hardware and also can cause excessive system thrashing which may be difficult to stop. stress-ng can also measure test throughput rates; this can be useful to observe performance changes across different operating system releases or types of hard‐ ware. However, it has never been intended to be used as a precise benchmark test suite, so do NOT use it in this manner. Running stress-ng with root privileges will adjust out of memory settings on Linux systems to make the stressors unkillable in low memory situations, so use this judiciously. With the appropriate privilege, stress-ng can allow the ionice class and ionice levels to be adjusted, again, this should be used with care. One can specify the number of processes to invoke per type of stress test; speci‐ fying a negative or zero value will select the number of processors available as defined by sysconf(_SC_NPROCESSORS_CONF). stress-ng提供了N中途径对系统进行测试.该工具可运行计算机的各种物理子系统(如CPU/内存/网络等) 以及各种OS内核接口.stress-ng有大量的CPU压力测试方法,包括测试浮点数/整数/位运算和控制流程等. stress-ng的最初目的是给机器加压,通过使系统过载来发现OS的bug.要注意的是,stress-ng在设计不良 的系统中运行可能会系统宕机.OPTIONS General stress-ng control options: ... 详细可参考stress-ng手册.EXAMPLES 使用样例 stress-ng --vm 8 --vm-bytes 80% -t 1h run 8 virtual memory stressors that combined use 80% of the available mem‐ ory for 1 hour. Thus each stressor uses 10% of the available memory. 执行8个虚拟的内存压测器,合计使用80%的可用内存,持续时间1小时,每个压测器约10%的可用内存. stress-ng --cpu 4 --io 2 --vm 1 --vm-bytes 1G --timeout 60s runs for 60 seconds with 4 cpu stressors, 2 io stressors and 1 vm stressor using 1GB of virtual memory. stress-ng --iomix 2 --iomix-bytes 10% -t 10m runs 2 instances of the mixed I/O stressors using a total of 10% of the available file system space for 10 minutes. Each stressor will use 5% of the available file system space. stress-ng --cpu 8 --cpu-ops 800000 runs 8 cpu stressors and stops after 800000 bogo operations. stress-ng --sequential 2 --timeout 2m --metrics run 2 simultaneous instances of all the stressors sequentially one by one, each for 2 minutes and summarise with performance metrics at the end. stress-ng --cpu 4 --cpu-method fft --cpu-ops 10000 --metrics-brief run 4 FFT cpu stressors, stop after 10000 bogo operations and produce a summary just for the FFT results. stress-ng --cpu 0 --cpu-method all -t 1h run cpu stressors on all online CPUs working through all the available CPU stressors for 1 hour. stress-ng --all 4 --timeout 5m run 4 instances of all the stressors for 5 minutes. stress-ng --random 64 run 64 stressors that are randomly chosen from all the available stressors. stress-ng --cpu 64 --cpu-method all --verify -t 10m --metrics-brief run 64 instances of all the different cpu stressors and verify that the computations are correct for 10 minutes with a bogo operations summary at the end. stress-ng --sequential 0 -t 10m run all the stressors one by one for 10 minutes, with the number of instances of each stressor matching the number of online CPUs. stress-ng --sequential 8 --class io -t 5m --times run all the stressors in the io class one by one for 5 minutes each, with 8 instances of each stressor running concurrently and show overall time util‐ isation statistics at the end of the run. stress-ng --all 0 --maximize --aggressive run all the stressors (1 instance of each per CPU) simultaneously, maximize the settings (memory sizes, file allocations, etc.) and select the most demanding/aggressive options. stress-ng --random 32 -x numa,hdd,key run 32 randomly selected stressors and exclude the numa, hdd and key stres‐ sors stress-ng --sequential 4 --class vm --exclude bigheap,brk,stack run 4 instances of the VM stressors one after each other, excluding the bigheap, brk and stack stressors stress-ng --taskset 0,2-3 --cpu 3 run 3 instances of the CPU stressor and pin them to CPUs 0, 2 and 3.
感谢各位的阅读,以上就是"怎么使用Linux平台下的压力测试工具stress-ng"的内容了,经过本文的学习后,相信大家对怎么使用Linux平台下的压力测试工具stress-ng这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
工具
测试
压力
系统
平台
测试工具
内存
学习
内容
方法
计算机
运行
不良
成功
使用方法
信息
内核
子系统
小时
就是
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
docker 数据库安全吗
珠海无限软件开发报价表
网络安全二级和三级的区别
西藏租赁管理软件开发公司
关于互联网快科技的杂志
计算机网络技术与因特网
浙江图书馆显示服务器忙怎么办
学软件开发还是学UI设计
服务器集群部署图
腾讯云25端口邮件服务器
国民经济分类软件开发行业
软件开发如何减压
深圳百盛网络技术有限公司
毒力基因的数据库哪个全
日本软件开发工作室
数据库添加字段乱码
大学慕课数据库系统概论考试答案
网络安全 题库
网络安全算不算热门行业
软件开发多久出结果
浪潮服务器开机启动
一千万用户的app服务器有多大
南邮数据库雨课堂
新一互联网络科技公司
计算机网络技术山东春考
东城区大规模软件开发怎么样
专业健身软件开发
济源学习软件开发
软件开发项目经理要多少钱
物流软件开发正式完整版