Commit 47019903 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

rate test, iops

parent e14cfa56
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.SH NAME .SH NAME
ioping \- simple disk I/O latency monitoring tool ioping \- simple disk I/O latency monitoring tool
.SH SYNOPSYS .SH SYNOPSYS
\fBioping\fR [\fB\-LCDhq\fR] [\fB\-c \fIcount\fR] [\fB\-w \fIdeadline\fR] \ \fBioping\fR [\fB\-LCDRhq\fR] [\fB\-c \fIcount\fR] [\fB\-w \fIdeadline\fR] \
[\fB\-p \fIperiod\fR] [\fB\-i \fIinterval\fR] [\fB\-s \fIsize\fR] \ [\fB\-p \fIperiod\fR] [\fB\-i \fIinterval\fR] [\fB\-s \fIsize\fR] \
[\fB\-S \fIwsize\fR] [\fB\-o \fIoffset\fR] \ [\fB\-S \fIwsize\fR] [\fB\-o \fIoffset\fR] \
\fIdevice\fR | \fIfile\fR | \fIdirectory\fR \fIdevice\fR | \fIfile\fR | \fIdirectory\fR
...@@ -40,6 +40,9 @@ Use cached I/O. ...@@ -40,6 +40,9 @@ Use cached I/O.
\fB\-D\fR \fB\-D\fR
Use direct I/O. Use direct I/O.
.TP .TP
\fB\-R\fR
Rate-test, implies: -q -i 0 -w 3
.TP
\fB\-h\fR \fB\-h\fR
Display help message and exit. Display help message and exit.
.TP .TP
...@@ -97,3 +100,9 @@ until interrupted. ...@@ -97,3 +100,9 @@ until interrupted.
.TP .TP
.B ioping -c 10 -s 1M /tmp .B ioping -c 10 -s 1M /tmp
Measure latency on \fB/tmp\fR using 10 requests of 1 megabyte each. Measure latency on \fB/tmp\fR using 10 requests of 1 megabyte each.
.TP
.B ioping -R /dev/sda
Measure disk seek rate.
.TP
.B ioping -RL /dev/sda
Measure disk sequential speed.
...@@ -82,19 +82,20 @@ int posix_memalign(void **memptr, size_t alignment, size_t size) ...@@ -82,19 +82,20 @@ int posix_memalign(void **memptr, size_t alignment, size_t size)
void usage(void) void usage(void)
{ {
fprintf(stderr, fprintf(stderr,
" Usage: ioping [-LCDhq] [-c count] [-w deadline] [-p period] [-i interval]\n" " Usage: ioping [-LCDRhq] [-c count] [-w deadline] [-p period] [-i interval]\n"
" [-s size] [-S wsize] [-o offset] device|file|directory\n" " [-s size] [-S wsize] [-o offset] device|file|directory\n"
"\n" "\n"
" -c <count> stop after <count> requests\n" " -c <count> stop after <count> requests\n"
" -w <deadline> stop after <deadline>\n" " -w <deadline> stop after <deadline>\n"
" -p <period> print raw statistics for every <period> requests\n" " -p <period> print raw statistics for every <period> requests\n"
" -i <interval> interval between requests (1s)\n" " -i <interval> interval between requests\n"
" -s <size> request size (4k)\n" " -s <size> request size\n"
" -S <wsize> working set size (1m for dirs, full range for others)\n" " -S <wsize> working set size\n"
" -o <offset> in file offset\n" " -o <offset> in file offset\n"
" -L use sequential operations rather than random\n" " -L use sequential operations rather than random\n"
" -C use cached-io\n" " -C use cached-io\n"
" -D use direct-io\n" " -D use direct-io\n"
" -R rate-test, implies: -q -i 0 -w 3\n"
" -h display this message and exit\n" " -h display this message and exit\n"
" -q suppress human-readable output\n" " -q suppress human-readable output\n"
"\n" "\n"
...@@ -241,13 +242,20 @@ void parse_options(int argc, char **argv) ...@@ -241,13 +242,20 @@ void parse_options(int argc, char **argv)
exit(1); exit(1);
} }
while ((opt = getopt(argc, argv, "hLDCqi:w:s:S:c:o:p:")) != -1) { while ((opt = getopt(argc, argv, "hLRDCqi:w:s:S:c:o:p:")) != -1) {
switch (opt) { switch (opt) {
case 'h': case 'h':
usage(); usage();
exit(0); exit(0);
case 'L': case 'L':
randomize = 0; randomize = 0;
size = 1<<18;
temp_wsize = 1<<26;
break;
case 'R':
interval = 0;
deadline = 3000000;
quiet = 1;
break; break;
case 'D': case 'D':
direct = 1; direct = 1;
...@@ -609,8 +617,9 @@ int main (int argc, char **argv) ...@@ -609,8 +617,9 @@ int main (int argc, char **argv)
if (!quiet || !period) { if (!quiet || !period) {
printf("\n--- %s ioping statistics ---\n", path); printf("\n--- %s ioping statistics ---\n", path);
printf("%d requests completed in %.1f ms, %.1f mb/s\n", printf("%d requests completed in %.1f ms, %.0f iops %.1f mb/s\n",
request, time_total/1000., request, time_total/1000.,
request * 1000000. / time_sum,
(double)request * size / time_sum / (double)request * size / time_sum /
(1<<20) * 1000000); (1<<20) * 1000000);
printf("min/avg/max/mdev = %.1f/%.1f/%.1f/%.1f ms\n", printf("min/avg/max/mdev = %.1f/%.1f/%.1f/%.1f ms\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment