From 70b716d77cf2b37f0d917a81f551d5944062e283 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Sun, 6 Oct 2024 16:01:44 +0100 Subject: [PATCH] Fix #50 resource limit cpu/memory/filehandles/network --- dokku-wrapper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dokku-wrapper.py b/dokku-wrapper.py index 71a6f21..ab25840 100755 --- a/dokku-wrapper.py +++ b/dokku-wrapper.py @@ -73,7 +73,11 @@ subprocess.run(f"dokku resource:limit --cpu 1.5 {APP_NAME}", shell=True) print(f"🧠 Limiting app memory resources for app: {APP_NAME}") -subprocess.run(f"dokku resource:limit --memory 500m {APP_NAME}", shell=True) +subprocess.run(f"dokku resource:limit --memory 500m --cpu 0.25 --network-ingress 50m --network-egress 50m {APP_NAME}", shell=True) + +subprocess.run(f"dokku docker-options:add {APP_NAME} deploy '--ulimit nofile=200'", shell=True) +subprocess.run(f'dokku docker-options:add {APP_NAME} deploy --cpus="0.25"', shell=True) +subprocess.run(f'dokku docker-options:add {APP_NAME} deploy "--memory=200m --memory-swappiness=200m"', shell=True) try: