stressapptest使用介绍【转】

摘要:
但是,连接可以通过墙进行,应使用代理。目标是尽可能多地加载系统内存,以便更有效地进行测试。谷歌表示,与其他内存诊断程序相比,与五分之一内存模块相关的系统错误只能通过stressapptest找到。背景许多硬件问题都是以询问方式复制的,或仅在角盒下复制。这里使用的理论是,通过最大化总线和内存流量,事务的数量会增加,交付事务的概率也会增加。

转自:https://blog.csdn.net/vichie2008/article/details/50457566

stressapptest 其是:Stressful Application Test (stressapptest) 的简称

Stressful Application Test试图让来自处理器和I/O到内存的数据尽量随机化,以创造出模拟现实的环境来测试现在的硬件设备是否稳定,Google就在使用它,现在是Apache 2.0许可,这里有介绍安装向导指南(http://code.google.com/p/stressapptest/wiki/InstallationGuide)。不过连接可能被墙,要用代理上。

其大概如下:

 

stressapptest may be used for various purposes:

  • Stress test: as described here.             压力测试
  • Hardware qualification and debugging.  硬件检查和调试
  • Memory interface test: see the Theory behind this. 内存接口测试
  • Disk testing. 磁盘测试
据谷歌的介绍,这个软件会生产线程来拷贝和直接对磁盘进行读取和写入。目标则是尽可能地载入系统内存,以便更加有效地进行测试。该软件更多的时候测试的是内存控制器和总线接口,而不是存储单元的功能。谷歌称,与其他内存诊断程序的比较,五分之一的内存模块相关的系统误差只能通过stressapptest发现。

 

Background

 

Many hardware issues reproduce infrequently, or only under corner cases. The theory being used here is that by maximizing bus and memory traffic, the number of transactions is increased, and therefore the probability of failing a transaction is increased.    这个测试会最大化总线和内存的交换量,从而交换失败的概率也会增加。

Overview

stressapptest is a userspace test, primarily composed of threads doing memory copies and direct IO disk read/write. It allocates a large block of memory (typically 85% of the total memory on the machine), and each thread will choose randomized blocks of memory to copy, or to write to disk. Typically there are two threads per processor, and two threads for each disk. Result checking is done as the test proceeds by CRCing the data as it is copied. 该软件采用多线程对内存进行拷贝和磁盘接口读写,占用了85%的内存块,而且每个线程都是随机进行的读写操作,一般每个处理器2个线程,磁盘也是;

Downloading it

stressapptest can be download at http://code.google.com/p/stressapptest/downloads

Detailed Design

The code is structured fairly simply: 代码结构简单

  • A large amount of memory is allocated in a single block (default is 85% of physical memory size). 每个数据块都占用到了大量内存资源
  • Memory is divided into chunks, each filled with a potentially stressful data pattern.  内存被分成了许多块,每块都覆盖了对应大量的数据;
  • Worker threads are spawned, which draw pages from an "empty" queue and a "valid" queue, and copy the data from one block to the other.
    • Some threads memory copy the data.   一些线程负责数据拷贝
    • Some threads invert the data in place. 一些线程负责数据插入
    • Some threads write the data to disk, and read it to the new location. 一些线程负责数据写入和读出
  • After the specified time has elapsed, all "valid" pages have their data compared with the original fill pattern.  超过设定的时间,就会与初始数据进行比较

Caveats 警告

This test works by stressing system interfaces. It is good at catching memory signal integrity or setup and hold problems, memory controller and bus interface issues, and disk controller issues. It is moderately good at catching bad memory cells and cache coherency issues. It is not good at catching bad processors, bad physical media on disks, or problems that require periods of inactivity to manifest themselves. It is not a thorough test of OS internals. The test may cause marginal systems to become bricks if disk or memory errors cause hard drive corruption, or if the physical components overheat.

该软件在测试系统接口方面比较好,可以评估一些内存信号完整性或内存芯片,接口总线及磁盘方面的情况;但是对已经损坏的处理器,物理存储设备不具有检查功能,在该条件下测试,可能会导致系统或驱动崩溃,以及芯片过热。

Security Considerations

Someone running stressapptest on a live system could cause other applications to become extremely slow or unresponsive.  测试中会导致系统反应变慢

Logged information

stressapptest can output a logfile of miscompares detected during its execution. stressapptest cannot yet log reboot failures, or other failures not visible to user space.

整个执行过程可以输出日志记录文件。

 

下面介绍下其简单的使用过程,由于本人使用的平台不是很支持该软件,所以具体的其它功能和详细说明不好书写和记录。

1、下载该文件包:stressapptest_1.0.4.orig.tar.gz

2、tar -xvf  stressapptest_1.0.4.orig.tar.gz

3、进入该文件夹然后:

 

<span class="pun">./</span><span class="pln">configure
make
sudo make install</span>
配置过程中可能会报错,缺少某些库,例如: libaio.a, librt.a (libaio.a: libaio-dev librt.a: libc6-dev);只需在网上查找下对应的库文件,然后连网更新下载便可,然后再编译,一般都可以通过;

 

也有可能cpu支持不同,如出现下述情况:

 

[python] view plaincopy
 
  1. root@LOonux:~/test/stressapptest-1.0.4# make  
  2. Making all in src  
  3. make[1]: 正在进入目录 `/root/test/stressapptest-1.0.4/src'  
  4. make  all-am  
  5. make[2]: 正在进入目录 `/root/test/stressapptest-1.0.4/src'  
  6. g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc  
  7. In file included from finelock_queue.h:29,  
  8.                     from sat.h:28,  
  9.                                      from main.cc:18:  
  10.                                      os.h:131:4: warning: #warning "Unsupported CPU type: Unable to force cache flushes."  
  11.                                      os.h:161:4: warning: #warning "Unsupported CPU type: your build may not function correctly"  
  12.                                      mv -f .deps/main.Tpo .deps/main.Po  
  13.                                      g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT os.o -MD -MP -MF .deps/os.Tpo -c -o os.o os.cc  
  14.                                      In file included from os.cc:21:  
  15.                                      os.h:131:4: warning: #warning "Unsupported CPU type: Unable to force cache flushes."  
  16.                                      os.h:161:4: warning: #warning "Unsupported CPU type: your build may not function correctly"  
  17.                                      os.cc:165:2: warning: #warning "Unsupported CPU type: unable to determine feature set."  
  18.                                      mv -f .deps/os.Tpo .deps/os.Po  
目前支持的类型应该有下述三种,否则编译出错:

 

 

[python] view plaincopy
 
  1. case x"$target_cpu" in  
  2.   "xx86_64")  
  3.   
  4. $as_echo "#define STRESSAPPTEST_CPU_X86_64 /**/" >>confdefs.h  
  5.   
  6.     ;;  
  7.   "xi686")  
  8.   
  9. $as_echo "#define STRESSAPPTEST_CPU_I686 /**/" >>confdefs.h  
  10.   
  11.     ;;  
  12.   "xpowerpc")  
  13.   
  14. $as_echo "#define STRESSAPPTEST_CPU_PPC /**/" >>confdefs.h  
  15.   
  16.     ;;  
  17.   "xarmv7a")  
安装完成后,运行该软件,可得记录日志如下:

例如 测试1200M大小的内存,测试300000秒的时间

 

[python] view plaincopy
 
  1. Log: Commandline - ./stressapptest -M 1200 -s 300000  
  2. Stats: SAT revision 1.0.1_autoconf32 bit binary  
  3. Log: root @ RAYS-0bedc0f6 on Sun Mar 14 18:59:09 UTC 2010 from open source release  
  4. Log: 1 nodes, 4 cpus.  
  5. Log: Defaulting to 4 copy threads  
  6. Log: Flooring memory allocation to multiple of 41200MB  
  7. Log: Using memaligned allocation at 0x2b4d9000.  
  8. Stats: Starting SAT, 1200M300000 seconds  
  9. Log: Region mask: 0x1  
  10. Log: Seconds remaining: 299990  
  11. Log: Seconds remaining: 299980  
  12. Log: Seconds remaining: 299970  
  13. Log: Seconds remaining: 299960  
  14. Log: Seconds remaining: 299950  
  15. Log: Seconds remaining: 299940  
  16. Log: Seconds remaining: 299930  
  17. Log: Seconds remaining: 299920  
  18. Log: Seconds remaining: 299910  
  19. Log: Seconds remaining: 299900  
  20. Log: Seconds remaining: 299890  

免责声明:文章转载自《stressapptest使用介绍【转】》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇linux内核中的链表git 配置多个SSH-Key下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Bluetooth: 抓取手机的HCI log

 必要操作 找到“设置”--“开发者选项”,打开“启用蓝牙HCI信息收集日志”选项: 华为G9 Plus  打开cmd 窗口,输入:adb pull /data/log/bt  稍等片刻,日志就可以抓取出来了,抓取出来的btsnoop log 保存在当前用户的文件夹中(我的保存在C:Users isha_chent 目录下): 然后把后缀名改成cfa...

vue前端工程化

今日目标 1.能够了解模块化的相关规范 2.了解webpack3.了解使用Vue单文件组件4.能够搭建Vue脚手架5.掌握Element-UI的使用 1.模块化的分类 A.浏览器端的模块化 1).AMD(Asynchronous Module Definition,异步模块定义)代表产品为:Require.js2).CMD(Common Module D...

windows命令绕过

windows命令绕过 forfies 使用方式如下: 实际使用: forfiles /c c:windowssystem32calc.exe 确认任务的父进程为forfiles.exe pcalua 实际使用: pcalua.exe -a c:windowssystem32calc.exe 主进程就是运行的进程 SyncAppvPu...

Log4j配置与使用

log4j是Java社区事实上的日志标准解决方案。使用起来比较简单。 一. 简单使用 1.下载jar包放到lib文件夹,并加入到build path中; 2.编写log4j.properties文件,放到classpath目录下; ### set log levels ### log4j.rootLogger = debug , stdout , D...

ORACLE 错误案例—ORA-27102: out of memory

SQL> startupORA-27102: out of memoryLinux-x86_64 Error: 28: No space left on deviceAdditional information: 2097152 [oracle@kingdee-test ~]$ cat /etc/redhat-release CentOS relea...

如何基于 PHP-X 快速开发一个 PHP 扩展

0x01 起步 PHP-X本身基于C++11开发,使用cmake进行编译配置。首先,你需要确定所有依赖项已安装好。包括: gcc-4.8 或更高版本 PHP7.0 或更高版本,需要php7-dev 开发包 cmake-2.8 或更高版本 然后安装PHP-X。 git clone https://github.com/swoole/PHP-X.git c...