Thursday, April 24, 2014

Measuring Read Sequential vs Random

If you want to measure an existing workload's seq vs random profile in IOPS, there's a pretty simple way.  Run this command (diag mode): stats show readahead.  The part you care about will look like this:

Table 1
readahead:readahead:seq_read_reqs.4K:71%
readahead:readahead:seq_read_reqs.8K:80%
readahead:readahead:seq_read_reqs.12K:78%
readahead:readahead:seq_read_reqs.16K:70%
readahead:readahead:seq_read_reqs.20K:75%
readahead:readahead:seq_read_reqs.24K:75%
readahead:readahead:seq_read_reqs.28K:78%
readahead:readahead:seq_read_reqs.32K:76%
readahead:readahead:seq_read_reqs.40K:77%
readahead:readahead:seq_read_reqs.48K:81%
readahead:readahead:seq_read_reqs.56K:79%
readahead:readahead:seq_read_reqs.64K:98%
readahead:readahead:seq_read_reqs.80K:86%
readahead:readahead:seq_read_reqs.96K:0%
readahead:readahead:seq_read_reqs.112K:0%
readahead:readahead:seq_read_reqs.128K:0%
readahead:readahead:seq_read_reqs.256K:0%
readahead:readahead:seq_read_reqs.384K:0%
readahead:readahead:seq_read_reqs.512K:0%
readahead:readahead:seq_read_reqs.1024K:0%

The first part is garbage: what we care about starts after the period.  The "56k" number is the approximate size of the IOP, and percentage is how many of that size were sequential during your measurement.  Ignore the first whole part, and focus on the percentile.  Just a glace shows you we have at least 75% seq read IOPS averaged across the IOPS sizes. That's good enough for most performance profiling questions.  

I don't think this is particularly useful, but I was asked recently the read random vs sequential throughput measurement as well.  We can also calculate that (roughly) here.  Notice this IOP size count:

Table 2
readahead:readahead:total_read_reqs.4K:94346
readahead:readahead:total_read_reqs.8K:34333
readahead:readahead:total_read_reqs.12K:9669
readahead:readahead:total_read_reqs.16K:8533
readahead:readahead:total_read_reqs.20K:19922
readahead:readahead:total_read_reqs.24K:4563
readahead:readahead:total_read_reqs.28K:4069
readahead:readahead:total_read_reqs.32K:12009
readahead:readahead:total_read_reqs.40K:10299
readahead:readahead:total_read_reqs.48K:5949
readahead:readahead:total_read_reqs.56K:4908
readahead:readahead:total_read_reqs.64K:2675102
readahead:readahead:total_read_reqs.80K:234257

You guessed it.  Multiply the corresponding # of IOPS times the size beside it, multiply that by the percentage that accompanies that IOP size in the first table.  For example:

readahead:readahead:total_read_reqs.32K:12009
readahead:readahead:seq_read_reqs.32K:76%

Calculation 1: 32*12,009 = 384,288Kb

This is your total Kb throughput at that IOP size.

Calcuation 2: 384,288Kb*76% = 292,058Kb

This is the sequential throughput at that IOP size.  Do each calculation for each size, then add all the Calc 1's up and all the Calc 2's.  Finally, divide the sum of the Calc 2's by the sum of the Calc 1's, and you have the percentage of the read throughput which is sequential!

No comments:

Post a Comment