<@U088WCP3B4P>, I have the following command that ...
# ask-elementary-ai
f
@kapa.ai, I have the following command that keeps on failing on my airflow workers:
Copy code
edr report --exclude-elementary-models true --env production --profile-target default --executions-limit 30 --days-back 7 --disable-passed-test-metrics true --profiles-dir /tmp/production
The error I get is:
Copy code
Command failed with exit code -9
Is there any way I can reduce the memory usage of my command any further?
k
A message from kapa.ai
Based on the knowledge sources, the error you're experiencing (
exit code -9
) indicates that your process is being killed due to memory issues. This is a common problem when running Elementary's
edr report
command with limited resources. ## Solutions to Reduce Memory Usage You've already implemented several good practices, but here are additional options to further reduce memory usage: ### 1. Reduce
--days-back
Further While you're currently using
--days-back 7
, you can reduce this to 1-3 days. According to [multiple user reports](https://slack.com/archives/C02CTC89LAX/p1680534551722499), setting
--days-back
to 3 or even 1 significantly reduces memory consumption. ### 2. Lower
--executions-limit
Your current
--executions-limit 30
is already quite low, but you could try reducing it further to 5-10 if needed. Users have reported success with values as low as [5](https://slack.com/archives/C02CTC89LAX/p1674656787251049) or [100-120](https://slack.com/archives/C02CTC89LAX/p1701791821617429). ### 3. Increase Container Memory The most effective solution reported by users is to increase the memory allocation for your Airflow workers. According to the knowledge sources: - Users have successfully resolved this issue by increasing memory from [0.5GB to 2GB](https://slack.com/archives/C02CTC89LAX/p1703686732161589) - Another user increased from [600MB to 1024MB](https://slack.com/archives/C02CTC89LAX/p1678963756105439) - Some users needed [4-8GB](https://github.com/elementary-data/elementary/issues/1495) depending on their data volume ### 4. Regular Schema Cleanup As mentioned in [this GitHub issue](https://github.com/elementary-data/elementary/issues/1495), you can periodically full-refresh the Elementary schema to prevent data accumulation:
Copy code
bash dbt run -t prod --select elementary --vars '{"elementary_full_refresh": "true"}'
## Recommended Command Try this modified command with more aggressive limits:
Copy code
bash edr report --exclude-elementary-models true --env production --profile-target default --executions-limit 10 --days-back 1 --disable-passed-test-metrics true --profiles-dir /tmp/production
If this still fails, the most reliable solution is to increase the memory allocation for your Airflow workers/pods, as this is fundamentally a [resource constraint issue](https://slack.com/archives/C02CTC89LAX/p1729498047922669).