seastar icon indicating copy to clipboard operation
seastar copied to clipboard

smp::submit_to performance problems

Open xemul opened this issue 3 years ago • 8 comments

As shown in 0c2228a4916dc2dc66e9d587343ce436b92b7bef, on a busy target shard the smp::submit_to can take ~50ms to complete. Partially this is because a task that arrives from a smp message queue is put at the tail of the scheduler queue which is full of busyloops. However, in the example from the mentioned commit message the maximum time to traverse the queue should be nr_tasks * task_latency = 100 * 50us = 5ms.

xemul avatar Feb 17 '22 11:02 xemul

/cc @bhalevy

xemul avatar Feb 17 '22 11:02 xemul

Can't it take an arbitrary amount of time? If the task group in question is busy, it will be delayed.

avikivity avatar Feb 17 '22 14:02 avikivity

Well, the test in question uses the single task group -- the default one -- and it is constantly busy. But my point is that since the arrived smp job is queued at the tail of the task group's queue, reactor should get to it once it scans this list at least once, i.e. in 5ms.

xemul avatar Feb 17 '22 14:02 xemul

That's true for non-submit_to tasks as well, no? We have FIFO order usually.

avikivity avatar Feb 17 '22 16:02 avikivity

Yes, but 5ms to process the task list should result in 1s/5ms=200 messages/s, but the result is 20 messages/s

xemul avatar Feb 17 '22 16:02 xemul

@avikivity one more consideration that I discussed with @denesb today is that we don't guarantee aligned shard-to-shard connections for messaging, meaning that even for queries where the coordinator shard is communicating with the same shard on all replicas, there could be submit_to involved (on the remote end if I'm not mistaken). @gleb-cloudius please confirm.

bhalevy avatar Feb 22 '22 15:02 bhalevy

@avikivity one more consideration that I discussed with @denesb today is that we don't guarantee aligned shard-to-shard connections for messaging, meaning that even for queries where the coordinator shard is communicating with the same shard on all replicas, there could be submit_to involved (on the remote end if I'm not mistaken). @gleb-cloudius please confirm.

There could be, but if all nodes have the same number of shard it is unlikely.

gleb-cloudius avatar Feb 22 '22 16:02 gleb-cloudius

What's the relationship to this issue?

avikivity avatar Feb 22 '22 18:02 avikivity