middleware: false versus cluster: false for low-traffic KrakenJS cost
0 reputation · 13 Apr 2022, 14:03 UTC
Goal is to reduce resource consumption for a low-traffic KrakenJS service while keeping the documented configuration surface intact.
Two documented options are disabling automatic middleware loading with middleware: false to load only explicitly declared middleware, and disabling cluster mode with cluster: false to run a single Node process.
The decision is unresolved because disabling middleware may omit default security headers and CSRF protection provided by Kraken's default stack, and disabling cluster removes multi-core utilization and automatic restart behavior. The constraint is a low-traffic workload where steady-state memory matters more than peak throughput.
What are the documented default values for middleware and cluster in KrakenJS config, and which components are omitted when middleware is false? Does cluster: false change process management beyond forking, and what is the documented impact on availability for infrequent requests?