Plack::Middleware::Proxy::LoadBalancer - Simple load balancer


Plack-App-Proxy documentation  | view source Contained in the Plack-App-Proxy distribution.

Index


NAME

Top

Plack::Middleware::Proxy::LoadBalancer - Simple load balancer

SYNOPSIS

Top

  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

Top

Plack::Middleware::Proxy::LoadBalancer allow you to define several backends.

OPTIONS

Top

backends
  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};

More than one backend can be defined. Weight can be given to backends.

AUTHOR

Top

Franck Cuny

SEE ALSO

Top

Plack::App::Proxy


Plack-App-Proxy documentation  | view source Contained in the Plack-App-Proxy distribution.