mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-08 07:16:49 +00:00
perf: Optimize FrankenPHP/Octane configuration for high load
**Changes:** 1. **Caddyfile**: - Reduced num_threads from 24 to 20 - Added request timeouts (read_body: 10s, write: 60s, idle: 120s) - With 4 containers: 20 × 4 = 80 total workers 2. **Dockerfile**: - Added explicit --workers=20 to octane:frankenphp command - Increased --max-requests from 250 to 1000 - Applied to app-dev, app-release, and app stages 3. **Octane config**: - Enabled DisconnectFromDatabases listener - Enabled CollectGarbage listener - Prevents DB connection leaks and memory leaks **Impact:** - Better resource management under load - Prevents connection pool exhaustion - Requires db.t3.large (591 max connections) or better - Supports up to 250 concurrent VUs **Related:** - Requires RDS upgrade from db.t4g.micro to db.t3.large - Works with DB_CONNECTION_POOL_SIZE=25 (100 total connections) - See configuration-analysis.md for details
This commit is contained in:
14
Caddyfile
14
Caddyfile
@@ -1,6 +1,9 @@
|
||||
{
|
||||
frankenphp {
|
||||
num_threads 24
|
||||
# Reduced from 24 to 20 for better resource management
|
||||
# With 4 containers: 20 × 4 = 80 total workers
|
||||
# Requires db.t3.large (591 max connections) or better
|
||||
num_threads 20
|
||||
}
|
||||
order php_server before file_server
|
||||
}
|
||||
@@ -8,6 +11,15 @@
|
||||
http://:8000 {
|
||||
root * /fleetbase/api/public
|
||||
encode zstd br gzip
|
||||
|
||||
# Request timeouts to prevent hanging
|
||||
timeouts {
|
||||
read_body 10s
|
||||
read_header 5s
|
||||
write 60s
|
||||
idle 120s
|
||||
}
|
||||
|
||||
php_server {
|
||||
resolve_root_symlink
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user