深入理解stressapptest

文章目录

  • 一、概述
  • 二、安装
  • 2.1、源码编译安装
  • 2.2、命令行安装
  • 2.3、安装确认
  • 三、重要参数详解
    • 3.1、查询支持的参数
    • 3.2、参数说明
  • 四、实例
    • 4.1、随机测试(默认模式)
    • 4.2、循环测试
    • 4.2、全内存测试


  团队博客: 汽车电子社区


一、概述

  stressapptest是一款免费的开源软件,支持用于测试Linux系统的稳定性和可靠性。它可以利用多个CPU/Core,甚至可以访问主内存的所有部分来测试系统的稳定性,以此推断系统是否存在内存泄漏或其他性能方面的问题。

  stressapptest的主要目标是发现难以重现的系统稳定性问题和其他体现在Java虚拟机、KVM Hypervisor和Hadoop集群等普通用例中的Linux系统中的性能问题。它还包括多个测试模式和选项以支持不同测试场景,比如随机测试、循环测试、全内存测试、持续测试等。

二、安装

2.1、源码编译安装

// 1.下载源码
git clone https://github.com/stressapptest/stressapptest.git
cd stressapptest
./configure
make
sudo make install

2.2、命令行安装

  Ubuntu下执行如下命令进行安装:

sudo apt-get install stressapptest

在这里插入图片描述

2.3、安装确认

  执行如下命令来确认stressapptest 是否安装成功:

stressapptest -h
lyb@ubuntu:~/learn$ stressapptest -h
Stats: SAT revision 1.0.6_autoconf, 64 bit binary
Log: buildd @ lgw01-amd64-022 on Thu Apr  5 10:28:35 UTC 2018 from open source release
Usage: ./sat(32|64) [options]-M mbytes        megabytes of ram to test-H mbytes        minimum megabytes of hugepages to require-s seconds       number of seconds to run-m threads       number of memory copy threads to run-i threads       number of memory invert threads to run-C threads       number of memory CPU stress threads to run--findfiles      find locations to do disk IO automatically-d device        add a direct write disk thread with block device (or file) 'device'-f filename      add a disk thread with tempfile 'filename'-l logfile       log output to file 'logfile'--max_errors n   exit early after finding 'n' errors-v level         verbosity (0-20), default is 8-W               Use more CPU-stressful memory copy-A               run in degraded mode on incompatible systems-p pagesize      size in bytes of memory chunks--filesize size  size of disk IO tempfiles-n ipaddr        add a network thread connecting to system at 'ipaddr'--listen         run a thread to listen for and respond to network threads.--no_errors      run without checking for ECC or other errors--force_errors   inject false errors to test error handling--force_errors_like_crazy   inject a lot of false errors to test error handling-F               don't result check each transaction--stop_on_errors  Stop after finding the first error.--read-block-size     size of block for reading (-d)--write-block-size    size of block for writing (-d). If not defined, the size of block for writing will be defined as the size of block for reading--segment-size   size of segments to split disk into (-d)--cache-size     size of disk cache (-d)--blocks-per-segment  number of blocks to read/write per segment per iteration (-d)--read-threshold      maximum time (in us) a block read should take (-d)--write-threshold     maximum time (in us) a block write should take (-d)--random-threads      number of random threads for each disk write thread (-d)--destructive    write/wipe disk partition (-d)--monitor_mode   only do ECC error polling, no stress load.--cc_test        do the cache coherency testing--cc_inc_count   number of times to increment the cacheline's member--cc_line_count  number of cache line sized datastructures to allocate for the cache coherency threads to operate--paddr_base     allocate memory starting from this address--pause_delay    delay (in seconds) between power spikes--pause_duration duration (in seconds) of each pause--local_numa     choose memory regions associated with each CPU to be tested by that CPU--remote_numa    choose memory regions not associated with each CPU to be tested by that CPU--interleave_size bytes  size in bytes of each channel's data as interleaved between memory channels--channel_width bits     width in bits of each memory channel--memory_channel u1,u2   defines a comma-separated list of namesfor dram packages in a memory channel.Use multiple times to define multiple channels.
lyb@ubuntu:~/learn$ 

三、重要参数详解

3.1、查询支持的参数

  执行如下命令来确认stressapptest支持的参数:

stressapptest -h
lyb@ubuntu:~/learn$ stressapptest -h
Stats: SAT revision 1.0.6_autoconf, 64 bit binary
Log: buildd @ lgw01-amd64-022 on Thu Apr  5 10:28:35 UTC 2018 from open source release
Usage: ./sat(32|64) [options]-M mbytes        megabytes of ram to test-H mbytes        minimum megabytes of hugepages to require-s seconds       number of seconds to run-m threads       number of memory copy threads to run-i threads       number of memory invert threads to run-C threads       number of memory CPU stress threads to run--findfiles      find locations to do disk IO automatically-d device        add a direct write disk thread with block device (or file) 'device'-f filename      add a disk thread with tempfile 'filename'-l logfile       log output to file 'logfile'--max_errors n   exit early after finding 'n' errors-v level         verbosity (0-20), default is 8-W               Use more CPU-stressful memory copy-A               run in degraded mode on incompatible systems-p pagesize      size in bytes of memory chunks--filesize size  size of disk IO tempfiles-n ipaddr        add a network thread connecting to system at 'ipaddr'--listen         run a thread to listen for and respond to network threads.--no_errors      run without checking for ECC or other errors--force_errors   inject false errors to test error handling--force_errors_like_crazy   inject a lot of false errors to test error handling-F               don't result check each transaction--stop_on_errors  Stop after finding the first error.--read-block-size     size of block for reading (-d)--write-block-size    size of block for writing (-d). If not defined, the size of block for writing will be defined as the size of block for reading--segment-size   size of segments to split disk into (-d)--cache-size     size of disk cache (-d)--blocks-per-segment  number of blocks to read/write per segment per iteration (-d)--read-threshold      maximum time (in us) a block read should take (-d)--write-threshold     maximum time (in us) a block write should take (-d)--random-threads      number of random threads for each disk write thread (-d)--destructive    write/wipe disk partition (-d)--monitor_mode   only do ECC error polling, no stress load.--cc_test        do the cache coherency testing--cc_inc_count   number of times to increment the cacheline's member--cc_line_count  number of cache line sized datastructures to allocate for the cache coherency threads to operate--paddr_base     allocate memory starting from this address--pause_delay    delay (in seconds) between power spikes--pause_duration duration (in seconds) of each pause--local_numa     choose memory regions associated with each CPU to be tested by that CPU--remote_numa    choose memory regions not associated with each CPU to be tested by that CPU--interleave_size bytes  size in bytes of each channel's data as interleaved between memory channels--channel_width bits     width in bits of each memory channel--memory_channel u1,u2   defines a comma-separated list of namesfor dram packages in a memory channel.Use multiple times to define multiple channels.
lyb@ubuntu:~/learn$ 

3.2、参数说明

  选项说明:
    -s或–timeout: 指定测试运行的总时间,以秒为单位。默认值为0(无限制)。
    -M或–vm-bytes: 指定应用程序所需的内存量,以字节、千字节、兆字节或吉字节为单位。例如,“-M 2048m”表示分配2GB的内存。默认值为0(自动计算)。
    -m或–vm-pattern: 指定要使用的内存模式,如线性、随机、步进等。默认值为“linear”(线性)。
    -c或–cpu-cores: 指定要使用的CPU核心数。例如,“-c 4”将在四个核心上运行测试。默认值为0(使用所有可用核心)。
    –affinity: 将应用程序绑定到指定的CPU核心上,以避免跨核心调度带来的额外开销。例如,“–affinity 0,2,4”将绑定应用程序到第1、3和5个CPU核心上。
    –matrix: 启用矩阵测试模式,该模式可以对整个系统进行更全面的测试,并且需要更长时间才能完成。
    –quiet: 禁止输出详细信息和统计数据,只显示结果摘要信息。
    –log-level: 设置日志级别,以控制输出详细程度。可选值为”debug”、”info”、”warning”、”error”和”critical”。
    –log-file: 将日志输出到指定的文件中,而不是标准输出。
    –version: 显示stressapptest版本信息并退出。

四、实例

4.1、随机测试(默认模式)

  随机模式是stressapptest的默认模式,它会随机访问系统内存中的所有部分来测试系统的稳定性。可以通过以下命令启动:

stressapptest

在这里插入图片描述

4.2、循环测试

  循环模式是stressapptest的另一种模式,它会在指定的时间内不断迭代相同的内存模式。可以使用以下命令启动:

stressapptest -M 100 -s 128 -C 16 -c 8

在这里插入图片描述

4.2、全内存测试

  全内存模式会尝试占用所有可用的空闲内存。可以使用以下命令启动:
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/651733.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C++重新入门-内联函数

C中的内联函数是一种优化手段,用于减少函数调用的开销。内联函数的主要特点是在调用处将函数体的代码直接插入,而不是通过函数调用的方式执行。这样可以避免函数调用的开销,但也有一些限制和注意事项。 1.内联函数的定义 在函数定义前面加上…

HCIA-HarmonyOS设备开发认证-2.设备开发入门

目录 HarmonyOS设备开发学习路径一、开发项目与工具介绍1.1、设备开发环境准备1.2、设备开发流程1.3、Huawei DevEco Device Tool 二、OpenHarmony介绍OpenHarmony目录结构详细介绍applications目录详解base目录详解foundation目录详解 OpenHarmony接口分层介绍CMSIS 和 POSIX …

[每日一题] 01.27 - 斐波那契数列

文章目录 打分斐波那契数列 打分 n int(input()) lis list(map(int,input().split())) a sum(lis) - min(lis) - max(lis) print(round(a / (n - 2),2))斐波那契数列 n int(input()) res [] for i in range(n):res.append(int(input()))Max max(res) lis [1,1] for i in…

编译nginx

例如查看pcre是否安装: dpkg -l | grep pcre解决依赖包openssl安装,命令: sudo apt-get install openssl libssl-dev解决依赖包pcre安装,命令: sudo apt-get install libpcre3 libpcre3-dev解决依赖包zlib安装&…

nodejs学习计划--(七)express框架

express框架 1. express介绍 express 是一个基于 Node.js 平台的极简、灵活的 WEB 应用开发框架,官方网址:https://www.expressjs.com.cn/ 简单来说,express 是一个封装好的工具包,封装了很多功能,便于我们开发 WEB …

Java中的运算符-算数运算符(/,%,+,++)

目录 运算符算数运算符除法 取余运行结果实例测试 的作用的作用测试结果 运算符 算法符号算术运算符,-,*,/,%,(自增),–(自减)赋值运算符扩展赋值运算符&…

Qt WebEngine模块使用(开发环境安装和程序开发)

一、Qt WebEngine Qt WebEngine_hitzsf的博客-CSDN博客 Qt WebEngine模块提供了一个Web浏览器引擎,可以轻松地将万维网上的内容嵌入到没有本机Web引擎的平台上的Qt应用程序中。Qt WebEngine提供了用于渲染HTML,XHTML和SVG文档的C 类和QML类型&#xff…

LeetCode:376.摆动序列

个人主页:仍有未知等待探索-CSDN博客 专题分栏:算法_仍有未知等待探索的博客-CSDN博客 题目链接:376. 摆动序列 - 力扣(LeetCode) 一、题目 如果连续数字之间的差严格地在正数和负数之间交替,则数字序列称…

华为机试真题实战应用【赛题代码篇】-连续字符最大次数(附Java和C++代码)

目录 问题描述 代码实现 Java 代码2 C++ 问题描述 输入一串字符串 字符串长度不超过100 查找字符串中相同字符连续出现的最大次数 输入描述 输入只有一行,包含一个长度不超过100的字符串 输出描述 输出只有一行,输出相同字符串连续出现的最大次数 说明:…

146基于matlab的齿轮非线性动力学

基于matlab的齿轮非线性动力学,绘出系统状态变量随参数变化分岔图,绘图参数对应的系统各周期及混沌状态的时间历程图、相轨迹图、Poincare映射图,程序已调通,可直接运行。 146 matlab 齿轮非线性动力学 相图 (xiaohongshu.com)

程序设计与数据结构课程实训报告——回家之旅

回家之旅 1.问题描述 春运买票困难,有乘客想出多次中转的办法解决。试图用你学习到的数据结构与算法知识,帮助有需要的人规划回家的路线。 假设给定列车时刻信息表(包含票价情况),任意输入起点站和终点站(如广州到兰州),规划满足以…

力扣516. 最长回文子序列

动态规划 思路: 字符串最长回文子序列问题可以转换为原字符串 s 和逆串 s 的最长公共子序列长度问题,具体推断过程可以参考 力扣1312. 让字符串成为回文串的最少插入次数问题变成了求两个字符串最长公共子序列长度问题,具体思路可以参考 力扣…

Win32 PE图标资源提取(ICO图标提取)

最近需要写一个提取EXE或者DLL图标资源的功能, 网上找了很久, 要么功能不好用, 最后结果如下: 1.很多是加载为HICON句柄后转换为图片保存, 全损画质..., 2.后来找了个还能用的, 详见 https://github.com/TortoiseGit/TortoiseGit/blob/master/src/Utils/IconExtractor.cpp …

cenos8.5快速部署开发环境(LAMP)

Apache 安装apache yum -y install httpd httpd-manual mod_ssl mod_perl 重启服务,设置自启动 systemctl start httpd systemctl enable httpd 查看apache运行状态 systemctl status httpd MySQL 下载MySQL wget http://dev.mysql.com/get/mysql57-community-re…

第十二届“中关村青联杯”全国研究生数学建模竞赛-D题:面向节能的单/多列车优化决策问题

目录 摘 要: 1 问题重述 1.1 问题背景 1.2 本文所需解决的问题 2 问题假设

前端——HTML

目录 文章目录 前言 一.HTML的基本标签 二.HTML标签 1.块级标签 1.1块级标签特征 1.2标题标签 ​编辑 1.3 水平线标签 1.4 段落标签 1.5 无序列表标签 1.6 有序列表标签 1.7 表格标签 1.8层标签 1.9 表单 2. 行级标签 2.1行级标签特征 2.2图像标签 2.3 范围…

阿里云云数据库RDS

1. 请简述阿里云云数据库RDS的主要特点和优势? 阿里云云数据库RDS的主要特点和优势包括高可用性、强大的扩展性、性能优化、灵活的备份与恢复功能以及专业的技术支持等。 具体来说,以下是阿里云RDS的一些关键优势: 高可用性和可靠性&#…

Leetcode刷题笔记题解(C++):1971. 寻找图中是否存在路径

思路: 1.建立图集,二维数组,path[0]里面存放的就是与0相连的节点集合 2.用布尔数组来记录当前节点是否被访问过,深度优先会使用到 3.遍历从起点开始能直接到达的点(即与起点相邻的点),判断那…

Centos9使用chrony服务同步时间

安装chrony命令 Centos9里是预安装的,没有安装的话执行以下命令: yum install -y chronyCentos9 时间同步要使用chrony命令,ntp命令没有了 查看状态 #启用chronyd服务 systemctl enable chronyd#重启chronyd服务 systemctl restart chron…

操作系统(5)-----操作系统进程相关

目录 一.进程的组成 1.PCB(进程控制块) 2.程序段与数据段 二.进程的特征 三.进程的状态以及状态的转换 四.进程的组织 1.链接方式 2.索引方式 五.进程控制 六.进程控制相关原语 1.创建原语 2.撤销原语 3.阻塞原语 4.唤醒原语 5.切换原语 …