1 Star 2 Fork 12

平凯星辰(北京)科技有限公司 / tikv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
PERFORMANCE_CRITICAL_PATH.md 1.09 KB
一键复制 编辑 原始数据 按行查看 历史

Performance Critical Path of user requests

There're many files whose functions are in the critical path of read or write requests. They're so important to the overall performance that any regression will directly impact user experience. We add a comment #[PerformanceCriticalPath] to highlight these critical files. Please note that this is the best-effort work and some files in critical path may not be marked. But if a file is marked, please pay special attention when you change its code.

Here're some typical mistakes that should be avoided in the #[PerformanceCriticalPath] files:

  • Unnecessary synchronous I/O. Here 'unnecessary' means it's not a MUST for serving the current user request. For example, on_gc_snap() in peers.rs should spin off its I/O related work to background thread.
  • Verbose logging with info or above log level.
  • Global lock.
  • Long tasks that do not have to be synchronous (Could be done in background thread instead).

Below is the performance map that would help you to understand how read/write requests are executed inside TiKV:

performance map

1
https://gitee.com/pingcap/tikv.git
git@gitee.com:pingcap/tikv.git
pingcap
tikv
tikv
master

搜索帮助