Sunday 19 March 2017

Is reproducible benchmarking possible?

I need to test some node frameworks, or at least their routing part. That means from the request arrives at the node process for processing until a route has been decided and a function/class with the business logic is called, e.g. just before calling it. I have looked hard and long for a suitable approach, but concluded that it must be done directly in the code and not using an external benchmark tool. I fear measuring the wrong attributes. I tried artillery and ab but they measure a lot more attributes then I want to measure, like RTT, bad OS scheduling, random tasks executing in the OS and so on. My initial benchmarks for my custom routing code using process.hrtime() shows approx. 0.220 ms (220 microseconds) execution time but the external measure shows 0.700 (700 microseconds) which is not an acceptable difference, since it's 3.18x additional time. Sometimes execution time jumps to 1.x seconds due to GC or system tasks. Now I wonder how a reproducible approach would look like? Maybe like this:

  • Use Docker with Scientific Linux to get a somewhat controlled environment.
  • A minimal docker container install, node enabled container only, no extras.
  • Store time results in global scope until test is done and then save to disk.
  • Terminate all applications with high/moderate diskIO and/or CPU on host OS.
  • Measure time as explained before and crossing my fingers.

Any other recommendations to take into consideration?



via Gillsoft AB

No comments:

Post a Comment