Asynchronous I/O in DuckDB: Work, Thread, Work
11–20 of 36 posts
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#12Using 512gb of ram for a 22gb remote file does feel a bit weird for a benchmark but maybe they couldn’t get a large number of cores without lots of memory?
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#13Does having the worker pool hold as many threads as cores work well alongside the async pool? It is basically oversubscribed by design. I built a system once which had (this is Rust) a Rayon worker thread pool of 4 threads and a Tokio async pool of 2 (multithreaded runtime). On a system of 6 vCPU. This ended up working fine. Tokio was not starved so handled network requests at low latency. One difference is DuckDB is…
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#14Using 512gb of ram for a 22gb remote file does feel a bit weird for a benchmark but maybe they couldn’t get a large number of cores without lots of memory?
(Disclaimer: I’m the author of the blog post.)
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#15Does having the worker pool hold as many threads as cores work well alongside the async pool? It is basically oversubscribed by design. I built a system once which had (this is Rust) a Rayon worker thread pool of 4 threads and a Tokio async pool of 2 (multithreaded runtime). On a system of 6 vCPU. This ended up working fine. Tokio was not starved so handled network requests at low latency. One difference is DuckDB is…
There is still something to gain from tuning it further (as you can see in the async I/O tuned benchmark), but having that network saturation by default is still a work in progress.
(Disclaimer: I'm the author of the blogpost)
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#16Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#17[flagged]
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#18Do the CSV files allow quoted newlines? If yes, what's the trick to avoid checking the whole file too find out whether a newline is quoted or a record separator when reading it from the middle in an async thread?
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#19Do the CSV files allow quoted newlines? If yes, what's the trick to avoid checking the whole file too find out whether a newline is quoted or a record separator when reading it from the middle in an async thread?
I've never gotten around to writing a blog post about it, but I go quite in-depth on the technique in this presentation: https://www.youtube.com/watch?v=YrqSp8m7fmk
(Disclaimer: I'm the author of the blog post and also the developer who implemented the entire CSV parser in DuckDB.)
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#20Do the CSV files allow quoted newlines? If yes, what's the trick to avoid checking the whole file too find out whether a newline is quoted or a record separator when reading it from the middle in an async thread?
DuckDB uses a speculative parallel CSV parsing technique. The basic idea is that the parser speculates about the state the CSV parser is in at a random byte (e.g., whether it is inside a quoted field) and tries to figure out where the next row starts based on that.There are validation steps during finalization as well, to ensure the parser did not got anything wrong in its speculation. I've never gotten around to wri…