← Back to Pull requests

presto: size worker memory from MemTotal, add worker nofile ulimits, cap drivers per task at 255 #425

Open
unknown opened this pull request with 393 lines diff across 4 files
View on GitHub
unknown unknown commented on Sep 17, 2026 02:34 UTC
Author

Host-size problems found while running the harness on larger machines (2.3 TB RAM, 256 cores) with the benchmark automation in knataraj's benchmarks repo. All fixes are general, not machine-specific.

1. generate_presto_config.sh: size from MemTotal, not lsmem

RAM_GB came from lsmem's online memory, which includes the memory the kernel reserves for itself. pbench turns that into system-memory-gb (~98.5%), and Velox's MmapAllocator maps that whole amount in one anonymous mmap. Under the default heuristic overcommit (vm.overcommit_memory=0) the kernel refuses a single mapping larger than MemTotal + SwapTotal, so on a host with no swap and a kernel reservation above the 1.5% headroom the worker aborts at startup:

Could not allocate working memory mmap failed with Cannot allocate memory for sizeClass 1

Observed on a 4U 8x RTX PRO 6000 box: lsmem 2306 GiB, MemTotal 2267.2 GiB, requested 2271 GiB. The same gap exists on every host measured (128 vs 125 GiB, 495 vs 482 GiB); smaller hosts survive only when swap or rounding happens to cover it.

Change: RAM_GB from /proc/meminfo MemTotal; PRESTO_MEMORY_GB and PRESTO_NPROC override the detected values (useful for benchmark drivers and for reproducing a smaller host). The generation banner says when an override is in effect.

2. docker-compose.native-gpu.yml.jinja: nofile ulimit for the worker

The worker's ulimits set memlock and stack but not nofile; the nofile: 500000 that exists sits under the sccache build block and never reaches the runtime container, which therefore runs with Docker's default 1024 descriptors. On the 256-core host the worker dies at startup:

Failed to create eventfd for AtomicNotificationQueue: Too many open files

Change: nofile: {soft: 500000, hard: 500000}, the value the sccache build blocks already use.

3. generate_presto_config.sh: cap task.max-drivers-per-task at 255

vcpu_per_worker becomes task.max-drivers-per-task, and a Velox hash join build merges one hash table per driver and supports at most 255 of them. On the 256-core host every hash join failed, base TPC-H Q3 included:

1 + otherTables_.size() <= std::numeric_limits<uint8_t>::max() (256 vs. 255)

Change: VCPU_PER_WORKER is capped at 255 (GPU workers default to 2 and are unaffected).

4. docker-compose.native-cpu.yml: nofile ulimit for the CPU worker

Same problem as (2) for the CPU worker, which also ran with Docker's default 1024 descriptors and died at startup on the 256-core host. Change: the same nofile: {soft: 500000, hard: 500000}.

(3) and (4) were split out of #431 (TPC-Havoc), which needed them to run on that host.

Testing

  • Config generation on a 2306 GiB / 256-core host now yields system-memory-gb=2233 (< MemTotal) and the worker registers.

  • With (3) and (4) on the 256-core host, the native CPU worker starts (it holds ~2300 descriptors when idle), gets task.max-drivers-per-task=255, and TPC-H Q3 and Q18 plus their TPC-Havoc variants pass at SF10.

  • Unchanged behaviour on a 128 GiB workstation apart from system-memory-gb 120 -> 118.
  • Diff: 393 lines (+294 / -99) across 4 files Reviewer: patdevinwilson Review duration: 107743m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.50) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 393 lines diff across 4 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #425"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.1% (MEDIUM) · Higher = larger blast radius
    50.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.6% · Safe to merge
    29.6%