From c145f30d21326eda502706a525f568b3f37c2612 Mon Sep 17 00:00:00 2001 From: "Nyeki.py" <84998222+Nekidev@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:06:56 -0300 Subject: [PATCH] perf: :zap: Assign specific CPU cores to bot and DB container. --- .env.example | 11 +++++++++++ compose.yml | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c0be9a0 --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +TOKEN= + +IS_DEBUG=false + +SUGGESTIONS_CHANNEL_ID= + +SERVER_INVITE= + +# The CPU cores assigned to each container, e.g. "0,1" for the first two cores. +# CPUSET_BOT= +# CPUSET_DATABASE= diff --git a/compose.yml b/compose.yml index 7d7e8f8..f50fefd 100644 --- a/compose.yml +++ b/compose.yml @@ -3,6 +3,7 @@ name: "payphone" services: bot: build: . + cpuset: ${CPUSET_BOT:-0,1} env_file: - .env environment: @@ -14,6 +15,7 @@ services: database: image: postgres:16.3 + cpuset: ${CPUSET_DATABASE:-2,3} environment: - POSTGRES_DB=payphone - POSTGRES_USER=payphone