stress and results analysis tools Guide
Stress Test Stress Linux software installation and usage guide
First, what is Stress
stress is a stress test tool under linux, specifically for those high loads and completely user wants to test their system monitor these devices to run.
Second, the installation
The stress at the installation package and extract to upload server linux / usr / local / src path, extracting command: tar -xzpvf stress_1.0.1.orig.tar.gz
stress-1.0.1 file after the files are decompressed folder, enter ./configure configure if configure fails, and print the "no acceptable c compiler found in path", it means no available GCC compiler environment, enter yum -y install gcc automatically download and install.
Once configured, sequentially input
At this point, stress on all installation is complete, a successful installation at the command line prompt is printed stress.
Third, the use guide
First need to create a test directory, place the file for writing to disk.
Each primary stress parameter description (- underlined by one after said - represents the bonding line through two, may be used in contact stress parameter, expressed in different ways):
-?
--help display help information
--version Display the software version information
-t secs:
--timeout secs specifies the number of seconds to run
--backoff usecs wait usecs microseconds after the start of operation
-c forks:
Generating a plurality of CPU processing process --cpu forks sqrt () function
-m forks
--vm forks: generating a plurality of processing malloc () function of the number of memory allocation process, followed by the process
-i forks
--io forks: generating a plurality of processing sync () function of disk I / O process
--vm-bytes bytes: byte number, a default value is specified memory 1
--vm-hang: a rear malloc allocation of memory is freed much time in the free ()
-d :
--hdd: writing process, write a fixed size) function writes the current directory by mkstemp (
--hdd-bytes bytes: Specifies the number of write byte, 1G default
--hdd-noclean: Do not write random ascii data file unlink, do not delete the file is written, it will remain in the hard disk space.
Fourth, the test scenarios Examples
- CPU load test
Enter the command: stress -c 4
4 cpu increasing process, the process sqrt () function is a function to improve the system CPU load
2, memory test
Input command: stress -i 4 -vm 10 -vm-bytes 1G -vm-hang 100 -timeout 100s
Add 4 io process, 10 memory allocation process, the size of each allocation 1G, does not release after the distribution, testing 100S
3, disk I / O test
Input command: stress -d 1 --hdd-bytes 3G
Add a writing process, each write file block 3G
4, the hard disk test (not delete)
Input command: stress -i 1 -d 10 --hdd-bytes 3G -hdd-noclean
Add an IO process, 10 writing process, each file is written 3G block, and does not remove, the hard drive will gradually be depleted.
Fifth, monitor server performance under linux
- top monitor the overall usage
The parameters meanings are as follows:
load average: average of three values of the current system load later were 1 minute, 5 minutes, 15 minutes before the process average. Is generally believed that this number exceeds the number of CPU, CPU load will be more difficult to process the current system contains.
It represents several parameters of the CPU:
us: user space occupied by the percentage of CPU
sy: kernel space occupied by the percentage of CPU
ni: priority processes within the user process space occupied by the percentage of CPU changed
id: idle CPU percentage
wa: waiting for input and output of the percentage of time the cpu
After entering the top, uppercase P, the CPU occupancy size sorting, by M, the size of the memory footprint in order to sort
From an application point of view, the available memory = system free memory + buffers + cached, which buffers / cached in order to improve the performance of file read into memory when the application to use when, buffer / cached will soon be recover
- Server I / O read and write load evaluator
First with Top I / O when viewing high pressure, the value of the identification WA I / O wait percentage of CPU time, more than 30%.
Then iostat -x 1 10 view, if not the file, to yum install systat installation. See% util,% idle, if% util close to 100%, indicating that the generated I / O requests too, I / 0 system at full capacity, the disk may be a bottleneck,% idle less than 70%, I / 0 is more pressure big, general reading speed have more waiting.
Combined with vmstat -1 command to check the parameter b representing the number of processes waiting for resources, such as waiting for I / O, memory, etc., as usual time> 1, will have to focus on. Measurable i / o write load.
- Other daily management system
View System Number of the CPU: CAT / proc / the CPU info
Monitoring system status, see specifically where the pressure: vmstat
proc column shows the process-related information
r for running and waiting for CPU time slice number of processes, such as long-term> the number of server CPU, CPU instructions not enough
swap represents a memory swapping case
View memory usage: as Free
View system processes: PS the AUX
Print network connection: netstat -an
Print this boot which ports: netstat -lnp
View disk usage and the location of the file system is mounted: df -LH
First, what is Stress
stress is a stress test tool under linux, specifically for those high loads and completely user wants to test their system monitor these devices to run.
Second, the installation
The stress at the installation package and extract to upload server linux / usr / local / src path, extracting command: tar -xzpvf stress_1.0.1.orig.tar.gz
stress-1.0.1 file after the files are decompressed folder, enter ./configure configure if configure fails, and print the "no acceptable c compiler found in path", it means no available GCC compiler environment, enter yum -y install gcc automatically download and install.
Once configured, sequentially input
At this point, stress on all installation is complete, a successful installation at the command line prompt is printed stress.
Third, the use guide
First need to create a test directory, place the file for writing to disk.
Each primary stress parameter description (- underlined by one after said - represents the bonding line through two, may be used in contact stress parameter, expressed in different ways):
-?
--help display help information
--version Display the software version information
-t secs:
--timeout secs specifies the number of seconds to run
--backoff usecs wait usecs microseconds after the start of operation
-c forks:
Generating a plurality of CPU processing process --cpu forks sqrt () function
-m forks
--vm forks: generating a plurality of processing malloc () function of the number of memory allocation process, followed by the process
-i forks
--io forks: generating a plurality of processing sync () function of disk I / O process
--vm-bytes bytes: byte number, a default value is specified memory 1
--vm-hang: a rear malloc allocation of memory is freed much time in the free ()
-d :
--hdd: writing process, write a fixed size) function writes the current directory by mkstemp (
--hdd-bytes bytes: Specifies the number of write byte, 1G default
--hdd-noclean: Do not write random ascii data file unlink, do not delete the file is written, it will remain in the hard disk space.
Fourth, the test scenarios Examples
- CPU load test
Enter the command: stress -c 4
4 cpu increasing process, the process sqrt () function is a function to improve the system CPU load
2, memory test
Input command: stress -i 4 -vm 10 -vm-bytes 1G -vm-hang 100 -timeout 100s
Add 4 io process, 10 memory allocation process, the size of each allocation 1G, does not release after the distribution, testing 100S
3, disk I / O test
Input command: stress -d 1 --hdd-bytes 3G
Add a writing process, each write file block 3G
4, the hard disk test (not delete)
Input command: stress -i 1 -d 10 --hdd-bytes 3G -hdd-noclean
Add an IO process, 10 writing process, each file is written 3G block, and does not remove, the hard drive will gradually be depleted.
Fifth, monitor server performance under linux
- top monitor the overall usage
The parameters meanings are as follows:
load average: average of three values of the current system load later were 1 minute, 5 minutes, 15 minutes before the process average. Is generally believed that this number exceeds the number of CPU, CPU load will be more difficult to process the current system contains.
It represents several parameters of the CPU:
us: user space occupied by the percentage of CPU
sy: kernel space occupied by the percentage of CPU
ni: priority processes within the user process space occupied by the percentage of CPU changed
id: idle CPU percentage
wa: waiting for input and output of the percentage of time the cpu
After entering the top, uppercase P, the CPU occupancy size sorting, by M, the size of the memory footprint in order to sort
From an application point of view, the available memory = system free memory + buffers + cached, which buffers / cached in order to improve the performance of file read into memory when the application to use when, buffer / cached will soon be recover
- Server I / O read and write load evaluator
First with Top I / O when viewing high pressure, the value of the identification WA I / O wait percentage of CPU time, more than 30%.
Then iostat -x 1 10 view, if not the file, to yum install systat installation. See% util,% idle, if% util close to 100%, indicating that the generated I / O requests too, I / 0 system at full capacity, the disk may be a bottleneck,% idle less than 70%, I / 0 is more pressure big, general reading speed have more waiting.
Combined with vmstat -1 command to check the parameter b representing the number of processes waiting for resources, such as waiting for I / O, memory, etc., as usual time> 1, will have to focus on. Measurable i / o write load.
- Other daily management system
View System Number of the CPU: CAT / proc / the CPU info
Monitoring system status, see specifically where the pressure: vmstat
proc column shows the process-related information
r for running and waiting for CPU time slice number of processes, such as long-term> the number of server CPU, CPU instructions not enough
swap represents a memory swapping case
View memory usage: as Free
View system processes: PS the AUX
Print network connection: netstat -an
Print this boot which ports: netstat -lnp
View disk usage and the location of the file system is mounted: df -LH