You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "PauloCarneiro99 (via GitHub)" <gi...@apache.org> on 2025/11/07 12:57:07 UTC
Re: [D] What is the log groomer sidecar, what does it do, and why does it use so much memory? [airflow]
GitHub user PauloCarneiro99 added a comment to the discussion: What is the log groomer sidecar, what does it do, and why does it use so much memory?
Not sure if this reply 100% of your question but I was taking a look at the helm params reference
<img width="1161" height="765" alt="image" src="https://github.com/user-attachments/assets/48c262fe-e2ff-41db-abc3-453b06da0668" />
Checking this script `/clean-logs` you can see the cleanup logic
```
#!/usr/bin/env bash
set -euo pipefail
readonly DIRECTORY="${AIRFLOW_HOME:-/usr/local/airflow}"
readonly RETENTION="${AIRFLOW__LOG_RETENTION_DAYS:-15}"
trap "exit" INT TERM
readonly EVERY=$((15*60))
echo "Cleaning logs every $EVERY seconds"
while true; do
echo "Trimming airflow logs to ${RETENTION} days."
find "${DIRECTORY}"/logs \
-type d -name 'lost+found' -prune -o \
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f || true
find "${DIRECTORY}"/logs -type d -empty -delete || true
seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
sleep 1
done
```
https://airflow.apache.org/docs/helm-chart/1.8.0/parameters-ref.html
GitHub link: https://github.com/apache/airflow/discussions/39166#discussioncomment-14902376
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org