speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
882 stars 65 forks source link

db_bench: fresh db benchmark might increase thread pools sizes #784

Open Yuval-Ariel opened 8 months ago

Yuval-Ariel commented 8 months ago

When running a benchmark without the use_existing_db flag, the db is first destroyed with the default options without considering the flags supplied. here:

 if (!FLAGS_use_existing_db) {
      Options options;
      options.env = FLAGS_env;
      if (!FLAGS_wal_dir.empty()) {
        options.wal_dir = FLAGS_wal_dir;
      }
      if (use_blob_db_) {
        // Stacked BlobDB
        blob_db::DestroyBlobDB(FLAGS_db, options, blob_db::BlobDBOptions());
      }
      DestroyDB(FLAGS_db, options);

this might cause SanitizeOptions to call result.env->IncBackgroundThreadsIfNeeded(bg_job_limits.max_compactions, Env::Priority::LOW); result.env->IncBackgroundThreadsIfNeeded(bg_job_limits.max_flushes, Env::Priority::HIGH); with the default options for these flags and not the ones supplied in db bench. the test then doesnt shrink back these thread pools.