Open changhiskhan opened 1 year ago
duplicate of https://github.com/lancedb/lance/issues/832?
I think there's something else going on too. We see this odd pattern where requests are being made in waves and seemingly not as quickly as they could be. For example, here I set readahead to 32, and it makes 32 concurrent requests, but waits for the entire initial wave to complete before starting the request.
My current theory is this has to do with misuse of buffered. There is a GH issue describing a footgun here, part of which is familiar: https://github.com/rust-lang/futures-rs/issues/2387
Basically, one of those Buffered
streams needs to be continuously polled to make progress. But if once you get a result you do a bunch of CPU work on it, you aren't going to be polling the stream during that time, causing a delay until the next set of futures are started.
We should double check that (1) we are spawning tasks in the scanner, so they progress independently, and (2) maybe add a buffer that the stream continuously pushes into, so that it's poller isn't doing anything that might cause a delay in starting the next future.
This will result in bad performance on low cpu-count nodes. Ideally configurable but at the very least this should be some multiple of cpu-count?