https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42358

--- Comment #4 from Andrew Fuerste-Henry <[email protected]> ---
Created attachment 204180
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204180&action=edit
Bug 42358: Add option to use Plack::Middleware::SizeLimit

This patch implements:
https://metacpan.org/pod/Plack::Middleware::SizeLimit

This will terminate the starman workers when they grow above a certain size.
The limits can be configured in the koha-conf.xml and should have no effect if
not set

0 - sudo cpanm Plack::Middleware::SizeLimit
1 - Copy the new section to /etc/koha/sites/kohadev/plack.psgi
    enable_if { $ENV{PLACK_MAX_MEMORY} } SizeLimit => (
        max_unshared_size_in_kb => $ENV{PLACK_MAX_MEMORY},
        # Available settings, documentation suggests on the first is needed
        # min_shared_size_in_kb => '8192', # 8MB
        # max_process_size_in_kb => '16384', # 16MB
        check_every_n_requests => 2,
        log_when_limits_exceeded => 1,
        callback => sub {
           my ($size, $share, $unshared) = @_;
           # Nothing here yet
        },
    );

2 - Edit /etc/koha/sites/kohadev/koha-conf.xml
    add the new variable:
    <plack_max_memory>4096</plack_max_memory>

3 - ./debian/scripts/koha-plack --restart kohadev
4 - tail the logs
5 - perform an item search for barcode:%
6 - Note in the plack-intranet-error.log that the process is killed
7 - Confirm the page loads successfully
8 - Try the about pages and other processes that use momery, confirm worker
returns the page and then is killed

Signed-off-by: Bob Bennhoff <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to