Prev | Current Page 242 | Next

Brad Ediger

"Advanced Rails"

We specify the
benchmark from benchmarks.yml with the -bm= option, and we specify 20 trials with
the RAILS_PERF_RUNS variable:
$ RAILS_PERF_RUNS=20 perf_run 100 -bm=searches_create
benchmarking 20 runs with options 100 -bm=searches_create
perf data file: ./perf_run.searches_create.txt
requests=100, options=-bm=searches_create
loading environment 2.43529
page request total stddev% r/s ms/r
searches_create 44.70490 0.4030 2.24 447.05
all requests 44.70490 0.4030 2.24 447.05
Railsbench can benchmark multiple actions during the same run. We
are only benchmarking one action here, so we can just look at the
searches_create line in this table for our information. The last line is
just a summary.
The data shows us that we averaged 2.24 requests per second (447.05 milliseconds
per request). Each of 20 trials involves 100 requests, so the mean runtime for each
trial was 44.705 seconds. The standard deviation for that figure was 0.4030% of the
mean, or 0.180 seconds. (Thus, 95% of the trials should fall between 44.34 seconds
and 45.06 seconds, two standard deviations away from the mean.)
perf_run saves its raw data for this run in perf_run.searches_create.txt, and we will
feed that file into other utilities for analysis. Between each benchmark, we store this
file away for comparison across the different versions under test.
Interpreting the results
Railsbench includes a utility called perf_comp that will compare results between different
runs of perf_run.


Pages:
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254