Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For Load Balancing

 
Arvind Subramanian
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
want to write a load balancing app for our web server. So designed to run the seprate thread to check the status of all our web servers at the regular interval of time. What is the best solution for this. How can we able to run a servlet in the regular interval to check all the server? Our all webserver are running in tomcat.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets are ill-suited for running at regular intervals. A servlet is not an appropriate choice for this usage.
 
Arvind Subramanian
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please guide me in it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no experience with load balancing, but it's not something handled by a servlet.
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what it means to "check the status" of a server... but if one of the possible values for status is "Not Running" then it doesn't make sense to have something running in that server try to check for that, right? You should run something outside the server to do the checking.

And no, that wouldn't be a servlet. A plain old Java application run by a plain old job scheduler would be more like it.

I'm not sure you can get from just knowing whether some servers are running to a proper load-balancing application for those servers -- I certainly wouldn't try writing that myself -- but that's a separate topic. Perhaps you aren't actually as ambitious as what that description sounds like.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run multiple instances of the Tomcat (may be clustered as well with session replication) and let Apache or any other http server do the load balancing.
 
Arvind Subramanian
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont need the very feature rich load balancer(like session transfer). The load balancing is mainly for avoiding transfer of request to the dead webserver server(tomcat or underlying Postgres ).
What i designe is a seprate tomcat instance will be running on the seperate server, which acts as the loadbalancer. Some kind of process or thread must call all the web server at the regular interval and must update about it status. When the request enters the loadbalancer , based on the status and simple round robin the request will be transered to any one of the webserver.

In all the webserver there will be the seprate application running, which will used by the load balancer to check the tomcat and postgres. The request from the loadbalncer will be made to this application for the status.

The confusion i have is how to built that low priority thread to update the status. ??
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic