Bug 41767

Summary: Plack backlog parameter
Product: Koha Reporter: Andreas Jonsson <andreas.jonsson>
Component: Architecture, internals, and plumbingAssignee: Andreas Jonsson <andreas.jonsson>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41767: Plack backlog parameter

Description Andreas Jonsson 2026-02-04 10:54:13 UTC
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).
Comment 1 Andreas Jonsson 2026-02-04 11:06:49 UTC
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