Find a file
Andrew Kryczka ed75dddc35 Optimize db_stress setup phase (#9475)
Summary:
It is too slow that our `db_crashtest.py` often kills `db_stress` before
the setup phase completes. Profiled it and found a few ways to optimize.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9475

Test Plan:
Measured setup phase time reduced 22% (36 -> 28 seconds) for first run, and
36% (38 -> 24 seconds) for non-first run on empty-ish DB.

- first run benchmark command: `rm -rf /dev/shm/dbstress*/ && mkdir -p /dev/shm/dbstress_expected/ && ./db_stress -max_key=100000000 -destroy_db_initially=1 -expected_values_dir=/dev/shm/dbstress_expected/ -db=/dev/shm/dbstress/ --clear_column_family_one_in=0 --reopen=0 --nooverwritepercent=1`

output before this PR:

```
2022/01/31-11:14:05  Initializing db_stress
...
2022/01/31-11:14:41  Starting database operations
```

output after this PR:

```
...
2022/01/31-11:12:23  Initializing db_stress
...
2022/01/31-11:12:51  Starting database operations
```

- non-first run benchmark command: `./db_stress -max_key=100000000 -destroy_db_initially=0 -expected_values_dir=/dev/shm/dbstress_expected/ -db=/dev/shm/dbstress/ --clear_column_family_one_in=0 --reopen=0 --nooverwritepercent=1`

output before this PR:

```
2022/01/31-11:20:45  Initializing db_stress
...
2022/01/31-11:21:23  Starting database operations
```

output after this PR:

```
2022/01/31-11:22:02  Initializing db_stress
...
2022/01/31-11:22:26  Starting database operations
```

- ran minified crash test a while: `DEBUG_LEVEL=0 TEST_TMPDIR=/dev/shm python3 tools/db_crashtest.py blackbox --simple --interval=10 --max_key=1000000 --write_buffer_size=1048576 --target_file_size_base=1048576 --max_bytes_for_level_base=4194304 --value_size_mult=33`

Reviewed By: anand1976

Differential Revision: D33897793

Pulled By: ajkr

fbshipit-source-id: 0d7b2c93e1e2a9f8a878e87632c2455406313087
2022-02-01 11:47:28 -08:00
.circleci Fix compilation errors and add fuzzers to CircleCI (#9420) 2022-02-01 10:32:15 -08:00
.github/workflows
buckifier Update TARGETS and related scripts (#9310) 2021-12-17 11:51:51 -08:00
build_tools Remove deprecated API AdvancedColumnFamilyOptions::soft_rate_limit/hard_rate_limit (#9452) 2022-01-27 13:01:09 -08:00
cache Fix unity build with SUPPORT_CLOCK_CACHE (#9309) 2021-12-17 14:15:07 -08:00
cmake gcc-11 and cmake related cleanup (#9286) 2021-12-17 17:04:35 -08:00
coverage
db Revisit #9118 for compaction outputs (#9480) 2022-02-01 11:08:34 -08:00
db_stress_tool Optimize db_stress setup phase (#9475) 2022-02-01 11:47:28 -08:00
docs New blog post for Ribbon filter (#8992) 2021-12-28 21:54:39 -08:00
env Move HDFS support to separate repo (#9170) 2022-01-24 20:23:54 -08:00
examples Remove deprecated option DBOptions::skip_log_error_on_recovery (#9434) 2022-01-28 01:46:04 -08:00
file Disallow a combination of options (#9348) 2022-01-27 19:30:24 -08:00
fuzz Fix compilation errors and add fuzzers to CircleCI (#9420) 2022-02-01 10:32:15 -08:00
include/rocksdb Ignore total_order_seek in DB::Get (#9427) 2022-01-31 19:46:42 -08:00
java Remove deprecated API AdvancedColumnFamilyOptions::rate_limit_delay_max_milliseconds (#9455) 2022-01-28 16:47:08 -08:00
logging
memory Fix compilation error when building static_lib (#9377) 2022-01-12 09:04:01 -08:00
memtable Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
microbench Add more micro-benchmark tests (#9436) 2022-02-01 09:01:55 -08:00
monitoring Restore Regex support for ObjectLibrary::Register, rename new APIs to allow old one to be deprecated in the future (#9362) 2022-01-11 06:33:48 -08:00
options Remove deprecated API AdvancedColumnFamilyOptions::rate_limit_delay_max_milliseconds (#9455) 2022-01-28 16:47:08 -08:00
plugin
port Add to HISTORY and minor loose ends from #9294, #9254 (#9386) 2022-01-21 13:04:19 -08:00
table Ignore total_order_seek in DB::Get (#9427) 2022-01-31 19:46:42 -08:00
test_util Remove deprecated API AdvancedColumnFamilyOptions::rate_limit_delay_max_milliseconds (#9455) 2022-01-28 16:47:08 -08:00
third-party Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
tools Ignore total_order_seek in DB::Get (#9427) 2022-01-31 19:46:42 -08:00
trace_replay Added TraceOptions::preserve_write_order (#9334) 2021-12-28 15:04:26 -08:00
util Disallow a combination of options (#9348) 2022-01-27 19:30:24 -08:00
utilities Remove obsolete backupable_db.h, utility_db.h (#9438) 2022-01-27 15:45:30 -08:00
.clang-format
.gitignore
.lgtm.yml
.travis.yml
.watchmanconfig
appveyor.yml Remove VS2017 from Appveyor CI (#9417) 2022-01-21 16:16:00 -08:00
AUTHORS
CMakeLists.txt Remove deprecated ObjectLibrary::Register() (and Regex public API) (#9439) 2022-01-26 16:22:44 -08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYING
DEFAULT_OPTIONS_HISTORY.md Add Options::DisableExtraChecks, clarify force_consistency_checks (#9363) 2022-01-18 17:31:03 -08:00
defs.bzl
DUMP_FORMAT.md
HISTORY.md Revisit #9118 for compaction outputs (#9480) 2022-02-01 11:08:34 -08:00
INSTALL.md
issue_template.md
LANGUAGE-BINDINGS.md
LICENSE.Apache
LICENSE.leveldb
Makefile Move RADOS support to separate repo (#9206) 2022-01-24 22:50:07 -08:00
PLUGINS.md Move RADOS support to separate repo (#9206) 2022-01-24 22:50:07 -08:00
README.md README: De-list slack channel, list Google group (#9387) 2022-01-18 08:19:48 -08:00
ROCKSDB_LITE.md
src.mk Remove deprecated ObjectLibrary::Register() (and Regex public API) (#9439) 2022-01-26 16:22:44 -08:00
TARGETS Remove deprecated ObjectLibrary::Register() (and Regex public API) (#9439) 2022-01-26 16:22:44 -08:00
thirdparty.inc
USERS.md
Vagrantfile
WINDOWS_PORT.md

RocksDB: A Persistent Key-Value Store for Flash and RAM Storage

CircleCI Status TravisCI Status Appveyor Build status PPC64le Build Status

RocksDB is developed and maintained by Facebook Database Engineering Team. It is built on earlier work on LevelDB by Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)

This code is a library that forms the core building block for a fast key-value server, especially suited for storing data on flash drives. It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF) and Space-Amplification-Factor (SAF). It has multi-threaded compactions, making it especially suitable for storing multiple terabytes of data in a single database.

Start with example usage here: https://github.com/facebook/rocksdb/tree/main/examples

See the github wiki for more explanation.

The public interface is in include/. Callers should not include or rely on the details of any other header files in this package. Those internal APIs may be changed without warning.

Questions and discussions are welcome on the RocksDB Developers Public Facebook group and email list on Google Groups.

License

RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.