I tried DuckDB - liked it a lot - was ready to go further. But found it to be a real hassle to help it understand the right number of threads and the amount of memory to use. This led to lots of crashes. If you look at the projects github issues you will see many OOM out of memory errors. And then there was some indexed bug that crashed seemingly unrelated to memory. Life is too short for crashy database software so…
Use DuckDB-WASM to query TB of data in browser
11–20 of 64 posts
Re: Use DuckDB-WASM to query TB of data in browser
#12Re: Use DuckDB-WASM to query TB of data in browser
#13I tried DuckDB - liked it a lot - was ready to go further. But found it to be a real hassle to help it understand the right number of threads and the amount of memory to use. This led to lots of crashes. If you look at the projects github issues you will see many OOM out of memory errors. And then there was some indexed bug that crashed seemingly unrelated to memory. Life is too short for crashy database software so…
I can recommend earlyoom ( https://github.com/rfjakob/earlyoom ). Instead of freezing or crashing your system this tool kills the memory eating process just in time (in this case duckdb). This allows you repeat with smaller chunks of the dataset, until it fits into your mem.
Re: Use DuckDB-WASM to query TB of data in browser
#14Yesterday there was a somewhat similar DuckDB post, "Frozen DuckLakes for Multi-User, Serverless Data Access". https://news.ycombinator.com/item?id=45702831
Re: Use DuckDB-WASM to query TB of data in browser
#15I tried DuckDB - liked it a lot - was ready to go further. But found it to be a real hassle to help it understand the right number of threads and the amount of memory to use. This led to lots of crashes. If you look at the projects github issues you will see many OOM out of memory errors. And then there was some indexed bug that crashed seemingly unrelated to memory. Life is too short for crashy database software so…
I can recommend earlyoom ( https://github.com/rfjakob/earlyoom ). Instead of freezing or crashing your system this tool kills the memory eating process just in time (in this case duckdb). This allows you repeat with smaller chunks of the dataset, until it fits into your mem.
It uses cgroups to enforce resource limits.
For example, there’s a program I wrote myself which I run on one of my Raspberry Pi. I had a problem where my program would on rare occasions use up too much memory and I wouldn’t even be able to ssh into the Raspberry Pi.
I run it like this:
systemd-run --scope -p MemoryMax=5G --user env FOOBAR=baz ./target/release/myprog
The only difficulty I had was that I struggled to find the right name to use in the MemoryMax=… part because they’ve changed the name of it around between versions so different Linux systems may or may not use the same name for the limit.In order to figure out if I had the right name for it, I tested different names for it with a super small limit that I knew was less than the program needs even in normal conditions. And when I found the right name, the program would as expected be killed right off the bat and so then I could set the limit to 5G (five gigabytes) and be confident that if it exceeds that then it will be killed instead of making my Raspberry Pi impossible to ssh into again.
Re: Use DuckDB-WASM to query TB of data in browser
#16Re: Use DuckDB-WASM to query TB of data in browser
#17My initial thought is why query 1TB of data in a browser, maybe I'm the wrong target audience for this but it seems that it's pushing that everything has to be in a browser rather than using appropriate tools
Re: Use DuckDB-WASM to query TB of data in browser
#18Earlier quoted context omitted.
S3 might be relatively cheap for storing files, but with bandwidth you could easily be paying $230/mo. If you make it public facing & want to try to use their cloud reporting, metrics, etc. to prevent people for running up your bandwidth, your "really cheap" static hosting could easily cost you more than $500/mo.
R2 is S3 compatible with no egress fees. Cloudflare actually has built in iceberg support for R2 buckets. It's quite nice. Combine that with their pipelines it's a simple http request to ingest, then just point duckdb to the iceberg enabled R2 bucket to analyze.
Re: Use DuckDB-WASM to query TB of data in browser
#19Re: Use DuckDB-WASM to query TB of data in browser
#20My initial thought is why query 1TB of data in a browser, maybe I'm the wrong target audience for this but it seems that it's pushing that everything has to be in a browser rather than using appropriate tools
(Does not seem like a realistic scenario to me for many uses, for RAM among other resource reasons.)