Skip to content
Snippets Groups Projects
Commit de885dbf authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

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
parent 2ba51ab2
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment