Plack:...lancer(3pm)
π Plack::Middleware::Proxy::LoadBalancer π
okay bestie so this is a page from the User Contributed Perl Documentation for Plack::Middleware::Proxy::LoadBalancer β a Simple load balancer for your Plack apps. it's giving traffic cop energy but make it cute β¨
π¦ NAME π¦
Plack::Middleware::Proxy::LoadBalancer β literally just a Simple load balancer, no cap π
β¨ SYNOPSIS β¨
here's the whole vibe, copy-paste ready:
use Plack::Builder;
use Plack::App::Proxy;
builder {
enable "Proxy::LoadBalancer", backends => ['http://10.0.0.1:8080', 'http://10.0.0.1:8081'];
Plack::App::Proxy->new()->to_app;
};
πΈ DESCRIPTION πΈ
Plack::Middleware::Proxy::LoadBalancer lets you define several backends. that's it, that's the whole thing β you got multiple servers and this middleware spreads the love around π
π OPTIONS π
backendsβ this is THE option, the main character π here's how you feed it, three ways, all iconic:
you can pass a single one:
enable "Proxy::LoadBalancer", backends => 'http://10.0.0.1:8080';
or:
enable "Proxy::LoadBalancer", backends => ['http://10.0.0.1:8080', 'http://10.0.0.1:8081'];
or:
enable "Proxy::LoadBalancer", backends => {'http://10.0.0.1:8080' => 0.4, 'http://10.0.0.1:8081' => 0.5, 'http://10.0.0.1:8002' => 0.3};
so fr fr: more than one backend can be defined, and weight can be given to backends (that's the hashref one up there, bestie β the numbers are the weights π). choose your fighter, or choose several, we don't judge π
π AUTHOR π
Franck Cuny β ty for your service, king π«Ά
π SEE ALSO π
Plack::App::Proxyβ go read that one too, it's the whole reason this middleware exists π
no hidden lore here bestie, every option, example and default is right there above β nothing left out, nothing invented π
and that's a wrap! this page came from the User Contributed Perl Documentation, perl v5.32.0, dated 2021-01-09, and the header title is Plack:...lancer(3pm) π slay, bye π
β¨
π¦ where this page comes from
- debian bookworm: libplack-app-proxy-perl 0.29-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libplack-app-proxy-perl 0.29-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libplack-app-proxy-perl 0.29-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libplack-app-proxy-perl 0.29-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms