From 491d8c4629822401a6b7347eb6c2ba4e50a2e8f0 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 15 Nov 2021 11:42:32 +0000 Subject: [PATCH] use environment file for tasks and encoding queue --- etc/systemd/system/pandora-encoding.service | 6 ++++-- etc/systemd/system/pandora-tasks.service | 6 ++++-- pandora/encoding.conf | 3 +++ pandora/tasks.conf | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 pandora/encoding.conf create mode 100644 pandora/tasks.conf diff --git a/etc/systemd/system/pandora-encoding.service b/etc/systemd/system/pandora-encoding.service index b2a48626..fa791feb 100644 --- a/etc/systemd/system/pandora-encoding.service +++ b/etc/systemd/system/pandora-encoding.service @@ -7,14 +7,16 @@ Type=simple Restart=always User=pandora Group=pandora +EnvironmentFile=/srv/pandora/pandora/encoding.conf PIDFile=/run/pandora/encoding.pid WorkingDirectory=/srv/pandora/pandora ExecStart=/srv/pandora/bin/celery \ -A app worker \ -Q encoding -n pandora-encoding \ --pidfile /run/pandora/encoding.pid \ - --maxtasksperchild 500 \ - -l INFO + -c $CONCURRENCY \ + --maxtasksperchild $MAX_TASKS_PER_CHILD \ + -l $LOGLEVEL ExecReload=/bin/kill -TERM $MAINPID [Install] diff --git a/etc/systemd/system/pandora-tasks.service b/etc/systemd/system/pandora-tasks.service index 19cf04af..d8fe1b58 100644 --- a/etc/systemd/system/pandora-tasks.service +++ b/etc/systemd/system/pandora-tasks.service @@ -7,14 +7,16 @@ Type=simple Restart=always User=pandora Group=pandora +EnvironmentFile=/srv/pandora/pandora/tasks.conf PIDFile=/run/pandora/tasks.pid WorkingDirectory=/srv/pandora/pandora ExecStart=/srv/pandora/bin/celery \ -A app worker \ -Q default,celery -n pandora-default \ --pidfile /run/pandora/tasks.pid \ - --maxtasksperchild 1000 \ - -l INFO + -c $CONCURRENCY \ + --maxtasksperchild $MAX_TASKS_PER_CHILD \ + -l $LOGLEVEL ExecReload=/bin/kill -TERM $MAINPID [Install] diff --git a/pandora/encoding.conf b/pandora/encoding.conf new file mode 100644 index 00000000..af15426c --- /dev/null +++ b/pandora/encoding.conf @@ -0,0 +1,3 @@ +LOGLEVEL=info +MAX_TASKS_PER_CHILD=500 +CONCURRENCY=1 diff --git a/pandora/tasks.conf b/pandora/tasks.conf new file mode 100644 index 00000000..245a3562 --- /dev/null +++ b/pandora/tasks.conf @@ -0,0 +1,3 @@ +LOGLEVEL=info +MAX_TASKS_PER_CHILD=1000 +CONCURRENCY=2