From 52de86ef95c5cff11bd00c5f39a8b2cbc4cef3ba Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Thu, 21 Nov 2024 13:58:44 -0500 Subject: [PATCH] Squash 2041 - Try sending a variable for CELERY_CONCURRENCY for health check --- cd/application-deployment/dev/vaec-celery-task-definition.json | 3 +++ scripts/check_celery.sh | 3 ++- scripts/run_celery.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cd/application-deployment/dev/vaec-celery-task-definition.json b/cd/application-deployment/dev/vaec-celery-task-definition.json index 620413baa4..2e0be54763 100644 --- a/cd/application-deployment/dev/vaec-celery-task-definition.json +++ b/cd/application-deployment/dev/vaec-celery-task-definition.json @@ -23,6 +23,9 @@ } ], "environment": [ + { "name": "CELERY_CONCURRENCY", + "value": 16 + }, { "name": "DD_SERVICE", "value": "celery" diff --git a/scripts/check_celery.sh b/scripts/check_celery.sh index b7eb980195..8aa25d014c 100755 --- a/scripts/check_celery.sh +++ b/scripts/check_celery.sh @@ -5,8 +5,9 @@ set -e grep_string="run_celery.notify_celery\ worker" celery_pid_count=$(ps aux | grep -E run_celery.notify_celery\ worker | grep -v grep | wc -l) +TOTAL_CELERY_PIDS=$((CELERY_CONCURRENCY + 1)) -if [ $celery_pid_count -ne 17 ]; then +if [ $celery_pid_count -ne TOTAL_CELERY_PIDS ]; then echo -e "There are an incorrect number of Celery PIDs: $celery_pid_count" exit 1 else diff --git a/scripts/run_celery.sh b/scripts/run_celery.sh index 5ef1dd9411..7d9e5b48c2 100755 --- a/scripts/run_celery.sh +++ b/scripts/run_celery.sh @@ -3,4 +3,4 @@ set -e # Necessary to run as exec so the PID is transferred to Celery for the `SIGTERM` sent from ECS -exec ddtrace-run celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=16 +exec ddtrace-run celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=CELERY_CONCURRENCY