Dbench

From OnnoWiki
Revision as of 08:49, 11 December 2018 by Onnowpurbo (talk | contribs) (→‎Contoh 1)
Jump to navigation Jump to search

Install

apt install dbench

Run

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

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.

Contoh 1

Edit

vi /usr/share/dbench/contoh1.txt

Isi

# 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 -D /mnt/public -c /usr/share/dbench/contoh1.txt --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


Pranala Menarik