Results 1 to 7 of 7

Thread: Load Balancing Based on Geographic Location

  1. #1
    Join Date
    Oct 2008
    Posts
    138

    Default Load Balancing Based on Geographic Location

    Hello,

    Is there a way to do Load Balancing based on geographic location when using the Dynamic Load Balancing AddOn?

    If not, can you recommend a good alternative for accomplishing this?

    Thanks,

    Derrick F.

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    I believe this to be possible integration albeit we don't have a solution developed as of yet. Conceptually you could modify the ModuleLoadBalancerRedirector source and provide the ip lookup/redirection within it prior to the redirection. You can reference our GeoIP article (or for an integration example see this article) for this logic.

  3. #3
    Join Date
    Oct 2008
    Posts
    138

    Default

    Quote Originally Posted by matt_y View Post
    I believe this to be possible integration albeit we don't have a solution developed as of yet. Conceptually you could modify the ModuleLoadBalancerRedirector source and provide the ip lookup/redirection within it prior to the redirection. You can reference our GeoIP article (or for an integration example see this article) for this logic.
    Thanks Matt. To modify the ModuleLoadBalancerRedirector source would this be using the Wowza IDE or just by adjusting properties for the module?

    Derrick F.

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    You would use the IDE and the Java source included with the package as a starting place.

    Richard

  5. #5
    Join Date
    Oct 2008
    Posts
    138

    Default

    Quote Originally Posted by rrlanham View Post
    You would use the IDE and the Java source included with the package as a starting place.

    Richard
    Thanks Richard

  6. #6

    Default

    Hi,

    Expanding on Matt's & Richard's responses, you may also need to modify LoadBalancerRedirectorConcurrentConnects which is also included in the download.

    I have done something similar in the past and I performed all of the logic in this class. The server information is stored in a Set that is ordered by connection counts. When getRedirect() is called, the first server in the list is returned.

    You would need your own getRedirect method that passes in the client ip address. You cannot use the current getRedirect() method as it is defined by the ILoadBalancerRedirector interface.

    To decide which server to return, you would have a 2 step process. Firstly, you would group all of the servers based on location. This would be best done at the end of the onMessage method where you would use different Sets for each location. You could do this using GeoIp as all of the servers with similar ip addresses are probably located in the same place. One thing to watch for is some isp's do not update location information for datacenter servers properly so the GeoIP lookup may be wrong. In this case, you would have to determine the location some other way. You then do a GeoIP lookup to determine the location of your client and use the closest Set of servers. Once you have the set of servers to use, you just return the least loaded server from that location.

    You could extend this to also look at the total load of a location and use the next closest if that location is getting overloaded. This would require more complex logic but should be easily doable.

    Remember, when using modified classes, either for the module or this class that you need to use your own class names or package names so that they do not conflict with the same classes in the main load balancer jar file.

    Roger.

  7. #7
    Join Date
    Oct 2008
    Posts
    138

    Default

    Quote Originally Posted by roger_l View Post
    Hi,

    Expanding on Matt's & Richard's responses, you may also need to modify LoadBalancerRedirectorConcurrentConnects which is also included in the download.

    I have done something similar in the past and I performed all of the logic in this class. The server information is stored in a Set that is ordered by connection counts. When getRedirect() is called, the first server in the list is returned.

    You would need your own getRedirect method that passes in the client ip address. You cannot use the current getRedirect() method as it is defined by the ILoadBalancerRedirector interface.

    To decide which server to return, you would have a 2 step process. Firstly, you would group all of the servers based on location. This would be best done at the end of the onMessage method where you would use different Sets for each location. You could do this using GeoIp as all of the servers with similar ip addresses are probably located in the same place. One thing to watch for is some isp's do not update location information for datacenter servers properly so the GeoIP lookup may be wrong. In this case, you would have to determine the location some other way. You then do a GeoIP lookup to determine the location of your client and use the closest Set of servers. Once you have the set of servers to use, you just return the least loaded server from that location.

    You could extend this to also look at the total load of a location and use the next closest if that location is getting overloaded. This would require more complex logic but should be easily doable.

    Remember, when using modified classes, either for the module or this class that you need to use your own class names or package names so that they do not conflict with the same classes in the main load balancer jar file.

    Roger.
    Thanks a million Roger for the information.

Similar Threads

  1. Replies: 3
    Last Post: 07-17-2014, 08:54 AM
  2. Load Balancing using Kemp Load Balancer
    By deanomeara in forum General Forum
    Replies: 0
    Last Post: 05-14-2013, 07:56 AM
  3. Replies: 0
    Last Post: 01-24-2013, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •