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

optimize write binlog by narrowing down critical secion #2129

Merged

Conversation

wangshao1
Copy link
Collaborator

@wangshao1 wangshao1 commented Nov 20, 2023

pika写binlog的过程拆分为encode command args + 写binlog文件。
之前的实现是先获取log最新的写入位点,然后encode command args + 写binlog文件,全程加锁直到写日志完成,加锁粒度大。
修改之后只在log类成员函数中写日志时加锁,之前拼接binlog日志内容部分并行执行,减小临界区。
使用redis-benchmark测试了下,256B的value-size时性能提升80%(只写binlog,不写storage)。
多rocksdb后,写binlog是瓶颈点,需要继续优化。

@wanghenshui wanghenshui self-requested a review November 20, 2023 12:34
@wanghenshui
Copy link
Collaborator

e2e没过

@wangshao1
Copy link
Collaborator Author

e2e没过

现在应该done了,slave段的没改,死锁了。

@wangshao1 wangshao1 requested a review from AlexStocks November 20, 2023 16:03
AlexStocks
AlexStocks previously approved these changes Nov 21, 2023
@AlexStocks AlexStocks merged commit 6d7ad95 into OpenAtomFoundation:unstable Nov 21, 2023
11 checks passed
AlexStocks added a commit that referenced this pull request Nov 21, 2023
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
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

Successfully merging this pull request may close these issues.

4 participants