You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/09/15 03:45:24 UTC
[GitHub] [incubator-kvrocks] Phoeniwx opened a new issue, #876: Delete expired big keys during first query
Phoeniwx opened a new issue, #876:
URL: https://github.com/apache/incubator-kvrocks/issues/876
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
### Motivation
We encountered a slow log problem when accessing a rather small key. This key is in cold data and kvrocks took 0.82s to get it every time.
```
10.x.x.x:6379> strlen "scene:xxx:-1"
(integer) 0
(0.82s)
```
Here is the perflog. We can see it took most time in reading block phase, which processed 73752672 bytes. Every time we accessed the key, same thing happened, until a compaction.
```
10.x.x.x:6379> perflog get *
1) 1) (integer) 1
2) (integer) 1662454072
3) "strlen"
4) (integer) 633163
5) "user_key_comparison_count = 76, block_read_count = 1, block_read_byte = 73752672, block_read_time = 59590859, block_checksum_time = 9643232, block_decompress_time = 350221281, get_read_bytes = 247610038, get_snapshot_time = 883, get_from_memtable_time = 4306, get_from_memtable_count = 1, get_post_process_time = 1681, get_from_output_files_time = 426225825, new_table_block_iter_nanos = 426163267, block_seek_nanos = 36515, bloom_sst_hit_count = 1, bloom_sst_miss_count = 2, "
6) "thread_pool_id = 4, bytes_read = 73752672, read_nanos = 59588262, "
```
After discussing with developers, we found this is caused by a expired big key. In every querying, kvrocks accessed the big key to retrive its ttl, which took a lot of IO time.
### Solution
Maybe we can solve this problem by deleting these kind of expired big keys during the first querying, which should avoid accessing bigkeys every time. Or there may be a better solution. Hope you guys can solve this, thanks.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] git-hulk commented on issue #876: Delete expired big keys during first query
Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #876:
URL: https://github.com/apache/incubator-kvrocks/issues/876#issuecomment-1247559562
Thanks for your feedback. Maybe we need a smarter compaction strategy which can compact range in-flight when finding there're too many deleted or expired tombstones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kvrocks] shangxiaoxiong commented on issue #876: Delete expired big keys during first query
Posted by GitBox <gi...@apache.org>.
shangxiaoxiong commented on issue #876:
URL: https://github.com/apache/incubator-kvrocks/issues/876#issuecomment-1247609697
If kvrocks can automatically append a delete opreation when clients read an expired big key, it may be improved. l will do this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org