aetherframework-cluster 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example ADDED
@@ -0,0 +1,90 @@
1
+ # ============================================
2
+ # Cluster Module Configuration
3
+ # ============================================
4
+
5
+ # Cluster Configuration
6
+ CLUSTER_ENABLED=true
7
+ CLUSTER_WORKERS=auto
8
+ CLUSTER_PORT=3000
9
+ CLUSTER_GRACEFUL_SHUTDOWN=true
10
+ CLUSTER_RESTART_ON_EXIT=true
11
+ CLUSTER_WORKER_REUSE_PORT=true
12
+ CLUSTER_ENABLE_IPC=true
13
+ CLUSTER_IPC_TIMEOUT=5000
14
+ CLUSTER_SHUTDOWN_TIMEOUT=10000
15
+
16
+ # Worker Configuration
17
+ WORKER_MAX_WORKERS=10
18
+ WORKER_MIN_WORKERS=1
19
+ WORKER_MAX_RESTARTS=5
20
+ WORKER_RESTART_DELAY=1000
21
+ WORKER_TIMEOUT=30000
22
+ WORKER_MAX_CONNECTIONS=1000
23
+
24
+ # Health Monitoring
25
+ HEALTH_CHECK_INTERVAL=30000
26
+ HEALTH_TIMEOUT=5000
27
+ HEALTH_MEMORY_THRESHOLD=0.8
28
+ HEALTH_CPU_THRESHOLD=0.7
29
+ HEALTH_MAX_ERROR_RATE=10
30
+
31
+ # Load Balancer Configuration
32
+ LOAD_BALANCER_ALGORITHM=round-robin
33
+ LOAD_BALANCER_STICKY_SESSIONS=false
34
+ LOAD_BALANCER_SESSION_TIMEOUT=30000
35
+ LOAD_BALANCER_HEALTH_CHECK_INTERVAL=10000
36
+ LOAD_BALANCER_MAX_CONNECTIONS_PER_WORKER=1000
37
+
38
+ # Process Monitoring
39
+ PROCESS_MONITOR_INTERVAL=5000
40
+ PROCESS_MONITOR_HISTORY_SIZE=100
41
+ PROCESS_MONITOR_CPU_THRESHOLD=0.8
42
+ PROCESS_MONITOR_MEMORY_THRESHOLD=0.8
43
+ PROCESS_MONITOR_HEAP_THRESHOLD=0.9
44
+ PROCESS_MONITOR_EVENT_LOOP_THRESHOLD=100
45
+ PROCESS_MONITOR_ENABLE_METRICS=true
46
+ PROCESS_MONITOR_ENABLE_ALERTS=true
47
+
48
+ # Graceful Shutdown
49
+ GRACEFUL_SHUTDOWN_TIMEOUT=10000
50
+ GRACEFUL_SHUTDOWN_FORCE_TIMEOUT=30000
51
+
52
+ # Authentication (Optional)
53
+ # Uncomment and set if you want to secure endpoints
54
+ # API_KEY=your-secret-api-key
55
+ # BASIC_AUTH_USERNAME=admin
56
+ # BASIC_AUTH_PASSWORD=secret-password
57
+
58
+ # Rate Limiting
59
+ RATE_LIMIT_WINDOW_MS=60000
60
+ RATE_LIMIT_MAX_REQUESTS=60
61
+
62
+ # Cache Configuration
63
+ STATS_CACHE_DURATION=5000
64
+
65
+ # Worker Environment Variables
66
+ WORKER_ID=${WORKER_ID}
67
+ IS_WORKER=${IS_WORKER}
68
+ NODE_ENV=production
69
+
70
+ # ============================================
71
+ # Development Configuration
72
+ # ============================================
73
+
74
+ # Uncomment for development environment
75
+ # NODE_ENV=development
76
+ # DEBUG=cluster:*
77
+ # CLUSTER_WORKERS=1
78
+ # LOG_LEVEL=debug
79
+
80
+ # ============================================
81
+ # Production Configuration
82
+ # ============================================
83
+
84
+ # Uncomment for production environment
85
+ # NODE_ENV=production
86
+ # CLUSTER_WORKERS=auto
87
+ # LOG_LEVEL=info
88
+ # LOG_FILE=/var/log/app/cluster.log
89
+ # ENABLE_COMPRESSION=true
90
+ # ENABLE_CACHE=true