changeset 34:bcf20ce5201e

add benchmarks
author Ken Miyahira <e175733@ie.u-ryukyu.ac.jp>
date Sun, 07 Feb 2021 19:49:56 +0900
parents 44a8408a59a6
children d8f79c7bf155
files paper/file/benchmark/README.md paper/file/benchmark/pdf/Read.pdf paper/file/benchmark/pdf/Write.pdf paper/file/benchmark/plot.py paper/file/benchmark/read/cephFS paper/file/benchmark/read/cephRBD paper/file/benchmark/read/gfs2 paper/file/benchmark/read/nfs paper/file/benchmark/write/cephFS paper/file/benchmark/write/cephRBD paper/file/benchmark/write/gfs2 paper/file/benchmark/write/nfs
diffstat 12 files changed, 142 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/README.md	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,36 @@
+# Benchmark
+
+## dd-benchmark
+
+書き込み, 読み込みの測定には[dd-benchmark](https://romanrm.net/dd-benchmark)を使用する。最近では[fio](https://github.com/axboe/fio)がお勧め。
+
+* 下記のコマンドで測定を行う。
+```sh
+# 書き込み
+dd if=/dev/zero of=benchmark bs=64K count=64K conv=fdatasync
+
+# 読み込み
+dd if=benchmark of=/dev/null
+```
+
+* `conv=fdatasync`が最も普段の動作に近いらしい。
+>This tells dd to require a complete “sync” once, right before it exits. So it commits the whole 256 MB of data, then tells the operating system: “OK, now ensure this is completely on disk”, only then measures the total time it took to do all that and calculates the benchmark result.
+
+### 測定用のshell
+
+ベンチでは, 128MB, 256MB, 512MB, 1GB, 2GB, 4GBの書き込み, 読み込み速度を測定する。測定用のshellは下のやつを利用する。
+
+```sh
+#!/bin/sh
+
+for c in 2 4 8 16 32 64
+do
+    echo "Write"
+    dd if=/dev/zero of=benchmark bs=64K count=$c"K" conv=fdatasync
+
+    echo "Read"
+    dd if=benchmark of=/dev/null
+    
+    rm benchmark
+done
+```
\ No newline at end of file
Binary file paper/file/benchmark/pdf/Read.pdf has changed
Binary file paper/file/benchmark/pdf/Write.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/plot.py	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,58 @@
+import sys
+import matplotlib.pyplot as plt
+import subprocess
+
+args = sys.argv # 読み込みファイル名の取得
+FILES = args[1:] # ファイル名の格納
+
+def NOL(fname): #Number of lines
+    num_lines = sum(1 for line in open(fname))
+    return num_lines
+
+def getData():
+    x, y = [], []
+    print("データ読み込み")
+    for file_in in FILES:
+        tmp_x, tmp_y = [], []
+        with open(file_in,"r") as f:
+            for i in range(NOL(file_in)):
+                lines = f.readline().split(" ")
+                try:
+                    tmp_x.append(float(lines[0]))
+                    tmp_y.append(float(lines[1]))
+                except Exception:
+                    continue
+        x.append(tmp_x)
+        y.append(tmp_y)
+
+    name = input("GraphName: ")
+    xlabel = input("xlabel: ")
+    ylabel = input("ylabel: ")
+    xr = input("Xrange: ")
+    xr = xr.split(" ")
+    yr = input("Yrange: ")
+    yr = yr.split(" ")
+    # 画像出力
+    print("画像出力")
+    plot_graph(name,x,y,float(xr[0]),float(xr[1]),float(yr[0]),float(yr[1]),xlabel,ylabel)
+    return name
+    
+def plot_graph(name,x,y,sx,ex,sy,ey,xlabel,ylabel):
+    plt.xlim(sx,ex)
+    plt.xlabel(str(xlabel))
+    plt.ylim(sy,ey)
+    plt.ylabel(str(ylabel))
+    for i in range(len(x)):
+        plt.plot(x[i],y[i], label=FILES[i].split("/")[-1])#markersize=0.5)
+    plt.legend()
+    plt.savefig("./pdf/"+str(name)+".pdf")
+    plt.delaxes()
+
+def openGraph(name):
+    cmd = ["open", "./pdf/"+str(name)+".pdf"]
+    subprocess.check_call(cmd)
+
+if __name__ == "__main__":
+    name = getData()
+    if(input("画像を表示しますか(Y or N): ")=="y"):
+        openGraph(name)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/read/cephFS	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 785
+256 821
+512 828
+1024 833
+2048 826
+4096 846
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/read/cephRBD	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 1100
+256 1160
+512 1200
+1024 1200
+2048 1200
+4096 1200
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/read/gfs2	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 674
+256 676
+512 534
+1024 670
+2048 639
+4096 653
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/read/nfs	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 130
+256 130
+512 126
+1024 118
+2048 124
+4096 127
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/write/cephFS	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 484
+256 621
+512 647
+1024 669
+2048 715
+4096 750
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/write/cephRBD	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 390
+256 537
+512 548
+1024 509
+2048 604
+4096 582
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/write/gfs2	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 304
+256 290
+512 306
+1024 316
+2048 291
+4096 304
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/file/benchmark/write/nfs	Sun Feb 07 19:49:56 2021 +0900
@@ -0,0 +1,6 @@
+128 165
+256 293
+512 285
+1024 278
+2048 279
+4096 316
\ No newline at end of file