Earlier quoted context omitted.
The main reason I decided to use a beefier machine is that it gives me flexibility when benchmarking, without the need to set up different environments. The CSV data, for example, is >80 GB. We can also “scale down the machine” for experiments where we want to stress-test lower-memory scenarios or use fewer threads by configuring DuckDB’s settings (e.g., SET memory_limit = '10GB'; or SET threads TO 1;). (Disclaimer:…
Note that SET memory_limit is a soft limit and can be completely ignored for some tasks, so this wouldn’t be the same as having a limit on physical memory.
Asynchronous I/O in DuckDB: Work, Thread, Work
31–36 of 36 posts
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#32DuckDB is trending towards becoming a query engine, specifically the fastest analytical query engine. This is very good.
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#33Do 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…
Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#34Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#35Re: Asynchronous I/O in DuckDB: Work, Thread, Work
#36Does 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…
As long as you're scheduled by the kernel and not something like Kubernetes with a CPU limit, you can generally oversubscribe I/O threads without much of a problem. They're mostly parked waiting for syscalls anyway. Heck, even if they're mostly doing CPU work, the scheduler generally deals with it pretty gracefully.