Difference between revisions of "Dbench"

From OnnoWiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
  dbench [options]numclients
 
  dbench [options]numclients
 
  tbench [options]numclientsserver tbench_srv [options]
 
  tbench [options]numclientsserver tbench_srv [options]
 +
 +
Folder yang akan di test /mnt/public yang di link ke salah satu SMB Server yang akan di test
 +
Gunakan client.txt bawaan dari dbench
 +
 +
dbench --directory=/mnt/public/ --loadfile=/usr/share/dbench/client.txt --skip-cleanup 20
 +
 +
Switch --skip-cleanup menentukan berapa concurrent worker / proses yang akan di pekerjakan untuk melakukan benchmarking tersebut
  
 
==Option==
 
==Option==
Line 13: Line 20:
 
         Use  this  as  the  full  path  name  of  the  client.txt  file  (the  default  is
 
         Use  this  as  the  full  path  name  of  the  client.txt  file  (the  default  is
 
         /usr/share/dbench/client.txt).
 
         /usr/share/dbench/client.txt).
 
 
  -s    Use synchronous file IO on all file operations.
 
  -s    Use synchronous file IO on all file operations.
 
 
  -t TIME
 
  -t TIME
 
         set the runtime of the benchmark in seconds (default 600)
 
         set the runtime of the benchmark in seconds (default 600)
 
 
  -D DIR set the base directory to run the filesystem operations in
 
  -D DIR set the base directory to run the filesystem operations in
 
 
  -x    enable  xattr support, simulating the xattr operations Samba4 would need to perform
 
  -x    enable  xattr support, simulating the xattr operations Samba4 would need to perform
 
         to run the load
 
         to run the load
 
 
  -S    Use synchronous IO for all directory operations (unlink, rmdir, mkdir and rename).
 
  -S    Use synchronous IO for all directory operations (unlink, rmdir, mkdir and rename).
 
         The tbench program takes a number, which indicates the number  of  clients  to  run
 
         The tbench program takes a number, which indicates the number  of  clients  to  run
 
         simultaneously,  and  a  server  name:  tbench_srv should be invoked on that server
 
         simultaneously,  and  a  server  name:  tbench_srv should be invoked on that server
 
         before invoking tbench.  tbench can also take the following options:
 
         before invoking tbench.  tbench can also take the following options:
 
 
  -T option[,...]
 
  -T option[,...]
 
         This sets the socket options for the connection to the server.  The options  are  a
 
         This sets the socket options for the connection to the server.  The options  are  a
Line 36: Line 37:
 
         SO_RCVTIMEO=number.  See socket(7) for details about these options.
 
         SO_RCVTIMEO=number.  See socket(7) for details about these options.
 
         The tbench_srv can only take one option: -T option[,...]  as documented above.
 
         The tbench_srv can only take one option: -T option[,...]  as documented above.
 
 
==Contoh 1==
 
 
# Create a bunch of files
 
# OPEN 
 
# Flags are the combination of these flags, ored together
 
#    0x01    O_RDONLY
 
#    0x02    O_WRONLY
 
#    0x04    O_RDWR
 
#
 
#    0x08    O_CREAT create the file if it does nto exist
 
#    0x10    O_EXCL  fail if the file already exists
 
#    0x20    O_TRUNC if the file exists, truncate it
 
#    0x40    O_APPEND open in append mode only
 
OPEN "/file0" 0x1c SUCCESS
 
WRITE "/file0" 0 32768 SUCCESS
 
WRITE "/file0" 32768 32768 SUCCESS
 
CLOSE "/file0" SUCCESS
 
#
 
OPEN "/file1" 0x1c SUCCESS
 
WRITE "/file1" 0 32768 SUCCESS
 
WRITE "/file1" 32768 32768 SUCCESS
 
CLOSE "/file1" SUCCESS
 
#
 
OPEN "/file2" 0x1c SUCCESS
 
WRITE "/file2" 0 32768 SUCCESS
 
WRITE "/file2" 32768 32768 SUCCESS
 
CLOSE "/file2" SUCCESS
 
#
 
OPEN "/file3" 0x1c SUCCESS
 
WRITE "/file3" 0 32768 SUCCESS
 
WRITE "/file3" 32768 32768 SUCCESS
 
CLOSE "/file3" SUCCESS
 
#
 
OPEN "/file4" 0x1c SUCCESS
 
WRITE "/file4" 0 32768 SUCCESS
 
WRITE "/file4" 32768 32768 SUCCESS
 
CLOSE "/file4" SUCCESS
 
 
dbench -B smb --smb-share=//192.168.0.7/share --smb-user=onno%123456789 --loadfile=contoh1.txt --run-once --skip-cleanup 10
 
 
dbench version 4.00 - Copyright Andrew Tridgell 1999-2004
 
 
Running for 600 seconds with load 'smb-writefiles.txt' and minimum warmup 120 secs
 
0 of 10 processes prepared for launch  0 sec
 
7 of 10 processes prepared for launch  0 sec
 
10 of 10 processes prepared for launch  0 sec
 
releasing clients
 
  10        32    2.44 MB/sec  warmup  1 sec  latency 228.466 ms
 
  10        37    2.49 MB/sec  warmup  1 sec  latency 512.282 ms
 
 
  Operation                Count    AvgLat    MaxLat
 
  --------------------------------------------------
 
  CLOSE                      50    95.240  221.051
 
  OPEN                        50    62.833  240.597
 
  WRITE                      100    30.972  250.154
 
 
Throughput 0 MB/sec  10 clients  10 procs  max_latency=512.282 ms
 
 
==Contoh 2==
 
 
# OPEN 
 
# Flags are the combination of these flags, ored together
 
#    0x01    O_RDONLY
 
#    0x02    O_WRONLY
 
#    0x04    O_RDWR
 
#
 
#    0x08    O_CREAT create the file if it does nto exist
 
#    0x10    O_EXCL  fail if the file already exists
 
#    0x20    O_TRUNC if the file exists, truncate it
 
#    0x40    O_APPEND open in append mode only
 
OPEN "/file0" 0x01 SUCCESS
 
READ "/file0" 0 32768 SUCCESS
 
READ "/file0" 32768 32768 SUCCESS
 
CLOSE "/file0" SUCCESS
 
#
 
OPEN "/file1" 0x01 SUCCESS
 
READ "/file1" 0 32768 SUCCESS
 
READ "/file1" 32768 32768 SUCCESS
 
CLOSE "/file1" SUCCESS
 
#
 
OPEN "/file2" 0x01 SUCCESS
 
READ "/file2" 0 32768 SUCCESS
 
READ "/file2" 32768 32768 SUCCESS
 
CLOSE "/file2" SUCCESS
 
#
 
OPEN "/file3" 0x01 SUCCESS
 
READ "/file3" 0 32768 SUCCESS
 
READ "/file3" 32768 32768 SUCCESS
 
CLOSE "/file3" SUCCESS
 
#
 
OPEN "/file4" 0x01 SUCCESS
 
READ "/file4" 0 32768 SUCCESS
 
READ "/file4" 32768 32768 SUCCESS
 
CLOSE "/file4" SUCCESS
 
 
./dbench -B smb --smb-share=//10.0.0.33/data --smb-user=Administrator%password --loadfile=smb-readfiles.txt --timelimit=10 --skip-cleanup 10
 
  
  
Line 140: Line 43:
  
 
* [[Benchmark]]
 
* [[Benchmark]]
 +
* [[dbench: Internet Offline]]
 +
* [[dbench: Internet Offline - Rpi 10-100 concurrent]]
 +
* [[dbench: Internet Offline - 60 concurrent]]
 +
* [[dbench: alternatif loadfile]]

Latest revision as of 04:46, 12 December 2018

Install

apt install dbench

Run

dbench [options]numclients
tbench [options]numclientsserver tbench_srv [options]

Folder yang akan di test /mnt/public yang di link ke salah satu SMB Server yang akan di test Gunakan client.txt bawaan dari dbench

dbench --directory=/mnt/public/ --loadfile=/usr/share/dbench/client.txt --skip-cleanup 20

Switch --skip-cleanup menentukan berapa concurrent worker / proses yang akan di pekerjakan untuk melakukan benchmarking tersebut

Option

-c client.txt
       Use  this  as  the  full  path  name  of  the  client.txt  file  (the  default   is
       /usr/share/dbench/client.txt).
-s     Use synchronous file IO on all file operations.
-t TIME
       set the runtime of the benchmark in seconds (default 600)
-D DIR set the base directory to run the filesystem operations in
-x     enable  xattr support, simulating the xattr operations Samba4 would need to perform
       to run the load
-S     Use synchronous IO for all directory operations (unlink, rmdir, mkdir and rename).
       The tbench program takes a number, which indicates the number  of  clients  to  run
       simultaneously,  and  a  server  name:  tbench_srv should be invoked on that server
       before invoking tbench.  tbench can also take the following options:
-T option[,...]
       This sets the socket options for the connection to the server.  The options  are  a
       comma-separated  list  of one or more of the following: SO_KEEPALIVE, SO_REUSEADDR,
       SO_BROADCAST,    SO_NODELAY,    SO_LOWDELAY,    SO_THROUGHPUT,    SO_SNDBUF=number,
       SO_RCVBUF=number,  SO_SNDLOWAT=number,  SO_RCVLOWAT=number,  SO_SNDTIMEO=number,and
       SO_RCVTIMEO=number.  See socket(7) for details about these options.
       The tbench_srv can only take one option: -T option[,...]  as documented above.


Pranala Menarik