vinyl: use cbus instead of coeio for reading run pages
vy_run_iterator_load_page() uses coeio, which is extremely inefficient for our cases: - it locks/unlocks mutexes every time when a task is queued, scheduled, or finished - it invokes ev_async_send(), which writes to eventfd and wakes up TX loop every time on every task completion - it blocks tasks until a free worker is available, which leads to unpredictable delays This patch replaces coeio with cbus in the similar way we do TX <-> WAL interaction. The number of reader threads is set by a new configuration option, vinyl_read_threads, which is set to 1 by default. Note, this patch doesn't bother adjusting cbus queue length, i.e. it is set to INT_MAX as per default. While this is OK when there are a lot of concurrent read requests, this might be suboptimal for low-bandwidth workloads, resulting in higher latencies. We should probably update the queue length dynamically depending on how many clients are out there. Closes #2493
Showing
- src/box/box.cc 3 additions, 0 deletionssrc/box/box.cc
- src/box/lua/load_cfg.lua 2 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/vy_run.c 101 additions, 36 deletionssrc/box/vy_run.c
- src/box/vy_run.h 11 additions, 0 deletionssrc/box/vy_run.h
- test/app-tap/init_script.result 9 additions, 8 deletionstest/app-tap/init_script.result
- test/box-tap/cfg.test.lua 15 additions, 0 deletionstest/box-tap/cfg.test.lua
- test/box/admin.result 2 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 4 additions, 0 deletionstest/box/cfg.result
- test/engine/box.lua 1 addition, 0 deletionstest/engine/box.lua
- test/engine_long/box.lua 1 addition, 0 deletionstest/engine_long/box.lua
- test/long_run-py/box.lua 1 addition, 0 deletionstest/long_run-py/box.lua
- test/vinyl/vinyl.lua 1 addition, 0 deletionstest/vinyl/vinyl.lua
Loading
Please register or sign in to comment