The default request backlog for starman is 1024 request wich seems too large for Koha. When the system is overloaded it will typically take several minutes to recover because of the backlog of mostly stale requests. I suggest we set a much lower default value and expose a configuration parameter. I propose $PLACK_WORKERS * $PLACK_MAX_REQUESTS / 2 as a default value (just guessing).
Created attachment 192449 [details] [review] Bug 41767: Plack backlog parameter Set a low default --backlog parameter for starman to allow for faster recovery when system becomes overloaded. Also expose configuration parameter for tuning. Test plan: * At the command line verify that the parameter "--backlog 50" is present for starman processes, provided that --max-requests 50 --workers 2: > ps aux | grep starman * Edit /etc/koha/sites/kohadev/koha-conf.xml and add <plack_backlog>157</plack_backlog> (e.g., next to <plack_workers>). * Restart plack: > koha-plack --restart kohadev * Verify that the --backlog parameter has changed accordingly