Files
archived-frankenphp/caddy
Mads Jon Nielsen c099d665a2 feat(caddy): configurable max_idle_time for autoscaled threads (#2225)
Add configurable max_idle_time for autoscaled threads

The idle timeout for autoscaled threads is currently hardcoded to 5
seconds. With bursty traffic patterns, this causes threads to be
deactivated too quickly, leading to repeated cold-start overhead when
the next burst arrives.

This PR replaces the hardcoded constant with a configurable
max_idle_time directive, allowing users to tune how long idle
autoscaled threads stay alive before deactivation. The default remains 5
seconds, preserving existing behavior.

  Usage:

  Caddyfile:
````
  frankenphp {
      max_idle_time 30s
  }
````
  JSON config:
```
  {
      "frankenphp": {
          "max_idle_time": "30s"
      }
  }
````

  Changes:
  - New max_idle_time Caddyfile directive and JSON config option
  - New WithMaxIdleTime functional option
- Replaced hardcoded maxThreadIdleTime constant with configurable
maxIdleTime variable
  - Added tests for custom and default idle time behavior
  - Updated docs
2026-03-06 14:43:37 +01:00
..
2026-02-26 12:38:14 +01:00
2026-02-11 15:49:39 +01:00
2025-12-12 14:29:18 +01:00
2025-12-12 14:29:18 +01:00
2026-02-26 12:38:14 +01:00
2026-02-26 12:38:14 +01:00
2025-12-12 14:29:18 +01:00
2026-02-26 12:38:14 +01:00