Linux command – Stressful Application Test

Stressful Application Test (stressapptest) 程式可以在 memory 到 processor 與 I/O 之間產生大量的隨機流量,主要用於模擬系統在高負載情況下的壓力測試,他現在屬於 apache 2.0 license.連 google 也使用這工具是確保系統在高負載下的穩定性.

測試環境為 Ubuntu16.04 64bits,從 apt-get 就可以安裝.

root@ubuntu:~# apt-get install stressapptest

Reading package lists... Done

Building dependency tree      

Reading state information... Done

The following packages were automatically installed and are no longer required:

  linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic

  linux-image-4.4.0-59-generic linux-image-extra-4.4.0-59-generic

Use 'apt autoremove' to remove them.

The following NEW packages will be installed:

  stressapptest

0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.

Need to get 127 kB of archives.

After this operation, 377 kB of additional disk space will be used.

Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 stressapptest amd64 1.0.6-2 [127 kB]

Fetched 127 kB in 2s (42.4 kB/s)       

Selecting previously unselected package stressapptest.

(Reading database ... 243155 files and directories currently installed.)

Preparing to unpack .../stressapptest_1.0.6-2_amd64.deb ...

Unpacking stressapptest (1.0.6-2) ...

Processing triggers for man-db (2.7.5-1) ...

Setting up stressapptest (1.0.6-2) ...

如果是在 CentOS 7 下可以透過官方網站 https://github.com/stressapptest/stressapptest ,或是透過 git 下載後編譯來使用.

[root@localhost Downloads]# git clone https://github.com/stressapptest/stressapptest.git

Cloning into 'stressapptest'...

remote: Counting objects: 277, done.

remote: Total 277 (delta 0), reused 0 (delta 0), pack-reused 277

Receiving objects: 100% (277/277), 317.75 KiB | 264.00 KiB/s, done.

Resolving deltas: 100% (187/187), done.

[root@localhost Downloads]# cd stressapptest

[root@localhost stressapptest]# ./configure

configure: Compiling with dynamically linked libraries.

checking build system type... x86_64-pc-linux-gnu

checking host system type... x86_64-pc-linux-gnu

...

[root@localhost stressapptest]# make

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /root/Downloads/stressapptest/missing --run aclocal-1.11

...

[root@localhost stressapptest]# make install

官方網站說明 stressapptest 適合用於下列幾種測試

  • Stress test: 壓力測試
  • 可當作硬體的驗證與除錯工具
  • 記憶體測試.
  • 硬碟測試.

先來看一下 stressapptest 給的範例 ,測試 256MB 的記憶體 20 秒 並使用參數 8 “warm copy” threads, 以及 8 cpu load threads.

root@ubuntu:~# stressapptest -s 20 -M 256 -m 8 -C 8 -W

Log: Commandline - stressapptest -s 20 -M 256 -m 8 -C 8 -W

Stats: SAT revision 1.0.6_autoconf, 64 bit binary

Log: buildd @ kapok on Wed Jan 21 17:09:35 UTC 2015 from open source release

Log: 1 nodes, 1 cpus.

Log: Prefer plain malloc memory allocation.

Log: Using memaligned allocation at 0x7ff70959c000.

Stats: Starting SAT, 256M, 20 seconds

Log: Region mask: 0x1

Log: Seconds remaining: 10

Stats: Found 0 hardware incidents

Stats: Completed: 132896.00M in 28.31s 4694.65MB/s, with 0 hardware incidents, 0 errors

Stats: Memory Copy: 132896.00M at 6588.09MB/s

Stats: File Copy: 0.00M at 0.00MB/s

Stats: Net Copy: 0.00M at 0.00MB/s

Stats: Data Check: 0.00M at 0.00MB/s

Stats: Invert Data: 0.00M at 0.00MB/s

Stats: Disk: 0.00M at 0.00MB/s

Status: PASS - please verify no corrected errors

使用的參數:

  • -s seconds : Number of seconds to run
  • -M mbytes : Megabytes of ram to test
  • -m threads : Number of memory copy threads to run
  • -C threads : Number of memory CPU stress threads to run.
  • -W : Use more CPU-stressful memory copy

要將結果導成檔案可以使用參數 -l 想要知道更多的測試結果可以自行調整 verbosity 值.

  • -l logfile : log output to file ‘logfile’ (none)
  • -v level : verbosity (0-20) (default: 8)

看一下執行結果

Stats: Completed: 263982.00M in 20.00s 13197.76MB/s, with 0 hardware incidents, 0 errors

Stats: Memory Copy: 263982.00M at 13200.27MB/s

可以看到只有 Memoey 有流量,其他如 File Copy, Net Copy, Data Check, Invert Data, Disk 皆為 0 .其他流量要如何產生呢!

  • File Copy , Disk – http://benjr.tw/96762
    File 與 Disk 都是透過硬碟來跟記憶體做存取,不同的是 Disk 是直接使用 RAW Disk 做存取, File 需要在格式化的硬碟空間才能使用.
  • Net Copy – http://benjr.tw/96766
    可以透過網路來進行測試,需要使用兩台機器來測試外部網路,或是單機的內部網路.
  • Data Check , Invert Data – http://benjr.tw/96776
    用來測試記憶體,一般的 thread 會將資料從一個區塊複製到另一個區塊 (可以指定是不是要做 Data Check),而 invert thread 會原地反轉資料
  • CPU-Cache – http://benjr.tw/96768
    用來測試多處理器的快取一致性(cache coherency ).
  • Local NUMA / Remote NUMA – http://benjr.tw/96797
    用來測試 NUMA (Non-uniform memory access – CPU 與記憶體區分成不同的結點 Node ,不同的 CPU 各自擁有記憶體). Local NUMA 該節點上的程序成功配置到該節點的記憶體空間. Remote NUMA 該節點上的程序,成功配置到另一個節點的記憶體空間.

stressapptest 參數參考表 http://manpages.ubuntu.com/manpages/zesty/man1/stressapptest.1.html

Linux command – Stressful Application Test相关推荐

  1. OS + linux command / Linux Command / Linux command / linux Command

    写下你职业生涯中最难以忘怀的误操作.. http://www.dangkai.com/ArticlePage/Article59549.htm http://bbs.chinaunix.net/thr ...

  2. linux command find

    Linux command find [Purpose]        Learning linux command nmon   [Eevironment]        Ubuntu 16.04 ...

  3. Linux Command sar 网卡流量

    Linux Command sar 网卡流量 tags: 网络, 监控 文章目录 Linux Command sar 网卡流量 1. 简介 2. 查看内存各个指标的变化情况 1. 简介 如何实时查看网 ...

  4. Linux Command who、whois、whoami

    Linux Command who.whois.whoami tags: 用户管理 1. whois 显示指定用户信息 $ whois root #显示指定用户信息 $ whois ywnz.com ...

  5. Linux Command tc 模拟网络延迟和丢包

    Linux Command tc 模拟网络延迟和丢包 文章目录 Linux Command tc 模拟网络延迟和丢包 1. 介绍 2. 规则 2.1 流量控制方式 2.2 流量控制处理对象 3. 操作 ...

  6. Linux Command pushd

    Linux Command pushd 文章目录 Linux Command pushd 1. 简介 2. 格式 3. 参数 4. 实例 1. 简介 pushed命令用于将目录加入堆栈中,加入记录到目 ...

  7. Linux Command iperf3网络测速工具

    Linux Command iperf3网络测速工具 文章目录 Linux Command iperf3网络测速工具 1. 简介 2. 安装 3. 功能 4. 参数 5. 示例 5.1 测试TCP吞吐 ...

  8. Linux Command dnf 软件包管理

    Linux Command dnf 软件包管理 tags: 软件包管理 文章目录 Linux Command dnf 软件包管理 1. 简介 2. 语法 3. 安装 4. 示例 4.1 查看DNF版本 ...

  9. Linux Command snap 包管理

    Linux Command snap 软件包管理 tags: 软件包管理 文章目录 Linux Command snap 软件包管理 1. 简介 2 安装 Snapd 3. 管理 snaps 3.1 ...

  10. Linux Command ps 性能分析

    Linux Command ps 性能分析 tags: 分析 文章目录 Linux Command ps 性能分析 1. 简介 2. 参数 3. 输出说明 4. 实例 4.1 ps 不带任何选项 4. ...

最新文章

  1. 动态规划套路:最大子数组和
  2. c#拼图碎片形状_使用神经网络解决拼图游戏
  3. linux识别科学计数法,Linux下科学计数法(e)转化为数字的方法 [shell中几种数字计算说明]...
  4. 微课|中学生可以这样学Python(4.2节):break与continue语句
  5. MySQL存储引擎--MyISAM与InnoDB区别
  6. 紧急通知:招募 2000 名 IT 人学英语,免费培训!
  7. 转载: WMS、WFS、WCS、WPS、WMTS、WMSC、TMS等常见地图服务的区别
  8. 阿里云服务器企业该如何选择
  9. Asp.net对http request 处理的全过程!
  10. Yii Framework2.0开发教程(7)账户注册开发
  11. web端访问远程桌面
  12. 愤怒的牛(重回基础二分)
  13. 爬取QQ空间说说日志、好友个人信息并进行加密
  14. Connection(数据库连接对象)
  15. Android studio断点调试源码
  16. 小白学JAVA之十——枚举
  17. The end tag “</c:forEach“ is unbalanced
  18. [原创]裴讯K3救砖TTL竟然进入openwrt终端无法进入CFE-强力救砖
  19. iOS开发 ☞ emoji表情大全
  20. Android中Alarm的机制

热门文章

  1. 详解:分治算法【Java实现】——汉诺塔问题
  2. USB转串口电路之CH340G
  3. 娜璋荆棘(二)不忘曾经眼里的对方多美好,程序员的荆棘人生
  4. Android侧滑原来可以这么优雅
  5. wordpress网站设计入门6 菜单式样设置
  6. Android Studio如何创建VR项目。
  7. 条码追溯系统解决外贸企业进销存管理
  8. 错误The server cannot or will not process the request due to something that is perceived to be a clien
  9. 彼岸花的传说——彼岸繁花,开一千年,落一千年,花叶不相见。情不为因果,缘注定生死。...
  10. 5. 工业大数据典型应用