[stgt] iscsi load generator and benchmark tool

ronnie sahlberg ronniesahlberg at gmail.com
Fri Sep 25 06:39:59 CEST 2009


You might find this tool useful.
I recently added very simple iscsi support to DBENCH ( http://dbench.samba.org )
so that dbench has a minimal iscsi initiator built in.

This is sometimes useful since it allows to bypass any iscsi initiator
layer, like open-iscsi, on the host and to get full control of exactly
what commands will be issued to the target and accurate measures since
one can know that the data was served across the network and not from
a local cache.
It is also useful since it can generate very high loads, much higher
than I have been anble to generate by doing i/o through a lun mapped
through the built in initiator in linux.

Here i am mainly interested in high load for very small i/o sizes. I
use 1k i/o size in my tests to be as pathological in my tests as
possible. But you can run tests with any i/o size.

The basic syntax is :

$ ./dbench -B iscsi --loadfile=iscsi.txt --iscsi-lun=1
--iscsi-portal= --iscsi-port=3260
--iscsi-target=iqn.2007-03:mptest --warmup=0 --run-once 1

to run the loadfile once and then exit and with 1 client.


$ ./dbench -B iscsi --loadfile=iscsi.txt --iscsi-lun=1
--iscsi-portal= --iscsi-port=3260
--iscsi-target=iqn.2007-03:mptest --warmup=0 --timelimit=5 10

to run the loadfile over and over until the time runs out  and using
10 threads of execution.

The actual loadfile is a simple text file with one command , or
comment, per line :
This is the example loadfile for iscsi in loadfiles/iscsi.txt :
# timestamp TESTUNITREADY sense
# timestamp READ10 lba #xferlen rd grp sense
#   if lba is * this means to use a random lba
#   rd is :
#     3 bits     0xe0 : RDPROTECT
#     1 bit      0x10 : DPO
#     1 bit      0x08 : FUA
#     1 bit      0x02 : FUA_NV
0.000 READ10    0 2 0 0 0x00
0.000 READ10    2 2 0 0 0x00
0.000 READ10    4 2 0 0 0x00
0.000 READ10    6 2 0 0 0x00
0.000 READ10    * 2 0 0 0x00
# timestamp READCAPACITY10 lba pmi(0/1) sense
0.000 READCAPACITY10 0 0 0x00

Currently I have only implemented three commands, which is enough for
my usage right now, but it is easy to add more commands.

Loadfiles are often useful even when they are very simple and only
contain one single line :

1, a loadfile that just reads the same 2 blocks at lba 0 over and over and over.
This is useful for profiling and to see how many cdbs can the main
processing loop manage per second.
(It can actually manage very very many! but if you have 8/16 cpus that
loop can easily be saturated)
0.000 READ10    0 2 0 0 0x00

2, a loadfile that reads a random 1k from anywhere on the lun (it
knows how big the lun is so it can wrap the lba)
0.000 READ10    * 2 0 0 0x00

3, read the same 1M over and over to see how fast can tgtd push data
straight out of pagecache :
0.000 READ10    0 2048 0 0 0x00

Using this technique I can generate (a lot more than) many tens of
thousands of tiny I/O from one single client host aross the network.

Please comment if you find this useful or have ideas about enhancements.

ronnie sahlberg
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list