I have 4 web server instances running on the same machine behind a load balancer. All the instances are serving the same application. I want a module taken out the of these 4 instances and run it as a separate service, so that i can reduce the load on the above 4 instances.This service needs to send back a simple json response after doing some index search,service is not exposed to any outside client. So given this simple requirement, what would be the best solution to implement the new service, mainly considering performance . Will it be RMI or socket programming or is there any other solution. Will I have to sacrifice performance if I go for RMI instead of socket programming?
As I said, we already have for web server instances running on the same machine behind a load balancer. All the instances are having the same application deployed. I want to take a module out of this 4 instances and run it as a separate services so that I can reduce load on server instances. All the server instances will communicate with this new service to get response.
Amit Ghorpade wrote:I am not able to understand why socket programming is needed here. Maybe I am not getting the requirement correct.
Why not have a firewall to block anything that is not allowed to access?
Its easy, decoupled and configurable from my point of view.
Hope this helps
Anoop Isaac wrote:we already have for web server instances running on the same machine behind a load balancer.
I can't imagine any reason to do such a thing. You use a load balancer to spread load between separate machines. It makes no sense to run 4 instances on one box and load balance between them. You lose all sharing of state, etc.
Further, I agree with Tim, there is no reason to use RMI in this case. Don't do it.