這篇文章主要講解了“怎么使用Linux平臺(tái)下的壓力測(cè)試工具stress-ng”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么使用Linux平臺(tái)下的壓力測(cè)試工具stress-ng”吧!

安裝很簡單,在CentOS下,通過yum -y install stress-ng即可安裝此工具.
安裝成功后,執(zhí)行man stress-ng可查看該工具的幫助信息.
NAME stress-ng - a tool to load and stress a computer system stress-ng是計(jì)算機(jī)系統(tǒng)進(jìn)行壓力測(cè)試的工具. SYNOPSIS stress-ng [OPTION [ARG]] ... 使用方法:stress-ng [OPTION [ARG]] ... DESCRIPTION stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the var‐ ious operating system kernel interfaces. stress-ng also has a wide range of CPU specific stress tests that exercise floating point, integer, bit manipulation and control flow. stress-ng was originally intended to make a machine work hard and trip hardware issues such as thermal overruns as well as operating system bugs that only occur when a system is being thrashed hard. Use stress-ng with caution as some of the tests can make a system run hot on poorly designed hardware and also can cause excessive system thrashing which may be difficult to stop. stress-ng can also measure test throughput rates; this can be useful to observe performance changes across different operating system releases or types of hard‐ ware. However, it has never been intended to be used as a precise benchmark test suite, so do NOT use it in this manner. Running stress-ng with root privileges will adjust out of memory settings on Linux systems to make the stressors unkillable in low memory situations, so use this judiciously. With the appropriate privilege, stress-ng can allow the ionice class and ionice levels to be adjusted, again, this should be used with care. One can specify the number of processes to invoke per type of stress test; speci‐ fying a negative or zero value will select the number of processors available as defined by sysconf(_SC_NPROCESSORS_CONF). stress-ng提供了N中途徑對(duì)系統(tǒng)進(jìn)行測(cè)試.該工具可運(yùn)行計(jì)算機(jī)的各種物理子系統(tǒng)(如CPU/內(nèi)存/網(wǎng)絡(luò)等) 以及各種OS內(nèi)核接口.stress-ng有大量的CPU壓力測(cè)試方法,包括測(cè)試浮點(diǎn)數(shù)/整數(shù)/位運(yùn)算和控制流程等. stress-ng的最初目的是給機(jī)器加壓,通過使系統(tǒng)過載來發(fā)現(xiàn)OS的bug.要注意的是,stress-ng在設(shè)計(jì)不良 的系統(tǒng)中運(yùn)行可能會(huì)系統(tǒng)宕機(jī). OPTIONS General stress-ng control options: ... 詳細(xì)可參考stress-ng手冊(cè). EXAMPLES 使用樣例 stress-ng --vm 8 --vm-bytes 80% -t 1h run 8 virtual memory stressors that combined use 80% of the available mem‐ ory for 1 hour. Thus each stressor uses 10% of the available memory. 執(zhí)行8個(gè)虛擬的內(nèi)存壓測(cè)器,合計(jì)使用80%的可用內(nèi)存,持續(xù)時(shí)間1小時(shí),每個(gè)壓測(cè)器約10%的可用內(nèi)存. stress-ng --cpu 4 --io 2 --vm 1 --vm-bytes 1G --timeout 60s runs for 60 seconds with 4 cpu stressors, 2 io stressors and 1 vm stressor using 1GB of virtual memory. stress-ng --iomix 2 --iomix-bytes 10% -t 10m runs 2 instances of the mixed I/O stressors using a total of 10% of the available file system space for 10 minutes. Each stressor will use 5% of the available file system space. stress-ng --cpu 8 --cpu-ops 800000 runs 8 cpu stressors and stops after 800000 bogo operations. stress-ng --sequential 2 --timeout 2m --metrics run 2 simultaneous instances of all the stressors sequentially one by one, each for 2 minutes and summarise with performance metrics at the end. stress-ng --cpu 4 --cpu-method fft --cpu-ops 10000 --metrics-brief run 4 FFT cpu stressors, stop after 10000 bogo operations and produce a summary just for the FFT results. stress-ng --cpu 0 --cpu-method all -t 1h run cpu stressors on all online CPUs working through all the available CPU stressors for 1 hour. stress-ng --all 4 --timeout 5m run 4 instances of all the stressors for 5 minutes. stress-ng --random 64 run 64 stressors that are randomly chosen from all the available stressors. stress-ng --cpu 64 --cpu-method all --verify -t 10m --metrics-brief run 64 instances of all the different cpu stressors and verify that the computations are correct for 10 minutes with a bogo operations summary at the end. stress-ng --sequential 0 -t 10m run all the stressors one by one for 10 minutes, with the number of instances of each stressor matching the number of online CPUs. stress-ng --sequential 8 --class io -t 5m --times run all the stressors in the io class one by one for 5 minutes each, with 8 instances of each stressor running concurrently and show overall time util‐ isation statistics at the end of the run. stress-ng --all 0 --maximize --aggressive run all the stressors (1 instance of each per CPU) simultaneously, maximize the settings (memory sizes, file allocations, etc.) and select the most demanding/aggressive options. stress-ng --random 32 -x numa,hdd,key run 32 randomly selected stressors and exclude the numa, hdd and key stres‐ sors stress-ng --sequential 4 --class vm --exclude bigheap,brk,stack run 4 instances of the VM stressors one after each other, excluding the bigheap, brk and stack stressors stress-ng --taskset 0,2-3 --cpu 3 run 3 instances of the CPU stressor and pin them to CPUs 0, 2 and 3.
感謝各位的閱讀,以上就是“怎么使用Linux平臺(tái)下的壓力測(cè)試工具stress-ng”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)怎么使用Linux平臺(tái)下的壓力測(cè)試工具stress-ng這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
本文題目:怎么使用Linux平臺(tái)下的壓力測(cè)試工具stress-ng-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://www.chinadenli.net/article10/dhdodo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、網(wǎng)站內(nèi)鏈、品牌網(wǎng)站設(shè)計(jì)、定制開發(fā)、網(wǎng)站設(shè)計(jì)、服務(wù)器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容