foundationdb/flowbench
Ata E Husain Bohra 591ef57857
Upgrade AES 128 GCM -> AES 256, StreamCipher code refactor (#6314)
* Upgrade AES 128 GCM -> AES 256, StreamCipher code refactor

Major changes proposed are:
1. Refactor StreamCipher code to enable instantiation of
   multiple encryption keys. However, code still retains
   a globalEncryption key semantics used in Backup file
   encryption usecase.
2. Enhance StreamCipher to provide HMAC signature digest
   generation. Further, the class implements HMAC encryption
   key derivation function.
3. Upgrade StreamCipher to use AES 256 GCM mode from currently
   supported AES 128 GCM mode.
   Note: The code changes the encryption key size, however, the
         feature is NOT currently in use, hence, should be OK.
3. Add EncryptionOps validation and benchmark toml supported
   workload, it does the following:
   a. Allow user to configure encrypt-decrypt of a fixed size
      buffer or variable size buffer [100, 512K]
   b. Allow user to configure number of interactions of the runs,
      in each iteration: generate random data, derive an encryption
      key using HMAC SHA256 method, encrypt data and
      then decrypt data. It collects following metrics:
    i) time taken to derive encryption key.
    ii) time taken to encrypt the buffer.
    iii) time taken to decrypt the buffer.
    iv) total bytes encrypted and/or decrypted
   c. Along with stats it basic basic validations on the encrypted
      and decrypted buffer
   d. On completion for test, records the above mentioned metrics
      in trace files.
2022-01-31 19:52:44 -06:00
..
BenchEncrypt.cpp Upgrade AES 128 GCM -> AES 256, StreamCipher code refactor (#6314) 2022-01-31 19:52:44 -06:00
BenchHash.cpp Separate out memory benchmarks in flowbench 2021-10-27 15:51:21 -07:00
BenchIterate.cpp Renamed fdbbench to flowbench 2020-08-03 15:45:47 -07:00
BenchMem.cpp Add some includes to BenchMem.cpp 2021-10-28 10:22:50 -07:00
BenchMetadataCheck.cpp Add include to BenchMetadataCheck.cpp 2021-06-02 21:28:37 -07:00
BenchPopulate.cpp Renamed fdbbench to flowbench 2020-08-03 15:45:47 -07:00
BenchRandom.cpp Added flowbench/README.md 2020-08-04 14:53:46 -07:00
BenchRef.cpp Add benchmark and document entities touched 2021-04-26 17:46:35 +00:00
BenchStream.actor.cpp Added flowbench/README.md 2020-08-04 14:53:46 -07:00
BenchTimer.cpp Added flowbench/README.md 2020-08-04 14:53:46 -07:00
CMakeLists.txt Separate out memory benchmarks in flowbench 2021-10-27 15:51:21 -07:00
GlobalData.cpp Replace xxhash64 with xxhash3 2020-11-21 18:25:35 -08:00
GlobalData.h Renamed fdbbench to flowbench 2020-08-03 15:45:47 -07:00
README.md Exclude flowbench target from all 2020-10-10 15:03:53 -07:00
benchmark.cmake Upgrade google benchmark to v1.6.0 2021-12-02 16:06:40 -08:00
flowbench.actor.cpp Renamed fdbbench to flowbench 2020-08-03 15:45:47 -07:00

README.md

Summary

flowbench is an executable that can be used to microbenchmark parts of the FoundationDB code. The goal is to make it easy to test the performance of various sub-millisecond operations using flow and fdbrpc. Specifically, this tool can be used to:

  • Test the performance effects of changes to the actor compiler or to the flow and fdbrpc libraries
  • Test the performance of various uses of the flow and fdbrpc libraries
  • Find areas for improvement in the flow and fdbrpc libraries
  • Compare flow/fdbrpc primitives to alternatives provided by the standard library or other third-party libraries.

Usage

  • To build the flowbench executable, run ninja flowbench or make flowbench depending on which build system you're using.
  • Then you can run bin/flowbench --help to see possible uses of flowbench.
  • Running bin/flowbench directly will run all registered benchmarks, but you may want to limit your run to a subset of benchmarks. This can be done by running bin/flowbench --benchmark_filter=<regex>
  • All benchmark names can be listed with bin/flowbench --benchmark_list_tests
  • Example output:
$ bin/flowbench --benchmark_filter=bench_ref
2020-08-04 21:49:40
Running bin/flowbench
Run on (7 X 2904 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x7)
  L1 Instruction 32 KiB (x7)
  L2 Unified 256 KiB (x7)
  L3 Unified 12288 KiB (x1)
Load Average: 0.15, 0.15, 0.72
---------------------------------------------------------------------------------------------------------------
Benchmark                                                     Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------------------------------------
bench_ref_create_and_destroy<RefType::RawPointer>          4.90 ns         4.90 ns    116822124 items_per_second=203.88M/s
bench_ref_create_and_destroy<RefType::UniquePointer>       4.94 ns         4.94 ns    141101924 items_per_second=202.555M/s
bench_ref_create_and_destroy<RefType::SharedPointer>       42.5 ns         42.5 ns     13802909 items_per_second=23.531M/s
bench_ref_create_and_destroy<RefType::FlowReference>       5.05 ns         5.05 ns    100000000 items_per_second=197.955M/s
bench_ref_copy<RefType::RawPointer>                        1.15 ns         1.15 ns    612121585 items_per_second=871.218M/s
bench_ref_copy<RefType::SharedPointer>                     10.0 ns         10.0 ns     67553102 items_per_second=99.8113M/s
bench_ref_copy<RefType::FlowReference>                     2.33 ns         2.33 ns    292317474 items_per_second=428.507M/s

Existing Benchmarks

  • bench_populate measures the population of a vector of mutations
  • bench_ref compares the performance of the flow Reference type to other pointer types
  • bench_iterate measures iteration over a list of mutations
  • bench_stream measures the performance of writing to and reading from a PromiseStream
  • bench_random measures the performance of DeterministicRandom.
  • bench_timer measures the perforamnce of FoundationDB timers.

Future use cases

  • Benchmark the overhead of sending and receiving messages through FlowTransport
  • Benchmark the performance of serializing/deserializing various types