You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #71 proposed an opt-in --auto-memory flag on the premise that DuckDB
sizes max_memory from host RAM and ignores container cgroup limits, leading to
kernel OOM kills (exit 137). Empirical testing of the bundled DuckDB 1.5.2
shows that premise is obsolete: DuckDB already honors cgroup limits, sizing
max_memory to ~80% of the cgroup memory limit and threads from the CPU quota.
A ~3 GiB query in a 1 GiB container fails with a graceful "Out of Memory"
error and the server survives -- no kernel kill.
Rather than ship a redundant override, this adds observability and a guard:
- src/system_resources.{hpp,cpp}: cgroup v1/v2 memory + CPU detection with
injectable /sys/fs/cgroup roots; unit-tested in system_resources_test.cpp.
- database_manager: log a startup "resource-limits:" line reporting the
detected ceiling and source (cgroup-v2 / cgroup-v1 / meminfo / hardware),
so the limit flApi runs under is visible. No DuckDB setting is changed;
duckdb.max_memory / duckdb.threads still override when set explicitly.
- test/integration/smoke_resource_limits.sh + `make smoke-test-resources`:
Docker regression guard asserting graceful degradation (HTTP 500 OOM,
server survives) and the cgroup-detection startup log. Skips off Linux/Docker.
- docs: DESIGN_DECISIONS §10 records the finding; CONFIG_REFERENCE notes the
cgroup behavior and how to pin explicit values.
0 commit comments