Skip to content

Commit 36577ea

Browse files
committed
fix: Use gunicorn preload option, modify readiness checks
1 parent 2657ee6 commit 36577ea

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
changed:
4+
- Attempted to fix deployments using gunicorn preload option and modified readiness check timeouts

gcp/policyengine_api/app.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ automatic_scaling:
1212
target_utilization: 0.8
1313
liveness_check:
1414
path: "/liveness-check"
15-
check_interval_sec: 30
16-
timeout_sec: 30
15+
check_interval_sec: 30 # Check every 30 seconds
16+
timeout_sec: 30 # Allow 30 seconds for a response
1717
failure_threshold: 5
1818
success_threshold: 2
19+
initial_delay_sec: 60 # Don't check for first 60 seconds to allow full boot
1920
runtime_config:
2021
operating_system: "ubuntu22"
2122
runtime_version: "22"
2223
readiness_check:
2324
path: "/readiness-check"
24-
app_start_timeout_sec: 600
25+
check_interval_sec: 30
26+
timeout_sec: 30
27+
failure_threshold: 5
28+
success_threshold: 2
29+
initial_delay_sec: 60
30+
app_start_timeout_sec: 900

gcp/policyengine_api/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WORKER_COUNT="${WORKER_COUNT:-3}"
55
REDIS_PORT="${REDIS_PORT:-6379}"
66

77
# Start the API
8-
gunicorn -b :"$PORT" policyengine_api.api --timeout 300 --workers 5 &
8+
gunicorn -b :"$PORT" policyengine_api.api --timeout 300 --workers 5 --preload &
99

1010
# Start Redis with configuration for multiple clients
1111
redis-server --protected-mode no \

0 commit comments

Comments
 (0)