深入理解stressapptest

news2024/9/28 21:19:07

文章目录

  • 一、概述
  • 二、安装
  • 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 names
                          for 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 names
                          for 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.coloradmin.cn/o/1407781.html

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

相关文章

Pytorch线性代数

1、加法运算 A torch.arange(20, dtypetorch.float32).reshape(5, 4) B A.clone() # 通过分配新内存,将A的一个副本分配给B A, A B# tensor([[ 0., 1., 2., 3.], # [ 4., 5., 6., 7.], # [ 8., 9., 10., 11.], # [12., 13.,…

【裁员潮】技术变革下的职业危机,程序员会有多大影响,又应该如何面对

大家好,我是全栈小5,欢迎阅读文章! 此篇是【话题达人】序列文章,这一次的话题是《技术变革下的裁员潮》 文章将以博主的角度进行讲述,理解和水平有限,不足之处,望指正。 目录 背景硬实力职业危机…

Python环境的安装和Pycharm的安装

Python环境的安装 英文版官网:Welcome to Python.org, 因为是外网,加载可能会很慢 首先呢,我们先去官网查找:Python中文网 官网,这个官网是中文版的,点进去之后是这个页面 然后点击下载&#…

【nowcoder】链表的回文结构

牛客题目链接 链表的回文结构 /* struct ListNode {int val;struct ListNode *next;ListNode(int x) : val(x), next(NULL) {} };*/ #include <cstdlib> // 建议大伙自己对照我的代码画下图&#xff0c;假设A链表是&#xff1a;1 2 3 2 1 class PalindromeList { publi…

消息队列RabbitMQ.02.交换机的讲解与使用

目录 RabbitMQ中交换机的基本概念与作用解析 交换机的作用&#xff1a; 交换机的类型&#xff1a; 直连交换机&#xff08;Direct Exchange&#xff09;&#xff1a; 将消息路由到与消息中的路由键&#xff08;Routing Key&#xff09;完全匹配的队列。 主题交换机&#x…

【计算机网络】UDP协议与TCP协议

文章目录 一、端口号1.什么是端口号2.端口号范围划分3.认识知名端口号(Well-Know Port Number)4.netstat5.pidof 二、UDP协议1.UDP协议端格式2.UDP的特点3.面向数据报4.UDP的缓冲区5.UDP使用注意事项6.基于UDP的应用层协议 三、TCP协议1.TCP协议段格式1.1理解封装解包和分用1.2…

数据结构(C语言版)代码实现(三)——单链表部分代码实现

目录 格式 头文件 宏定义 线性表的单链表存储结构 按位查找 插入元素 删除元素 头插法建立单链表 合并非递减单链表 其他基本操作 完整版 测试代码&#xff08;主函数&#xff09; 测试结果 格式 参考 2.3节 线性表的链式表示和实现 头文件 宏定义 #pragma onc…

安卓移动设备使用DS file文件管理工具远程访问本地群晖NAS文件

文章目录 1. 群晖安装Cpolar2. 创建TCP公网地址3. 远程访问群晖文件4. 固定TCP公网地址5. 固定TCP地址连接6. 结语 DS file 是一个由群晖公司开发的文件管理应用程序&#xff0c;主要用于浏览、访问和管理存储在群晖NAS&#xff08;网络附加存储&#xff09;中的文件。这个应用…

小模型也能COT

前两章我们分别介绍了COT的多种使用方法以及COT的影响因素。这一章更多面向应用&#xff0c;既现实场景中考虑成本和推理延时&#xff0c;大家还是希望能用6B的模型就不用100B的大模型。但是在思维链基础和进阶玩法中反复提到不论是few-shot还是zero-shot的思维链能力似乎都是1…

‘cnpm‘ 不是内部或外部命令,也不是可运行的程序

一、问题 昨天用npm 安装环境&#xff0c;实在太慢了&#xff0c;就想用cnpm&#xff0c;然后发现提示‘cnpm 不是内部或外部命令,也不是可运行的程序。 看了很多方法&#xff0c;选择了下面这个&#xff0c;运气好到爆棚&#xff0c;就直接可以用了。其他的方法暂未去了解。先…

【极数系列】Flink 初相识(01)

# 【极数系列】Flink 初相识&#xff08;01&#xff09; 引言 Flink官网&#xff1a;https://flink.apache.org/ Flink版本&#xff1a;https://flink.apache.org/blog/ Flink文档&#xff1a;https://ci.apache.org/projects/flink/flink-docs-release-1.12/ Flink代码库…

shell脚本-条件测试、

一.条件测试 1.&#xff08; &#xff09; 和 { } &#xff08;&#xff09;会进/data ,开启子shell { } 直接切过去了&#xff0c;不开子shell 小案例&#xff1a; 2. test 命令 测试特定的表达式是否成立&#xff0c;当条件成立&#xff0c;测试语句的返回值为0&#xff…

[BUG] Authentication Error

前言 给服务器安装了一个todesk&#xff0c;但是远程一直就是&#xff0c;点击用户&#xff0c;进入输入密码界面&#xff0c;还没等输入就自动返回了 解决 服务器是无桌面版本&#xff0c;或者桌面程序死掉了&#xff0c;重新安装就好 sudo apt install xorg sudo apt inst…

PIL笔记:通道+模式+坐标系统+基本图像操作

PIL Python Imaging Library&#xff0c;Python的图像处理核心库 通道bands 灰度图片是单通道组成 彩色图片是三通道RGB组成 真彩色图片是四通道RGBA组成 模式 RGB RGBA … 坐标系统 左上角为原点(0, 0) 图像操作 显示图像 show 创建图像 open()打开图像new()创建I…

嵌入式学习-C++-Day1

嵌入式学习-CDay1 一、思维导图 二、作业 1.提示并输入一个字符串&#xff0c;统计该字符中大写、小写字母个数、数字个数、空格个数以及其他字符个数&#xff08;要求使用C风格字符串完成&#xff09; #include <iostream> #include <string.h>using namespace…

shopee母婴选品:Shopee平台上进行母婴类目的选品

在Shopee平台上进行母婴类目的选品时&#xff0c;卖家可以通过一些策略来提高产品的市场竞争力和销售业绩。下面将详细介绍这些策略。 先给大家推荐一款shopee知虾数据运营工具知虾免费体验地址&#xff08;复制浏览器打开&#xff09;&#xff1a;D。dDqbt。Com/JU5o知虾是Sh…

考研C语言刷题基础篇之分支循环结构基础(二)

目录 第一题分数求和 第二题&#xff1a;求10 个整数中最大值 第三题&#xff1a;在屏幕上输出9*9乘法口诀表 第四题&#xff1a;写一个代码&#xff1a;打印100~200之间的素数 第五题&#xff1a;求斐波那契数的第N个数 斐波那契数的概念&#xff1a;前两个数相加等于第三…

3.Eureka注册中心

3.Eureka注册中心 假如我们的服务提供者user-service部署了多个实例&#xff0c;如图&#xff1a; 大家思考几个问题&#xff1a; order-service在发起远程调用的时候&#xff0c;该如何得知user-service实例的ip地址和端口&#xff1f;有多个user-service实例地址&#xff0…

git clone报错 fatal: unable to fork

1. 问题 git clone gitgithub.com:url-kaist/Quatro.git Cloning into Quatro... fatal: unable to fork 在使用Docker clone 代码时报错 2. 解决方法 查看是否安装openssh&#xff0c; 用以下命令查看系统是否已安装OpenSSH&#xff0c;如果有openssh-client和openssh-serve…

Oracle、MySQL数据库常规命令语法-简易记录(非常规持续更新)

前言:呈现的是非常基础必备命令以及常规关联语法,因涉及到不同数据库其表达都会有所区别,此篇纯属做个仓库记录更非常规持续更新,专业人士可忽略,且看且珍惜… MySQL: 关系型数据库、重点开源、支持大型规模、标准SQL数据语言、多平台多架构、高可用集群、可定制开发等…