<@U088WCP3B4P> We are running edr report and using...
# ask-elementary-ai
p
@kapa.ai We are running edr report and using the argument --days-back of 5 but the command runs for about 40 minutes before maxing out the memory on my dagster instance. I am using elementary 0.25.1. Is this expected behaviour? Is there anything else I can do to speed up the runs?
k
While running out of memory (OOM) or experiencing long run times can happen in environments with large volumes of test results or models, running for 40 minutes and crashing is not ideal. This typically occurs because
edr report
loads large volumes of historical test metrics, executions, and sample data into memory [Linen Conversation; Linen Conversation]. To speed up report generation and significantly reduce memory consumption, you can apply several CLI parameters and configurations: 1. Lower --executions-limit By default, Elementary queries up to 720 historical test invocations per test. Lowering this value reduces memory overhead and query time substantially [Linen Conversation; Linen Conversation]:
Copy code
edr report --days-back 5 --executions-limit 100
(You can even test with smaller values like
10
or
50
to find a balance between history and speed).
2. Disable Passed Test Metrics By default, metrics for passed tests (such as anomaly detection metrics) are included. You can exclude them to save memory and processing time [Linen Conversation; Linen Conversation]:
Copy code
edr report --days-back 5 --disable-passed-test-metrics true
3. Disable Failed Test Samples Excluding row-level samples collected for failed tests further reduces data transfer and memory footprint [Linen Conversation; Linen Conversation]:
Copy code
edr report --days-back 5 --disable-samples true
4. Combine Flags for Maximum Optimization Combining these options usually provides the best performance and lowest memory footprint [Linen Conversation; Linen Conversation]:
Copy code
edr report \
  --days-back 5 \
  --executions-limit 50 \
  --disable-passed-test-metrics true \
  --disable-samples true
(If memory issues persist, consider temporarily lowering
--days-back
to
1
or
3
[Linen Conversation; Linen Conversation]).
Additional Recommendations • Increase Instance/Container Memory: Generating static reports on large projects often requires more memory (many users allocate several gigabytes depending on their data size) [Linen Conversation; Linen Conversation]. • Full-Refresh Elementary Tables (Last Resort): If the raw Elementary tables in your warehouse have accumulated an excessive amount of historical data, performing a full-refresh can clean up history and improve query speeds [Linen Conversation; Linen Conversation]:dbt run --select elementary --full-refresh 👍 0 button 👎 0 button ℹ️ Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help., with interactive elements
p
@kapa.ai what does --disable-passed-test-metrics do?
k
The
--disable-passed-test-metrics
flag disables collecting and returning detailed metrics (such as anomaly detection graphs and metric trends) for tests that passed, rather than removing the passed tests themselves [Slack Thread; Linen Conversation]. Key Details: • What it affects: Passed tests will still appear in the report, but their historical metric graphs and detailed metric data will be excluded [Slack Thread]. • Primary benefit: It significantly reduces the amount of data queried and held in memory, which lowers memory usage, speeds up report generation, and reduces the final HTML report file size [Linen Conversation; Linen Conversation]. Example Usage:
Copy code
edr report --disable-passed-test-metrics true
[Linen Conversation] 👍 0 button 👎 0 button ℹ️ Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help., with interactive elements
p
@kapa.ai I continue to get out of memory issues. I've already added "--days-back", "7" and "--executions-limit", "100" - what else can I do here?
k
Thinking completed To further reduce memory consumption and resolve out-of-memory (OOM) issues, here are the recommended options based on the available sources: 1. Further Reduce --days-back and --executions-limit • Reduce `--days-back`: The default is 7 days, so
--days-back 7
does not reduce the data window. Lowering this to
3
or
1
is the single most effective way to cut down memory usage [Linen Conversation; Linen Conversation]. • Lower
--executions-limit
further:
You can reduce this further down to
50
,
30
, or even
10
[Linen Conversation; Linen Conversation]. 2. Add Flags to Strip Heavy Metric and Sample Data •
--disable-passed-test-metrics true
: Excludes detailed metric graphs for passing tests [Linen Conversation]. •
--disable-samples true
: Removes row-level failure samples from the report [Linen Conversation]. Example combining these flags:
Copy code
edr report \
  --days-back 1 \
  --executions-limit 10 \
  --disable-passed-test-metrics true \
  --disable-samples true
[Linen Conversation; Linen Conversation] 3. Disable Test Samples Globally in dbt If failing test row samples in your warehouse tables are very large, you can disable sample collection entirely across your dbt project in `dbt_project.yml`:
Copy code
vars:
  test_sample_row_count: 0
[Test Result Samples] 4. Clean Up / Full-Refresh Elementary Tables If your Elementary tables (such as
elementary_test_results
) have accumulated large volumes of historical data, running a full refresh clears old history and improves performance:
Copy code
dbt run --select elementary --full-refresh
[Linen Conversation; Linen Conversation] 5. Increase Container / Worker Memory Because Elementary generates a self-contained static HTML report containing embedded JSON data, projects with many models and tests simply require more RAM. Many users find it necessary to scale memory up to 4GB–8GB (or higher) to handle larger workloads [Linen Conversation; Linen Conversation]. 👍 0 button 👎 0 button ℹ️ Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.