Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RocksDB#getLongProperty("rocksdb.estimate-num-keys") block long time (Java Lib) #12930

Open
horizonzy opened this issue Aug 12, 2024 · 1 comment

Comments

@horizonzy
Copy link

In our case, we count the Rocksdb keys number and put it into metrics. But we found that the method db.getLongProperty("rocksdb.estimate-num-keys") block for a long time.

I want to know why this happens and what the workaround is for it. Thanks.

Rocksdb java lib version: org.rocksdb-rocksdbjni-7.9.2.jar

@rhubner
Copy link
Contributor

rhubner commented Aug 20, 2024

Hello @horizonzy

thank you for reaching our community. Can you please describe your problem more. I wrote JMH test and I didn't notice any slowdown. Maybe if you can provide some sample code, or describe little bit more your setup(How many keys, average size of keys, values, ...). What times you see in your system ?

Radek

simple test results :

Benchmark                              (keysInDB)    Mode     Cnt    Score   Error   Units
PropertyReadBenchmark.get                       0   thrpt       5    2.340 ± 0.020  ops/us
PropertyReadBenchmark.get                10000000   thrpt       5    2.301 ± 0.054  ops/us
PropertyReadBenchmark.get                       0    avgt       5    0.430 ± 0.008   us/op
PropertyReadBenchmark.get                10000000    avgt       5    0.572 ± 0.529   us/op
PropertyReadBenchmark.get                       0  sample  896789    0.458 ± 0.001   us/op
PropertyReadBenchmark.get:get·p0.00             0  sample            0.400           us/op
PropertyReadBenchmark.get:get·p0.50             0  sample            0.400           us/op
PropertyReadBenchmark.get:get·p0.90             0  sample            0.500           us/op
PropertyReadBenchmark.get:get·p0.95             0  sample            0.500           us/op
PropertyReadBenchmark.get:get·p0.99             0  sample            0.700           us/op
PropertyReadBenchmark.get:get·p0.999            0  sample            1.200           us/op
PropertyReadBenchmark.get:get·p0.9999           0  sample           16.713           us/op
PropertyReadBenchmark.get:get·p1.00             0  sample           88.832           us/op
PropertyReadBenchmark.get                10000000  sample  874835    0.470 ± 0.001   us/op
PropertyReadBenchmark.get:get·p0.00      10000000  sample            0.400           us/op
PropertyReadBenchmark.get:get·p0.50      10000000  sample            0.500           us/op
PropertyReadBenchmark.get:get·p0.90      10000000  sample            0.500           us/op
PropertyReadBenchmark.get:get·p0.95      10000000  sample            0.500           us/op
PropertyReadBenchmark.get:get·p0.99      10000000  sample            0.900           us/op
PropertyReadBenchmark.get:get·p0.999     10000000  sample            1.300           us/op
PropertyReadBenchmark.get:get·p0.9999    10000000  sample           12.896           us/op
PropertyReadBenchmark.get:get·p1.00      10000000  sample          107.776           us/op
PropertyReadBenchmark.get                       0      ss       5    4.320 ± 0.502   us/op
PropertyReadBenchmark.get                10000000      ss       5   13.760 ± 2.414   us/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants