Thread: [634] (Absolutely useless) load balancing

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11  
    Respected Member


    Join Date
    Jul 2015
    Posts
    781
    Thanks given
    206
    Thanks received
    394
    Rep Power
    524
    Quote Originally Posted by Corey View Post
    The same goes for OSRS, and almost certainly the revision OP is using. You could change the default world depending on server load, round-robin, whatever lb-strategy you want.
    You could also load balance the config script (with parameters etc) endpoint.

    ^. You can just generate the config on request (e.g. query worlds for player count, set default world to lowest or whatever strategy). Then you can cache that for whatever interval. Whenever the cache is evicted, next request will regenerate the config.

    Not sure what you're trying to do though.
    Reply With Quote  
     

  2. Thankful user:


  3. #12  
    Registered Member

    Join Date
    Dec 2009
    Posts
    774
    Thanks given
    367
    Thanks received
    455
    Rep Power
    927
    The whole idea of load balancing is that you don't need to communicate between your hosts. Because each request is going through the load balancer, it is the one that decides which host to choose. That's the main function of a load balancer, select a host.

    Attached image

    There are different types of implementations (algorithms) that can decide which host to choose. You can find the algorithms using a simple google search "load balancer algorithms".

    The default algorithm is "least connections", which simply picks the host with the least connections. But you don't always want this. You may have a host running on 8 cores and a host running on 2 cores. What you want in this scenario is that the 8 cores will be chosen more frequently than the second one because it's more "powerful". This load balancer algorithm is called "weighted least connections". The 8 cores host has a bigger "weight" of being chosen.

    Each algorithm has its purpose.
    link removed
    Reply With Quote  
     

  4. Thankful users:


  5. #13  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,819
    Thanks received
    1,767
    Rep Power
    2438
    in most servers this hasn't been a problem and there haven't been any measures implemented that would indicate load balancing was necessary.
    the only examples that come to mind are hestia, alotic and some 614 (might be dementhium). they both had standalone update servers/social servers/game servers.
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  6. #14  
    pride, love, happiness
    .alycia's Avatar
    Join Date
    Jun 2010
    Age
    28
    Posts
    4,106
    Thanks given
    1,714
    Thanks received
    2,062
    Rep Power
    5000
    Yeah sounds like the most simple way to do this is have a query before you assign the IP & Port to the client, and let your load balancer pick which server to send the user to. Sounds like this could be fun to implement, but not sure if it's required in this particular niche.
    Reply With Quote  
     

  7. Thankful user:


  8. #15  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by Nozemi View Post
    OSRS has worlds, and cap them at 2k players iirc.

    I don't think what you're suggesting is even invented for RS or any private servers. You would need to write a server that can communicate with other instances of the server. Otherwise you'll also end up having separate worlds, which is probably the way to go about it.

    However, realistically; you don't have to worry about this at all. If your server can't handle the amount of players you get, it's most likely due to shit code.

    The more realistic question is how to load balance connections to prevent DDoS. Not entirely sure how to go about this, but I'd try reverse proxying the traffic. However, in most cases, using OVH should suffice for this as well.
    That's not quite true, while the game worlds aren't load balanced, the login server's I believe are. IIRC from playing back in 08-12 there used to be around 20 login servers/lobbies e.g. lobby7.runescape.com


    Quote Originally Posted by Tyluur View Post
    in most servers this hasn't been a problem and there haven't been any measures implemented that would indicate load balancing was necessary.
    the only examples that come to mind are hestia, alotic and some 614 (might be dementhium). they both had standalone update servers/social servers/game servers.
    To add to that, no load balancing is actually one of Hestia's issues, connecting 2k clients simultaneously is problematic as everything goes through the 3-in-1 login/lobby/cross-world-chat "social server". But let's face it, no live server's need to test or support 2k concurrent login's.

    The guy's talking about config's are correct, you can pass the lobbyid and lobbyaddress as client properties which will offset the port starting at 40000 (50000 for dev mode). You've got to watch out though, a lot of "dirty" high revision clients have world/lobby offsets "disabled" by whoever did the first Isaac disabling and subsequently everyone who copied him. At least in all 637, 666 & 667 client's I've seen in the downloads section.
    Attached imageAttached image
    Reply With Quote  
     

  9. Thankful user:


  10. #16  
    Contributor


    Join Date
    Jul 2010
    Posts
    450
    Thanks given
    256
    Thanks received
    268
    Rep Power
    1305
    Quote Originally Posted by Greg View Post
    That's not quite true, while the game worlds aren't load balanced, the login server's I believe are. IIRC from playing back in 08-12 there used to be around 20 login servers/lobbies e.g. lobby7.runescape.com
    Yeah, didn't think about that!
    Reply With Quote  
     

  11. #17  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Nozemi View Post
    Never done load balancing myself, so wouldn't really know the best practice. However, you could have your client ask a web service what server instances are listening for connections. Then choose the one with least load.
    That sounds like the best idea for what I'm trying to accomplish. I was wondering how to integrate that step inside the client's protocol, but I realized I could just fetch the data from the web service before launching the JFrame... That would be quite simple and easy to implement.

    Quote Originally Posted by knd6060 View Post
    I thought rs hosted 4 worlds per server. Idk where i got that info from could be wrong
    Huh maybe, but that sounds like a pain to manage. I'd rather not add multi-world support for game servers.

    Quote Originally Posted by techdaan View Post
    I'm not sure about older game versions, but in RS3 the game configuration (jav_config.ws) contains the default hosts.

    Unfortunately many clients and servers hardcode the startup parameters. If you load them from a website you can set the default host for js5, lobby et cetera. In RS3 the default world server is sent during lobby login.
    Yep, that's what I'm going to do. Just call some API and fetch the default hosts at startup.

    Quote Originally Posted by Corey View Post
    You could also load balance the config script (with parameters etc) endpoint.
    If you're talking about the server that sends the initial hosts back to the client, assuming that's his only responsibility I don't think load balancing is necessary. Even though it will get multiple startup requests, that information would be extremely lightweight.

    Quote Originally Posted by Khaleesi View Post
    ^. You can just generate the config on request (e.g. query worlds for player count, set default world to lowest or whatever strategy). Then you can cache that for whatever interval. Whenever the cache is evicted, next request will regenerate the config.

    Not sure what you're trying to do though.
    Thanks for the idea. I'm probably just going to generate it once per minute. The worlds can just update their connection count in the DB and then I can generate some formula based on that.

    Quote Originally Posted by Admiral Slee View Post
    The whole idea of load balancing is that you don't need to communicate between your hosts. Because each request is going through the load balancer, it is the one that decides which host to choose. That's the main function of a load balancer, select a host.

    Attached image

    There are different types of implementations (algorithms) that can decide which host to choose. You can find the algorithms using a simple google search "load balancer algorithms".

    The default algorithm is "least connections", which simply picks the host with the least connections. But you don't always want this. You may have a host running on 8 cores and a host running on 2 cores. What you want in this scenario is that the 8 cores will be chosen more frequently than the second one because it's more "powerful". This load balancer algorithm is called "weighted least connections". The 8 cores host has a bigger "weight" of being chosen.

    Each algorithm has its purpose.
    I didn't think of the individual server strength. I guess I can just store the number of cores in the DB and do a load formula like:

    connection_count * (1/server_cores)

    Quote Originally Posted by chaflie View Post
    Yeah sounds like the most simple way to do this is have a query before you assign the IP & Port to the client, and let your load balancer pick which server to send the user to. Sounds like this could be fun to implement, but not sure if it's required in this particular niche.
    Yep, that's the plan.

    Quote Originally Posted by Greg View Post
    That's not quite true, while the game worlds aren't load balanced, the login server's I believe are. IIRC from playing back in 08-12 there used to be around 20 login servers/lobbies e.g. lobby7.runescape.com




    To add to that, no load balancing is actually one of Hestia's issues, connecting 2k clients simultaneously is problematic as everything goes through the 3-in-1 login/lobby/cross-world-chat "social server". But let's face it, no live server's need to test or support 2k concurrent login's.

    The guy's talking about config's are correct, you can pass the lobbyid and lobbyaddress as client properties which will offset the port starting at 40000 (50000 for dev mode). You've got to watch out though, a lot of "dirty" high revision clients have world/lobby offsets "disabled" by whoever did the first Isaac disabling and subsequently everyone who copied him. At least in all 637, 666 & 667 client's I've seen in the downloads section.
    Yep, planning on overwriting the parameters on client launch for lobbyaddress.

    ------------

    Anyway, thanks for the help everyone!
    Project thread
    Reply With Quote  
     

  12. #18  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    Quote Originally Posted by clem585 View Post
    That sounds like the best idea for what I'm trying to accomplish. I was wondering how to integrate that step inside the client's protocol, but I realized I could just fetch the data from the web service before launching the JFrame... That would be quite simple and easy to implement.



    Huh maybe, but that sounds like a pain to manage. I'd rather not add multi-world support for game servers.



    Yep, that's what I'm going to do. Just call some API and fetch the default hosts at startup.



    If you're talking about the server that sends the initial hosts back to the client, assuming that's his only responsibility I don't think load balancing is necessary. Even though it will get multiple startup requests, that information would be extremely lightweight.



    Thanks for the idea. I'm probably just going to generate it once per minute. The worlds can just update their connection count in the DB and then I can generate some formula based on that.



    I didn't think of the individual server strength. I guess I can just store the number of cores in the DB and do a load formula like:

    connection_count * (1/server_cores)



    Yep, that's the plan.



    Yep, planning on overwriting the parameters on client launch for lobbyaddress.

    ------------

    Anyway, thanks for the help everyone!
    Another factor to consider is what you're trying to achieve; are you trying to reduce the latency that the user experiences by connecting them to their nearest server, or distribute load across multiple servers?
    Reply With Quote  
     

  13. #19  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by hc747 View Post
    Another factor to consider is what you're trying to achieve; are you trying to reduce the latency that the user experiences by connecting them to their nearest server, or distribute load across multiple servers?
    Probably the 2nd due to the lack of servers. But either way, since the server is choosing the algorithm, it's really easy to implement both and have a switch between the two modes. It's probably just a few line of code each.

    Load-based: make a cached list based off the formula I wrote: connection_count * (1/server_cores)
    Proximity-based: fetch location from connected client + calculate closest server
    Project thread
    Reply With Quote  
     

  14. #20  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    Quote Originally Posted by clem585 View Post
    Probably the 2nd due to the lack of servers. But either way, since the server is choosing the algorithm, it's really easy to implement both and have a switch between the two modes. It's probably just a few line of code each.

    Load-based: make a cached list based off the formula I wrote: connection_count * (1/server_cores)
    Proximity-based: fetch location from connected client + calculate closest server
    Imo, load-based should be server authoritative whereas the client should determine it's closest server based off of latency / ping sampling.
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Selling 614 Loading 634 Client
    By dylan12 in forum Selling
    Replies: 0
    Last Post: 04-17-2011, 03:44 AM
  2. [PI] Loading ALL 634 item stats
    By Alexander in forum Snippets
    Replies: 23
    Last Post: 03-21-2011, 05:49 PM
  3. 614 client loading a 634 cache
    By shadder in forum Requests
    Replies: 23
    Last Post: 03-12-2011, 10:36 PM
  4. Replies: 434
    Last Post: 02-26-2011, 02:17 AM
  5. Replies: 0
    Last Post: 01-31-2011, 10:09 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •