stressapptest

欧阳安晏
2023-12-01
  • 了解stressapptest

1.概述

  stressapptest - stress test application for simulating high load situations.stressapptest (unix name for Stressful Application Test) is a program that tries to maximize randomized traffic to memory from processor and I/O, with the intent of creating a realistic high load situation in order to test the existing hardware devices in computer.

  stressapptest is a userspace test, primarily composed of threads doing memory copies and directIO 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.

1.1.Installation

  To build from source, the build/installation package follows the GNU guidelines. So, to download the latest package:

git clone https://github.com/stressapptest/stressapptest.git
cd stressapptest
./configure
make
sudo make install

1.2.Usage

  To execute, a typical command would be:

./stressapptest -s 20 -M 256 -m 8 -W    # Test 256MB, running 8 "warm copy" threads. Exit after 20 seconds.
./stressapptest --help                  # list the available arguments.

Common arguments:

-M mbytes : megabytes of ram to test (auto-detect all memory available)
-s seconds : number of seconds to run (20)
-m threads : number of memory copy threads to run (auto-detect to number of CPUs)
-W : Use more CPU-stressful memory copy (false)
-n ipaddr : add a network thread connecting to system at 'ipaddr'. (none)
--listen : run a thread to listen for and respond to network threads. (0)
-f filename : add a disk thread with tempfile 'filename' (none)
-F : don't result check each transaction, use libc memcpy instead. (false)

Error handling:

-l logfile : log output to file 'logfile' (none)
-v level : verbosity (0-20) (default: 8)
./stressapptest -s 20 -M 256 -m 8 -C 8 -W # Allocate 256MB of memory and run 8 "warm copy" threads, and 8 cpu load threads. Exit after 20 seconds.
./stressapptest -f /tmp/file1 -f /tmp/file2 # Run 2 file IO threads, and autodetect memory size and core count to select allocated memory and memory copy threads.

1.3.Objective

  Stressful Application Test (or stressapptest) tries to maximize randomized traffic to memory from processor and I/O, with the intent of creating a realistic high load situation.

  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.

  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.

1.4.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.

1.5.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.

1.6.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.

2.测试

./stressapptest -W --max_erros 1 -m 4 -I 4 -M 256 -v 20 -s 15 -l stressapptest_log.txt &

#stressapptest -s 600 -M 64 -m 8 -C 8 -W&
2017/01/01-01:08:59(UTC) Log: Commandline - stressapptest -s 600 -M 64 -m 8 -C 8 -W
2017/01/01-01:08:59(UTC) Stats: SAT revision 1.0.9_autoconf, 32 bit binary
2017/01/01-01:08:59(UTC) Log: helen @ ubuntu on Wed Dec 18 00:45:06 PST 2019 from open source release
2017/01/01-01:08:59(UTC) Log: 1 nodes, 1 cpus.
2017/01/01-01:08:59(UTC) Log: Flooring memory allocation to multiple of 4: 64MB
2017/01/01-01:08:59(UTC) Log: Prefer plain malloc memory allocation.
2017/01/01-01:08:59(UTC) Log: Using mmap() allocation at 0x724d4000.
2017/01/01-01:08:59(UTC) Stats: Starting SAT, 64M, 600 seconds
2017/01/01-01:09:00(UTC) Log: Region mask: 0x1
2017/01/01-01:09:10(UTC) Log: Seconds remaining: 590
2017/01/01-01:09:20(UTC) Log: Seconds remaining: 580
2017/01/01-01:09:30(UTC) Log: Seconds remaining: 570
2017/01/01-01:09:40(UTC) Log: Seconds remaining: 560
2017/01/01-01:09:50(UTC) Log: Seconds remaining: 550
2017/01/01-01:10:00(UTC) Log: Seconds remaining: 540
2017/01/01-01:10:10(UTC) Log: Seconds remaining: 530
2017/01/01-01:10:20(UTC) Log: Seconds remaining: 520
2017/01/01-01:10:30(UTC) Log: Seconds remaining: 510
2017/01/01-01:10:40(UTC) Log: Seconds remaining: 500
2017/01/01-01:10:50(UTC) Log: Seconds remaining: 490
2017/01/01-01:11:00(UTC) Log: Seconds remaining: 480
2017/01/01-01:11:10(UTC) Log: Seconds remaining: 470
2017/01/01-01:11:20(UTC) Log: Seconds remaining: 460
2017/01/01-01:11:30(UTC) Log: Seconds remaining: 450
2017/01/01-01:11:40(UTC) Log: Seconds remaining: 440
2017/01/01-01:11:50(UTC) Log: Seconds remaining: 430
2017/01/01-01:12:00(UTC) Log: Seconds remaining: 420
2017/01/01-01:12:10(UTC) Log: Seconds remaining: 410
2017/01/01-01:12:20(UTC) Log: Seconds remaining: 400
2017/01/01-01:12:30(UTC) Log: Seconds remaining: 390
2017/01/01-01:12:40(UTC) Log: Seconds remaining: 380
2017/01/01-01:12:50(UTC) Log: Seconds remaining: 370
2017/01/01-01:13:00(UTC) Log: Seconds remaining: 360
2017/01/01-01:13:10(UTC) Log: Seconds remaining: 350
2017/01/01-01:13:20(UTC) Log: Seconds remaining: 340
2017/01/01-01:13:30(UTC) Log: Seconds remaining: 330
2017/01/01-01:13:40(UTC) Log: Seconds remaining: 320
2017/01/01-01:13:50(UTC) Log: Seconds remaining: 310
2017/01/01-01:14:00(UTC) Log: Seconds remaining: 300
2017/01/01-01:14:10(UTC) Log: Seconds remaining: 290
2017/01/01-01:14:20(UTC) Log: Seconds remaining: 280
2017/01/01-01:14:30(UTC) Log: Seconds remaining: 270
2017/01/01-01:14:40(UTC) Log: Seconds remaining: 260
2017/01/01-01:14:50(UTC) Log: Seconds remaining: 250
2017/01/01-01:15:00(UTC) Log: Seconds remaining: 240
2017/01/01-01:15:10(UTC) Log: Seconds remaining: 230
2017/01/01-01:15:20(UTC) Log: Seconds remaining: 220
2017/01/01-01:15:30(UTC) Log: Seconds remaining: 210
2017/01/01-01:15:40(UTC) Log: Seconds remaining: 200
2017/01/01-01:15:50(UTC) Log: Seconds remaining: 190
2017/01/01-01:16:00(UTC) Log: Seconds remaining: 180
2017/01/01-01:16:10(UTC) Log: Seconds remaining: 170
2017/01/01-01:16:20(UTC) Log: Seconds remaining: 160
2017/01/01-01:16:30(UTC) Log: Seconds remaining: 150
2017/01/01-01:16:40(UTC) Log: Seconds remaining: 140
2017/01/01-01:16:50(UTC) Log: Seconds remaining: 130
2017/01/01-01:17:00(UTC) Log: Seconds remaining: 120
2017/01/01-01:17:10(UTC) Log: Seconds remaining: 110
2017/01/01-01:17:20(UTC) Log: Seconds remaining: 100
2017/01/01-01:17:30(UTC) Log: Seconds remaining: 90
2017/01/01-01:17:40(UTC) Log: Seconds remaining: 80
2017/01/01-01:17:50(UTC) Log: Seconds remaining: 70
2017/01/01-01:18:00(UTC) Log: Seconds remaining: 60
2017/01/01-01:18:10(UTC) Log: Seconds remaining: 50
2017/01/01-01:18:20(UTC) Log: Seconds remaining: 40
2017/01/01-01:18:30(UTC) Log: Seconds remaining: 30
2017/01/01-01:18:40(UTC) Log: Seconds remaining: 20
2017/01/01-01:18:50(UTC) Log: Seconds remaining: 10
2017/01/01-01:19:47(UTC) Stats: Found 0 hardware incidents
2017/01/01-01:19:47(UTC) Stats: Completed: 38996.00M in 647.38s 60.24MB/s, with 0 hardware incidents, 0 errors
2017/01/01-01:19:47(UTC) Stats: Memory Copy: 38996.00M at 64.98MB/s
2017/01/01-01:19:47(UTC) Stats: File Copy: 0.00M at 0.00MB/s
2017/01/01-01:19:47(UTC) Stats: Net Copy: 0.00M at 0.00MB/s
2017/01/01-01:19:47(UTC) Stats: Data Check: 0.00M at 0.00MB/s
2017/01/01-01:19:47(UTC) Stats: Invert Data: 0.00M at 0.00MB/s
2017/01/01-01:19:47(UTC) Stats: Disk: 0.00M at 0.00MB/s
2017/01/01-01:19:47(UTC) 
2017/01/01-01:19:47(UTC) Status: PASS - please verify no corrected errors
2017/01/01-01:19:47(UTC) 

refer to

  • https://groups.google.com/g/stressapptest-discuss
  • https://github.com/stressapptest/stressapptest
  • http://manpages.ubuntu.com/manpages/trusty/man1/stressapptest.1.html
 类似资料:

相关阅读

相关文章

相关问答