From: Mark Nelson <mark.a.nelson@gmail.com>
To: Ben England <bengland@redhat.com>, fio@vger.kernel.org
Subject: Re: suggestion: patch to make per-thread IOPS more accurate
Date: Thu, 26 Feb 2015 15:21:52 -0600 [thread overview]
Message-ID: <54EF8E70.1000504@gmail.com> (raw)
In-Reply-To: <1745095866.10478940.1424039625224.JavaMail.zimbra@redhat.com>
Hi Ben,
I confess that I'm not using JSON output myself, but I think this would
be really beneficial when there are a lot of clients (like VMs).
Jens, would this be an acceptable change? I think I'd appreciate this
if I switch over to using the JSON output.
Mark
On 02/15/2015 04:33 PM, Ben England wrote:
> The following small patch to stat.c (using fio 2.2.4 from github) outputs IOPS field in JSON format as a floating point number instead of an integer. This improves accuracy in case where fio --client runs use lots of threads with single-digit IOPS per thread. It seems to work, here's a snippet of output from a short fio run with rate_iops=10 in the job file.
>
> "write" : {
> "io_bytes" : 6464,
> "bw" : 646,
> "iops" : 10.10,
> "runtime" : 10000,
>
> Why the patch: IOPS number is rounded to integer in stats.c calls to num2str(). This doesn't sound like much of a problem because in many use cases, with large IOPS number the error is negligible. But in this use case where we have many threads (we would like to get into the thousands eventually), the IOPS/thread may be quite low and integer rounding can introduce significant error. For example, if we are doing 5,000 IOPS over 1,000 threads, average throughput is 5 IOPS and potential error is ~20%, but some threads could have much higher error in IOPS because of integer format.
>
> background: fio's --client option could prove *extremely* useful for work where we inject I/O workload from tens, hundreds or even thousands of VMs to an OpenStack, container or other virtualization environment. I really like this feature combined with "fio --server --daemonize=/var/run/fio-svr.pid" command run on workload generators, because it means that we don't have to use ssh/pdsh to start up a connection and launch the workload generator on each host. ssh is problematic for this, I have to throttle it because it locks up if you have too many concurrent ssh sessions starting up. pdsh is better but still has limits because you actually have to start each thread up from scratch, sometimes in competition with the workload you want to measure.
>
> --- stat.c.sav 2015-01-23 16:22:14.566717417 -0500
> +++ stat.c 2015-01-23 16:49:53.287962156 -0500
> @@ -674,7 +674,8 @@
> struct group_run_stats *rs, int ddir, struct json_object *parent)
> {
> unsigned long min, max;
> - unsigned long long bw, iops;
> + unsigned long long bw;
> + double iops;
> unsigned int *ovals = NULL;
> double mean, dev;
> unsigned int len, minv, maxv;
> @@ -698,12 +699,12 @@
> uint64_t runt = ts->runtime[ddir];
>
> bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024;
> - iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt;
> + iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt;
> }
>
> json_object_add_value_int(dir_object, "io_bytes", ts->io_bytes[ddir] >> 10);
> json_object_add_value_int(dir_object, "bw", bw);
> - json_object_add_value_int(dir_object, "iops", iops);
> + json_object_add_value_float(dir_object, "iops", iops);
> json_object_add_value_int(dir_object, "runtime", ts->runtime[ddir]);
> json_object_add_value_int(dir_object, "total_ios", ts->total_io_u[ddir]);
> json_object_add_value_int(dir_object, "short_ios", ts->short_io_u[ddir]);
> --
> To unsubscribe from this list: send the line "unsubscribe fio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-02-26 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <596106035.8980737.1421443175599.JavaMail.zimbra@redhat.com>
[not found] ` <54B982D7.1070503@kernel.dk>
[not found] ` <177931222.1695665.1422463951931.JavaMail.zimbra@redhat.com>
2015-02-15 22:27 ` suggestion for fio --client to remove garbled output Ben England
[not found] ` <159806365.11854527.1422052704407.JavaMail.zimbra@redhat.com>
2015-02-15 22:33 ` suggestion: patch to make per-thread IOPS more accurate Ben England
2015-02-26 21:21 ` Mark Nelson [this message]
2015-02-26 23:20 ` Jens Axboe
2015-02-27 4:14 ` Andrew Theurer
2015-02-27 15:21 ` Jens Axboe
[not found] <2137206709.6359691.1424464503833.JavaMail.zimbra@redhat.com>
2015-02-20 20:38 ` Andrew Theurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54EF8E70.1000504@gmail.com \
--to=mark.a.nelson@gmail.com \
--cc=bengland@redhat.com \
--cc=fio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox