sysbench is a scriptable multi-threaded benchmark tool based on LuaJIT. It is most frequently used for database benchmarks, but can also be used to create arbitrarily complex workloads that do not involve a database server.
sysbench comes with the following bundled benchmarks:
oltp_*.lua: a collection of OLTP-like database benchmarks
fileio: a filesystem-level benchmark
cpu: a simple CPU benchmark
memory: a memory access benchmark
threads: a thread-based scheduler benchmark
mutex: a POSIX mutex benchmark
Features
extensive statistics about rate and latency is available, including latency percentiles and histograms;
low overhead even with thousands of concurrent threads. sysbench is capable of generating and tracking hundreds of millions of events per second;
new benchmarks can be easily created by implementing pre-defined hooks in user-provided Lua scripts;
can be used as a general-purpose Lua interpreter as well, simply replace #!/usr/bin/lua with #!/usr/bin/sysbench in your script.
fileio options: --file-num=N number of files to create [128] --file-block-size=N block size to use in all IO operations [16384] --file-total-size=SIZE total size of files to create [2G] --file-test-mode=STRING test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw} --file-io-mode=STRING file operations mode {sync,async,mmap} [sync] --file-extra-flags=[LIST,...] list of additional flags to use to open files {sync,dsync,direct} [] --file-fsync-freq=N do fsync() after this number of requests (0 - don't use fsync()) [100] --file-fsync-all[=on|off] do fsync() after each write operation [off] --file-fsync-end[=on|off] do fsync() at the end of test [on] --file-fsync-mode=STRING which method to use for synchronization {fsync, fdatasync} [fsync] --file-merged-requests=N merge at most this number of IO requests if possible (0 - don't merge) [0] --file-rw-ratio=N reads/writes ratio for combined test [1.5]