Custom load balancing logic with apache

Discussion in 'Apache' started by kota, Jun 17, 2010.

  1. #1
    Hi,
    I am a newbie and need to setup a load balancing setup where apache will distribute load between 2 or 3 tomcats(each tomcat resides on a different machine) based on a parameter coming in the URL. Based on that parameter I have to carry on some logic and implement an algorithm in java and then send that request to the corresponding tomcat. Can anyone explain how to do that. For eg. I have unique Id coming in as the URL parameter. The tomcat installed in each machine has a DB which can only allow a range of that ID. So I want to apply the logic on the apache(either by some reg ex or implementing some load balancing class of apache) such that the ID belonging to the particular machine is routed to that machine. Please help??
     
    kota, Jun 17, 2010 IP
  2. netload

    netload Member

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #2
    Try nginx instead of Apache
     
    netload, Jun 17, 2010 IP
  3. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #3
    Also use one server as a Load Balancer which will forward the requests as per your login to the remaining 3 servers hosting your website/application. This will ease out a little bit of complications.
     
    madaboutlinux, Jun 17, 2010 IP