forked from Zipstack/unstract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.env
More file actions
113 lines (95 loc) · 5.41 KB
/
sample.env
File metadata and controls
113 lines (95 loc) · 5.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Path where public and private tools are registered
# with a YAML and JSONs
TOOL_REGISTRY_CONFIG_SRC_PATH="${PWD}/../unstract/tool-registry/tool_registry_config"
# Celery Autoscaling Configuration
# Specify the maximum and minimum number of concurrent workers for each Celery worker.
# Format: <max_workers>,<min_workers>
# Hint: The max value (max_workers) is related to your CPU resources and the level of concurrency you need.
# Always monitor system performance and adjust the max value as needed.
WORKER_LOGGING_AUTOSCALE=4,1
WORKER_AUTOSCALE=4,1
WORKER_FILE_PROCESSING_AUTOSCALE=4,1
WORKER_FILE_PROCESSING_CALLBACK_AUTOSCALE=4,1
# New unified worker autoscaling (matches hierarchical configuration below)
WORKER_API_DEPLOYMENT_AUTOSCALE=4,1 # API deployment worker autoscale
WORKER_CALLBACK_AUTOSCALE=4,1 # Callback worker autoscale
WORKER_GENERAL_AUTOSCALE=6,2 # General worker autoscale (enhanced)
WORKER_FILE_PROCESSING_NEW_AUTOSCALE=8,2 # File processing unified worker autoscale
WORKER_NOTIFICATION_AUTOSCALE=4,1 # Notification worker autoscale
WORKER_LOG_CONSUMER_AUTOSCALE=2,1 # Log consumer worker autoscale
WORKER_SCHEDULER_AUTOSCALE=2,1 # Scheduler worker autoscale
# Worker-specific configurations
API_DEPLOYMENT_WORKER_NAME=api-deployment-worker
API_DEPLOYMENT_HEALTH_PORT=8080
API_DEPLOYMENT_MAX_CONCURRENT_TASKS=5
CALLBACK_WORKER_NAME=callback-worker
CALLBACK_HEALTH_PORT=8083
CALLBACK_MAX_CONCURRENT_TASKS=3
FILE_PROCESSING_WORKER_NAME=file-processing-worker
FILE_PROCESSING_HEALTH_PORT=8082
FILE_PROCESSING_MAX_CONCURRENT_TASKS=4
GENERAL_WORKER_NAME=general-worker
GENERAL_HEALTH_PORT=8081
GENERAL_MAX_CONCURRENT_TASKS=10
# =============================================================================
# HIERARCHICAL CELERY CONFIGURATION SYSTEM
# =============================================================================
#
# This system uses a 3-tier hierarchy for all Celery settings (most specific wins):
# 1. {WORKER_TYPE}_{SETTING_NAME} - Worker-specific override (highest priority)
# 2. CELERY_{SETTING_NAME} - Global override (medium priority)
# 3. Code default - Celery standard default (lowest priority)
#
# Examples:
# - CALLBACK_TASK_TIME_LIMIT=3600 (callback worker only)
# - CELERY_TASK_TIME_LIMIT=300 (all workers)
# - Code provides default if neither is set
#
# Worker types: API_DEPLOYMENT, GENERAL, FILE_PROCESSING, CALLBACK,
# NOTIFICATION, LOG_CONSUMER, SCHEDULER
# =============================================================================
# Global Celery Configuration (applies to all workers unless overridden)
CELERY_RESULT_CHORD_RETRY_INTERVAL=3 # Global chord unlock retry interval
CELERY_TASK_TIME_LIMIT=7200 # Global task timeout (2 hours)
CELERY_TASK_SOFT_TIME_LIMIT=6300 # Global soft timeout (1h 45m)
CELERY_PREFETCH_MULTIPLIER=1 # Global prefetch multiplier
CELERY_MAX_TASKS_PER_CHILD=1000 # Global max tasks per child process
CELERY_TASK_ACKS_LATE=true # Global acks late setting
CELERY_TASK_DEFAULT_RETRY_DELAY=60 # Global retry delay (1 minute)
CELERY_TASK_MAX_RETRIES=3 # Global max retries
# Worker-Specific Configuration Examples
# Callback Worker - Chord settings and extended timeouts
CALLBACK_RESULT_CHORD_RETRY_INTERVAL=3 # Callback-specific chord retry interval
CALLBACK_TASK_TIME_LIMIT=7200 # Callback tasks need more time (2 hours)
CALLBACK_TASK_SOFT_TIME_LIMIT=6300 # Callback soft timeout (1h 45m)
# File Processing Worker - Thread pool and optimized settings
FILE_PROCESSING_POOL_TYPE=threads # Use threads instead of prefork
FILE_PROCESSING_CONCURRENCY=4 # Fixed concurrency for file processing
FILE_PROCESSING_TASK_TIME_LIMIT=10800 # File processing timeout (3 hours)
# API Deployment Worker - Autoscaling and timeout configuration
API_DEPLOYMENT_AUTOSCALE=4,1 # Max 4, min 1 workers
API_DEPLOYMENT_TASK_TIME_LIMIT=3600 # API deployment timeout (1 hour)
# General Worker - Enhanced scaling for high-throughput tasks
GENERAL_AUTOSCALE=6,2 # Max 6, min 2 workers
# Docker Worker-Specific Concurrency Settings (for docker-compose.yaml)
WORKER_API_DEPLOYMENT_CONCURRENCY=4 # API deployment fixed concurrency
WORKER_FILE_PROCESSING_CONCURRENCY=8 # File processing fixed concurrency
WORKER_NOTIFICATION_CONCURRENCY=4 # Notification worker concurrency
WORKER_LOG_CONSUMER_CONCURRENCY=2 # Log consumer worker concurrency
WORKER_SCHEDULER_CONCURRENCY=2 # Scheduler worker concurrency
# Notification Worker - Optimized for quick message processing
NOTIFICATION_AUTOSCALE=4,1 # Max 4, min 1 workers
NOTIFICATION_TASK_TIME_LIMIT=120 # Quick timeout for notifications
# Scheduler Worker - Conservative settings for scheduled tasks
SCHEDULER_AUTOSCALE=2,1 # Max 2, min 1 workers
SCHEDULER_TASK_TIME_LIMIT=1800 # Scheduler timeout (30 minutes)
# Log Consumer Worker - Optimized for log processing
LOG_CONSUMER_AUTOSCALE=2,1 # Max 2, min 1 workers
LOG_CONSUMER_TASK_TIME_LIMIT=600 # Log processing timeout (10 minutes)
# Worker Circuit Breaker Settings
CIRCUIT_BREAKER_FAILURE_THRESHOLD=5
CIRCUIT_BREAKER_RECOVERY_TIMEOUT=60
# Worker Health Check Settings
HEALTH_CHECK_INTERVAL=30
HEALTH_CHECK_TIMEOUT=10
ENABLE_METRICS=true