Comments (5)
A block stays in block cache until evicted by LRU.
From the LOG:
"raw_key_size": 901728 ... "raw_value_size": 1561798
So the uncompressed data size is only 1561798+901728 =~ 2.5MB. Block cache should hold all the blocks no matter its capacity is 8MB or 100MB.
What is the read performance issue? How much QPS are you trying to achieve?
from rocksdb.
A block stays in block cache until evicted by LRU.
So even the expired entries from sst files are removed during compaction. The cache still holds the value until it evicts by the LRU
What is the read performance issue? How much QPS are you trying to achieve?
In my use case, I didn't mean QPS but collection rate before and after using rocksdb.
Collection rate before rocksdb - 4000 per second (average).
Collection rate after rocksdb - 3800 per second (average).
Yes there might be difference in before and after collection rate because of doing some additional operation in after collection.
But reading from a unordered_map instead of rocksdb's LRU cache seems improves the after collection rate by +100.
So the uncompressed data size is only 1561798+901728 =~ 2.5MB. Block cache should hold all the blocks no matter its capacity is 8MB or 100MB.
Even the uncompressed data size is ~ 2.5 mb. Is there any operation or blocks use additional in-memory, because while using rocksdb I've noted that memory increases by ~ 15-20 mb.
Why turning on the cache_index_and_filter_blocks slows down the performance ?
from rocksdb.
So even the expired entries from sst files are removed during compaction. The cache still holds the value until it evicts by the LRU
Right, blocks from deleted files remain in block cache until LRU evicts them
But reading from a unordered_map instead of rocksdb's LRU cache seems improves the after collection rate by +100.
SST file lookups are not particularly fast. You could try row cache to bypass SST file lookups. It'll use more memory though.
Even the uncompressed data size is ~ 2.5 mb. Is there any operation or blocks use additional in-memory, because while using rocksdb I've noted that memory increases by ~ 15-20 mb.
Related to your earlier question, the 2.5MB could be amplified if the data was compacted and the block cache still contains blocks from the deleted files. There's other uses, like memtable. I would hope that memtable does not consume much memory when it is empty, but can't promise, especially considering the version is 4.11. A profile could tell us more definitively.
Why turning on the cache_index_and_filter_blocks slows down the performance ?
Yes it's counterintuitive. It's because the index and filter blocks are held in memory either way. In case cache_index_and_filter_blocks=false
they are held in table reader memory. When cache_index_and_filter_blocks=true
they are held in block cache memory. Accessing them on table reader is cheaper because it doesn't require locking to manage an LRU list.
from rocksdb.
SST file lookups are not particularly fast. You could try row cache to bypass SST file lookups. It'll use more memory though.
Yes, but read happens from block cache right ? why there is a slowness in that .
Related to your earlier question, the 2.5MB could be amplified if the data was compacted and the block cache still contains blocks from the deleted files. There's other uses, like memtable. I would hope that memtable does not consume much memory when it is empty, but can't promise, especially considering the version is 4.11. A profile could tell us more definitively.
Does this means that the raw key and raw value size of sst files differs from the block cache key value size ? if it is, why it is happening ? Does the index happens in-memory ? In my case i do compaction for every 30 mins the above said memory increment is noted less than 30 mins.
from rocksdb.
Yes, but read happens from block cache right ? why there is a slowness in that .
The layout of a sorted string table isn't the best for random lookups. Even if the sorted string table is entirely in memory, which it is in your case, an exact-match lookup usually won't be as fast as an std::unordered_map
lookup. You can run a CPU profile on the lookup process to compare different approaches.
Another feature you could consider to try closing the perf gap with std::unordered_map
is data block hash index:
rocksdb/include/rocksdb/table.h
Line 242 in a036525
Does this means that the raw key and raw value size of sst files differs from the block cache key value size ? if it is, why it is happening ? Does the index happens in-memory ? In my case i do compaction for every 30 mins the above said memory increment is noted less than 30 mins.
Are you able to provide a heap profile? It sounds like we ruled out my last guess (data blocks surviving in block cache after their files are deleted). A profile might help us get to an answer faster than guess and check
from rocksdb.
Related Issues (20)
- Cache dumper could exit early
- rocksdb 9.0.0 fails to build on GCC 13.2.1 with `-march=x86-64-v3`
- Cache Dump all keys without filter
- checkpoint directory is empty when db is empty HOT 2
- [Java] In read-only mode can't get data from blob only if there is just one checkpoint with one entry HOT 13
- Solution to the periodic slowdown of GetUpdatesSnce
- Heading typo on wiki docs: PlainTable Format HOT 1
- does rocksdb provide any monitoring metrics? HOT 1
- Java release for 9.1 HOT 2
- segFault while write large data on multiple thread HOT 3
- Feature request: rate limit compaction triggered by periodic compaction seconds/ ttl only HOT 5
- The value of 'micros/op' is not equal to 1,000,000 divided by the value of 'ops/sec' HOT 4
- Question about CompactRange behavior with option atomic_flush=true
- Segfault During compaction using FIFO Compaction style for a single CF
- Safer shutdown behaviour by deafult HOT 2
- StdLogger truncating last letter in some cases HOT 1
- High Memory Usage/ LRU cache size is not being respected HOT 3
- rocksdb abnormal exit
- Feature request: log to stderr logger + LOG file
- Serious performance loss in benchmark.sh/db_bench under multithreading (reporter_agent / rocksdb::Stats::FinishedOps)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocksdb.