NAME

Plack::Middleware::SizeLimit - Terminate processes if they grow too large

SYNOPSIS

use Plack::Builder;

builder {
    enable SizeLimit => (
        max_unshared_size_in_kb => '4096', # 4MB
        # min_shared_size_in_kb => '8192', # 8MB
        # max_process_size_in_kb => '16384', # 16MB
        check_every_n_requests => 2
    );
    $app;
};

DESCRIPTION

This middleware is a port of the excellent Apache::SizeLimit module for multi-process Plack servers, such as Starman, Starlet and uWSGI.

This middleware only works when the environment psgix.harakiri is set to a true value by the Plack server. If it's set to false, then this middleware simply does nothing.

You must use at least version 0.2006 of Starman, and 0.19 of Starlet. Earlier versions ignore the flag to stop the process.

CONFIGURATIONS

SEE ALSO

Starman, Starlet

AUTHORS

唐鳳 cpan@audreyt.org

CC0 1.0 Universal

To the extent possible under law, 唐鳳 has waived all copyright and related or neighboring rights to Plack::Middleware::SizeLimit.

This work is published from Taiwan.

http://creativecommons.org/publicdomain/zero/1.0