Bug 41767 - Plack backlog parameter
Summary: Plack backlog parameter
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Andreas Jonsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-04 10:54 UTC by Andreas Jonsson
Modified: 2026-02-04 11:06 UTC (History)
0 users

See Also:
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 (2.62 KB, patch)
2026-02-04 11:06 UTC, Andreas Jonsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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