You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hui Xiao
d665afdbf3
Account memory of FileMetaData in global memory limit (#9924)
Summary:
**Context/Summary:**
As revealed by heap profiling, allocation of `FileMetaData` for [newly created file added to a Version](https://github.com/facebook/rocksdb/pull/9924/files#diff-a6aa385940793f95a2c5b39cc670bd440c4547fa54fd44622f756382d5e47e43R774) can consume significant heap memory. This PR is to account that toward our global memory limit based on block cache capacity.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/9924
Test Plan:
- Previous `make check` verified there are only 2 places where the memory of the allocated `FileMetaData` can be released
- New unit test `TEST_P(ChargeFileMetadataTestWithParam, Basic)`
- db bench (CPU cost of `charge_file_metadata` in write and compact)
- **write micros/op: -0.24%** : `TEST_TMPDIR=/dev/shm/testdb ./db_bench -benchmarks=fillseq -db=$TEST_TMPDIR -charge_file_metadata=1 (remove this option for pre-PR) -disable_auto_compactions=1 -write_buffer_size=100000 -num=4000000 | egrep 'fillseq'`
- **compact micros/op -0.87%** : `TEST_TMPDIR=/dev/shm/testdb ./db_bench -benchmarks=fillseq -db=$TEST_TMPDIR -charge_file_metadata=1 -disable_auto_compactions=1 -write_buffer_size=100000 -num=4000000 -numdistinct=1000 && ./db_bench -benchmarks=compact -db=$TEST_TMPDIR -use_existing_db=1 -charge_file_metadata=1 -disable_auto_compactions=1 | egrep 'compact'`
table 1 - write
#-run | (pre-PR) avg micros/op | std micros/op | (post-PR) micros/op | std micros/op | change (%)
-- | -- | -- | -- | -- | --
10 | 3.9711 | 0.264408 | 3.9914 | 0.254563 | 0.5111933721
20 | 3.83905 | 0.0664488 | 3.8251 | 0.0695456 | -0.3633711465
40 | 3.86625 | 0.136669 | 3.8867 | 0.143765 | 0.5289363078
80 | 3.87828 | 0.119007 | 3.86791 | 0.115674 | **-0.2673865734**
160 | 3.87677 | 0.162231 | 3.86739 | 0.16663 | **-0.2419539978**
table 2 - compact
#-run | (pre-PR) avg micros/op | std micros/op | (post-PR) micros/op | std micros/op | change (%)
-- | -- | -- | -- | -- | --
10 | 2,399,650.00 | 96,375.80 | 2,359,537.00 | 53,243.60 | -1.67
20 | 2,410,480.00 | 89,988.00 | 2,433,580.00 | 91,121.20 | 0.96
40 | 2.41E+06 | 121811 | 2.39E+06 | 131525 | **-0.96**
80 | 2.40E+06 | 134503 | 2.39E+06 | 108799 | **-0.78**
- stress test: `python3 tools/db_crashtest.py blackbox --charge_file_metadata=1 --cache_size=1` killed as normal
Reviewed By: ajkr
Differential Revision: D36055583
Pulled By: hx235
fbshipit-source-id: b60eab94707103cb1322cf815f05810ef0232625
|
2 years ago |
.. |
cache.cc
|
Enable SecondaryCache::CreateFromString to create sec cache based on the uri for CompressedSecondaryCache (#10132)
|
2 years ago |
cache_bench.cc
|
Add (& fix) some simple source code checks (#8821)
|
3 years ago |
cache_bench_tool.cc
|
Make the per-shard hash table fixed-size. (#10154)
|
2 years ago |
cache_entry_roles.cc
|
Account memory of FileMetaData in global memory limit (#9924)
|
2 years ago |
cache_entry_roles.h
|
Expose `CacheEntryRole` and map keys for block cache stat collections (#9838)
|
3 years ago |
cache_entry_stats.h
|
New stable, fixed-length cache keys (#9126)
|
3 years ago |
cache_helpers.h
|
Use deleters to label cache entries and collect stats (#8297)
|
4 years ago |
cache_key.cc
|
Enhance new cache key testing & comments (#9329)
|
3 years ago |
cache_key.h
|
New stable, fixed-length cache keys (#9126)
|
3 years ago |
cache_reservation_manager.cc
|
Account memory of FileMetaData in global memory limit (#9924)
|
2 years ago |
cache_reservation_manager.h
|
Account memory of FileMetaData in global memory limit (#9924)
|
2 years ago |
cache_reservation_manager_test.cc
|
Meta-internal folly integration with F14FastMap (#9546)
|
3 years ago |
cache_test.cc
|
Make the per-shard hash table fixed-size. (#10154)
|
2 years ago |
clock_cache.cc
|
Update Cache::Release param from force_erase to erase_if_last_ref (#9728)
|
3 years ago |
clock_cache.h
|
Change RocksDB License
|
7 years ago |
compressed_secondary_cache.cc
|
Prevent double caching in the compressed secondary cache (#9747)
|
3 years ago |
compressed_secondary_cache.h
|
Prevent double caching in the compressed secondary cache (#9747)
|
3 years ago |
compressed_secondary_cache_test.cc
|
Enable SecondaryCache::CreateFromString to create sec cache based on the uri for CompressedSecondaryCache (#10132)
|
2 years ago |
fast_lru_cache.cc
|
Make the per-shard hash table fixed-size. (#10154)
|
2 years ago |
fast_lru_cache.h
|
Make the per-shard hash table fixed-size. (#10154)
|
2 years ago |
lru_cache.cc
|
Avoid malloc_usable_size() call inside LRU Cache mutex (#10026)
|
2 years ago |
lru_cache.h
|
Avoid malloc_usable_size() call inside LRU Cache mutex (#10026)
|
2 years ago |
lru_cache_test.cc
|
Make the per-shard hash table fixed-size. (#10154)
|
2 years ago |
sharded_cache.cc
|
Update Cache::Release param from force_erase to erase_if_last_ref (#9728)
|
3 years ago |
sharded_cache.h
|
Update Cache::Release param from force_erase to erase_if_last_ref (#9728)
|
3 years ago |