]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/erasure-code: increase ceph_erasure_code_benchmark default buffer size
authorJamie Pryde <jamiepry@uk.ibm.com>
Fri, 23 Aug 2024 20:53:41 +0000 (20:53 +0000)
committerJamie Pryde <jamiepry@uk.ibm.com>
Wed, 28 Aug 2024 16:08:42 +0000 (16:08 +0000)
Signed-off-by: Jamie Pryde <jamiepry@uk.ibm.com>
qa/workunits/erasure-code/bench.sh
src/test/erasure-code/ceph_erasure_code_benchmark.cc

index fc75830dfd014c5ce85b2cee002f0ea8dcf36fc7..87e997c3500f91d85c1ef6f796827abf56f276c3 100755 (executable)
@@ -17,7 +17,8 @@
 #
 # Test that it works from sources with:
 #
-#  CEPH_ERASURE_CODE_BENCHMARK=src/ceph_erasure_code_benchmark  \
+#  TOTAL_SIZE=$((4 * 1024 * 1024)) SIZE=4096 \
+#  CEPH_ERASURE_CODE_BENCHMARK=build/bin/ceph_erasure_code_benchmark  \
 #  PLUGIN_DIRECTORY=build/lib \
 #      qa/workunits/erasure-code/bench.sh fplot jerasure |
 #      tee qa/workunits/erasure-code/bench.js
 #  firefox qa/workunits/erasure-code/bench.html
 #
 # Once it is confirmed to work, it can be run with a more significant
-# volume of data so that the measures are more reliable:
+# volume of data so that the measures are more reliable. Ideally the size
+# of the buffers (SIZE) should be larger than the L3 cache to avoid cache hits.
+# The following example uses an 80MB (80 * 1024 * 1024) buffer.
+# A larger buffer with fewer iterations (iterations = TOTAL SIZE / SIZE) should result in
+# more time spent encoding/decoding and less time allocating/aligning buffers:
 #
-#  TOTAL_SIZE=$((4 * 1024 * 1024 * 1024)) \
-#  CEPH_ERASURE_CODE_BENCHMARK=src/ceph_erasure_code_benchmark  \
+#  TOTAL_SIZE=$((100 * 80 * 1024 * 1024)) SIZE=$((80 * 1024 * 1024)) \
+#  CEPH_ERASURE_CODE_BENCHMARK=build/bin/ceph_erasure_code_benchmark  \
 #  PLUGIN_DIRECTORY=build/lib \
 #      qa/workunits/erasure-code/bench.sh fplot jerasure |
 #      tee qa/workunits/erasure-code/bench.js
@@ -51,8 +56,8 @@ export PATH=/sbin:$PATH
 : ${PLUGIN_DIRECTORY:=/usr/lib/ceph/erasure-code}
 : ${PLUGINS:=isa jerasure}
 : ${TECHNIQUES:=vandermonde cauchy liberation reed_sol_r6_op blaum_roth liber8tion}
-: ${TOTAL_SIZE:=$((1024 * 1024))}
-: ${SIZE:=4096}
+: ${TOTAL_SIZE:=$((100 * 80 * 1024 * 1024))} #TOTAL_SIZE / SIZE = number of encode or decode iterations to run
+: ${SIZE:=$((80 * 1024 * 1024))} #size of buffer to encode/decode
 : ${PARAMETERS:=--parameter jerasure-per-chunk-alignment=true}
 
 declare -rA isa_techniques=(
index c86e58697c071b56692c27770f4b7ec18b911484..00054bf4784d8c4581f258f220fb022f81cf9be5 100644 (file)
@@ -52,9 +52,9 @@ int ErasureCodeBench::setup(int argc, char** argv) {
   desc.add_options()
     ("help,h", "produce help message")
     ("verbose,v", "explain what happens")
-    ("size,s", po::value<int>()->default_value(1024 * 1024),
+    ("size,s", po::value<int>()->default_value(80 * 1024 * 1024),
      "size of the buffer to be encoded")
-    ("iterations,i", po::value<int>()->default_value(1),
+    ("iterations,i", po::value<int>()->default_value(100),
      "number of encode/decode runs")
     ("plugin,p", po::value<string>()->default_value("jerasure"),
      "erasure code plugin name")