From 556f46627059dc9e3785bbfb76f46e995a41f582 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 3 Jun 2024 16:29:46 +0200 Subject: [PATCH] chore: reduce CPU shares of GTFS import to 512 https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler --- pipeline/assets/gtfs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pipeline/assets/gtfs.py b/pipeline/assets/gtfs.py index d06162b..f36aba2 100644 --- a/pipeline/assets/gtfs.py +++ b/pipeline/assets/gtfs.py @@ -38,6 +38,10 @@ os.path.join(os.getenv('IPL_GTFS_IMPORTER_HOST_GTFS_OUTPUT_DIR'), ':/var/gtfs/:rw'), os.path.join(os.getenv('IPL_GTFS_IMPORTER_HOST_CUSTOM_SCRIPTS_DIR'), ':/etc/gtfs'), ], + # > CPU shares (relative weight). + # from https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler: + # > --cpu-shares – Set this flag to a value greater or less than the default of 1024 to increase or reduce the container's weight, and give it access to a greater or lesser proportion of the host machine's CPU cycles. This is only enforced when CPU cycles are constrained. When plenty of CPU cycles are available, all containers use as much CPU as they need. In that way, this is a soft limit. --cpu-shares doesn't prevent containers from being scheduled in Swarm mode. It prioritizes container CPU resources for the available CPU cycles. It doesn't guarantee or reserve any specific CPU access. + 'cpu_shares': 512, }, }, name='import_op',