• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

For Load Balancing

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please guide me in it.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no experience with load balancing, but it's not something handled by a servlet.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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. ??
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic