I have developed a Mojolicious app on Windows XP, strawberry perl 5.14.2 and Mojolicious version 3.84. For high performance i want to create multiple instances of this app and listening on different ports but same computer. To achieve that i made two copies of my program and used Plack::Middleware::Proxy::Loadbalancer script like this below:
use Plack::Builder;
use Plack::App::Proxy;
builder {
enable "Proxy::LoadBalancer", backends => ['http://l27.0.0.1:8080', 'http://127.0.0.1:8081'];
Plack::App::Proxy->new()->to_app;
};
i start the instances on 8080 and 8081 and then start loadbalancer using plackup loadb.pl command. It listens fine on localhost:5000. But strangely when you connect to port 5000 only 8081 comes up, if it switches to 8080 it gives error Bad Gateway. I am newbie in deployment side so need help here. What is causing the http requests to return only from 8081 ? it seems to be network layer error or something else ? Trying apache loadbalancer will be good idea ?