關(guān)于如何用UnixBench,介紹文章很多,這里就不展開(kāi)了。這里重點(diǎn)描述下它是如何算分的。
我們提供的服務(wù)有:成都網(wǎng)站制作、成都做網(wǎng)站、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、橋東ssl等。為成百上千企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢(xún)和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的橋東網(wǎng)站制作公司
碰到很多客戶(hù),裝好后,直接./Run,就把結(jié)果跑出來(lái)了,然后還只取最后一個(gè)分值,比誰(shuí)高誰(shuí)低。
下面列一下4C8G的結(jié)果:
------------------------------------------------------------------------Benchmark Run: 一 6月 25 2018 20:25:47 - 20:54:19 4 CPUs in system; running 1 parallel copy of tests Dhrystone 2 using register variables 30971628.9 lps (10.0 s, 7 samples) Double-Precision Whetstone 3928.1 MWIPS (12.4 s, 7 samples) Execl Throughput 3117.6 lps (30.0 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 645027.2 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 229505.4 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 1288742.6 KBps (30.0 s, 2 samples) Pipe Throughput 1635960.9 lps (10.0 s, 7 samples) Pipe-based Context Switching 337333.8 lps (10.0 s, 7 samples) Process Creation 8238.2 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 5817.0 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 2183.9 lpm (60.0 s, 2 samples) System Call Overhead 2465754.7 lps (10.0 s, 7 samples)System Benchmarks Index Values BASELINE RESULT INDEXDhrystone 2 using register variables 116700.0 30971628.9 2654.0Double-Precision Whetstone 55.0 3928.1 714.2Execl Throughput 43.0 3117.6 725.0File Copy 1024 bufsize 2000 maxblocks 3960.0 645027.2 1628.9File Copy 256 bufsize 500 maxblocks 1655.0 229505.4 1386.7File Copy 4096 bufsize 8000 maxblocks 5800.0 1288742.6 2222.0Pipe Throughput 12440.0 1635960.9 1315.1Pipe-based Context Switching 4000.0 337333.8 843.3Process Creation 126.0 8238.2 653.8Shell Scripts (1 concurrent) 42.4 5817.0 1371.9Shell Scripts (8 concurrent) 6.0 2183.9 3639.9System Call Overhead 15000.0 2465754.7 1643.8 ========System Benchmarks Index Score 1362.9------------------------------------------------------------------------Benchmark Run: 一 6月 25 2018 20:54:19 - 21:22:544 CPUs in system; running 4 parallel copies of tests Dhrystone 2 using register variables 114984418.6 lps (10.0 s, 7 samples) Double-Precision Whetstone 16614.2 MWIPS (11.6 s, 7 samples) Execl Throughput 13645.3 lps (30.0 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 751698.4 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 230211.7 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 1964420.6 KBps (30.0 s, 2 samples) Pipe Throughput 5999380.0 lps (10.0 s, 7 samples) Pipe-based Context Switching 1095000.2 lps (10.0 s, 7 samples) Process Creation 34454.9 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 18218.1 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 2493.1 lpm (60.0 s, 2 samples) System Call Overhead 5643267.3 lps (10.0 s, 7 samples)System Benchmarks Index Values BASELINE RESULT INDEXDhrystone 2 using register variables 116700.0 114984418.6 9853.0Double-Precision Whetstone 55.0 16614.2 3020.8Execl Throughput 43.0 13645.3 3173.3File Copy 1024 bufsize 2000 maxblocks 3960.0 751698.4 1898.2File Copy 256 bufsize 500 maxblocks 1655.0 230211.7 1391.0File Copy 4096 bufsize 8000 maxblocks 5800.0 1964420.6 3386.9Pipe Throughput 12440.0 5999380.0 4822.7Pipe-based Context Switching 4000.0 1095000.2 2737.5Process Creation 126.0 34454.9 2734.5Shell Scripts (1 concurrent) 42.4 18218.1 4296.7Shell Scripts (8 concurrent) 6.0 2493.1 4155.1System Call Overhead 15000.0 5643267.3 3762.2 ========System Benchmarks Index Score 3357.0
很多人就拿了3357那個(gè)分?jǐn)?shù)去比了,但是上面那個(gè)單進(jìn)程結(jié)果1362.9也有意義,但凡接觸了這么多案例,沒(méi)人關(guān)心過(guò)。多進(jìn)程結(jié)果就是根據(jù)系統(tǒng)CPU核數(shù),同時(shí)起多個(gè)進(jìn)程的結(jié)果;單進(jìn)程就是只起一個(gè)進(jìn)程的結(jié)果,對(duì)于系統(tǒng)性能來(lái)說(shuō),兩個(gè)結(jié)果都是有意義的。
話(huà)說(shuō)回來(lái),
./Run
到底執(zhí)行了什么?默認(rèn)執(zhí)行的是Index模塊,它包含下面幾個(gè)小程序:
"dhry2reg", "whetstone-double", "execl", "fstime", "fsbuffer", "fsdisk", "pipe", "context1", "spawn", "shell1", "shell8","syscall"
對(duì)應(yīng)的就是上面的結(jié)果的各個(gè)結(jié)果對(duì)應(yīng)的case了。
翻看了下它的源代碼,它的執(zhí)行參數(shù)如下:./Run 模塊 -i 迭代次數(shù) -c 進(jìn)程并發(fā)數(shù) -q/-v (輸出方式。
模塊:有時(shí)候你只想測(cè)某一個(gè)小程序的結(jié)果,那你可以修改自己去新增一個(gè)模塊,修改測(cè)試內(nèi)容,這對(duì)于調(diào)試是非常方便的,也可以直接指定某個(gè)執(zhí)行程序。
迭代次數(shù):關(guān)于迭代次數(shù),不能想當(dāng)然的就理解成這就是要執(zhí)行的次數(shù)了,默認(rèn)框架分為兩種迭代模式,一種是短迭代次數(shù),默認(rèn) 3次,一種是 長(zhǎng)迭代次數(shù),默認(rèn)10 次。那輸入的迭代次數(shù)就是默認(rèn)的長(zhǎng)迭代次數(shù),短迭代次數(shù)=(迭代次數(shù)+1)/3,如果結(jié)果小于就是1. 程序配置好了,該選擇哪個(gè)迭代次數(shù)。
進(jìn)程并發(fā)數(shù):如果你想進(jìn)程并發(fā)數(shù)不是系統(tǒng)CPU數(shù),那就可以通過(guò)這個(gè)調(diào)整;
輸出方式:是靜默還是詳細(xì)輸出方式;
每個(gè)小程序在執(zhí)行的時(shí)候都需要指定迭代模式和執(zhí)行時(shí)間以及并發(fā)情況,所有的進(jìn)程一次執(zhí)行的結(jié)果都是統(tǒng)一模式。
下面是單進(jìn)程的一個(gè)舉例:
Process Creation -- 1 copy ==> "/opt/unixbench/UnixBench/pgms/spawn" 30 2>&1 >> "/opt/unixbench/UnixBench/results/VM_0_13_centos-2018-06-25-05.log"#### Pass 1# COUNT0: 247371 #分?jǐn)?shù)# COUNT1: 1 # timebase 程序?qū)懰? COUNT2: lps # 測(cè)試項(xiàng)名稱(chēng)# elapsed: 30.003119 # 耗時(shí)# pid: 16803 # 進(jìn)程ID# status: 0 # 是否成功退出#### Pass 2# COUNT0: 242919# COUNT1: 1# COUNT2: lps# elapsed: 30.002898# pid: 5035# status: 0#### Pass 3# COUNT0: 243989# COUNT1: 1# COUNT2: lps# elapsed: 30.002732# pid: 21228# status: 0*Dump score: 242919.0Count score: 243989.0Count score: 247371.0>>>> Results of 1 copy>>>> score: 8188.34084738901>>>> time: 30.0029255>>>> iterations: 2
其中COUNT0,COUNT1,COUNT2是這么算出來(lái)的,每個(gè)進(jìn)程的結(jié)果如:
COUNT|x|y|x
經(jīng)過(guò)解析,變成如下:
COUNT0 = x COUNT1 = y COUNT2 = z
算分過(guò)程如下:
根據(jù)COUNT0從小到大,去掉 1/3 的最差結(jié)果;
如果timebase,耗時(shí)都是大于0,
$product += log($COUNT0) - log(耗時(shí)/ $timebase)
否則就不需要考慮耗時(shí)這塊:
$product += log($COUNT0)
單項(xiàng)性能分:
$score = exp($product/2)
,2是統(tǒng)計(jì)的迭代次數(shù),經(jīng)過(guò)計(jì)算恰好是這個(gè)分?jǐn)?shù),與系統(tǒng)輸出一致。
它總的算法思想:就是先通過(guò)log降維,把不同次數(shù)不一樣的結(jié)果盡可能拉平,平均然后在階乘,后面多個(gè)結(jié)果也是這個(gè)思想,先降維,再平均,再階乘。
那如果并發(fā)執(zhí)行多個(gè)呢?舉例如下:
Shell Scripts (1 concurrent) -- 4 copies ==> "/opt/unixbench/UnixBench/pgms/looper" 60 "/opt/unixbench/UnixBench/pgms/multi.sh" 1 2>&1 >> "/opt/unixbench/UnixBench/results/VM_0_13_centos-2018-06-25-05.log"#### Pass 1# COUNT0: 4614# COUNT1: 60# COUNT2: lpm# elapsed: 60.005639# pid: 20858# status: 0# COUNT0: 4596# COUNT1: 60# COUNT2: lpm# elapsed: 60.009496# pid: 20859# status: 0# COUNT0: 4592# COUNT1: 60# COUNT2: lpm# elapsed: 60.011761# pid: 20862# status: 0# COUNT0: 4614# COUNT1: 60# COUNT2: lpm# elapsed: 60.011930# pid: 20864# status: 0#### Pass 2# COUNT0: 4547# COUNT1: 60# COUNT2: lpm# elapsed: 60.005597# pid: 10791# status: 0# COUNT0: 4590# COUNT1: 60# COUNT2: lpm# elapsed: 60.013270# pid: 10793# status: 0# COUNT0: 4578# COUNT1: 60# COUNT2: lpm# elapsed: 60.006054# pid: 10794# status: 0# COUNT0: 4561# COUNT1: 60# COUNT2: lpm# elapsed: 60.014214# pid: 10797# status: 0#### Pass 3# COUNT0: 4631# COUNT1: 60# COUNT2: lpm# elapsed: 60.013816# pid: 31734# status: 0# COUNT0: 4632# COUNT1: 60# COUNT2: lpm# elapsed: 60.012614# pid: 31735# status: 0# COUNT0: 4637# COUNT1: 60# COUNT2: lpm# elapsed: 60.005633# pid: 31737# status: 0# COUNT0: 4645# COUNT1: 60# COUNT2: lpm# elapsed: 60.006082# pid: 31740# status: 0*Dump score: 18276.0Count score: 18416.0Count score: 18545.0>>>> Sum of 4 copies>>>> score: 18477.4244713467>>>> time: 60.009621375>>>> iterations: 2
算分過(guò)程如下:
分?jǐn)?shù):如18545,就是PASS3個(gè)項(xiàng)的加總: 4631+4632+4637+4645
耗時(shí):平均值,即:(60.013816+60.012614+60.005633+60.006082)/4=60.00953625
timebase: 還是那個(gè)COUNT1
上述3步即是把一個(gè)并發(fā)結(jié)果合成一個(gè)結(jié)果,然后的積分方式跟單進(jìn)程的方式一樣
那文章開(kāi)頭多進(jìn)程的圖例分?jǐn)?shù)舉例:
算出來(lái)的每項(xiàng)score有個(gè)加權(quán)分?jǐn)?shù),要除以10(作為單項(xiàng)比拼,我覺(jué)得除不除10無(wú)所謂,估計(jì)是為了跟總分接近)
總分計(jì)算:
=exp(average(每項(xiàng)score分*10))
,結(jié)果恰恰好就是我們要的結(jié)果。
綜上對(duì)UnixBench的分?jǐn)?shù)計(jì)算算是全面介紹了一邊,附件有excel證明計(jì)算過(guò)程。
附件下載: 算分過(guò)程.xls...[米拉齊].1543830848.zip
分享文章:UnixBench算分介紹
新聞來(lái)源:http://www.rwnh.cn/article20/jipdjo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、標(biāo)簽優(yōu)化、建站公司、App設(shè)計(jì)、做網(wǎng)站、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)