Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

LoadBalancing 150+ Players

Comments in 'Plugin Development' started by Radix, Aug 3, 2015.

  1. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Ive been looking all through out pocketmine and I cant find anything besides LoadBalancer which does not work! So is there a way I can balance player though three servers?
  2. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Best shot is to have one main/hub server, and use that server to handle the players.
    hoyinm14mc and Andrey Nazarchuk like this.
  3. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    The problem is there are over 10-30 Servers connecting to SimpleAuth via Database and players always get a login timeout before entering the server
  4. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    I don't know, then. Anyways you have to be really good with networking if you want your server to be a network of servers, like LBSG.
  5. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Well im aiming to be the biggest factions network in PE ,
  6. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Get all of the servers motd's, compare the amounts of players, then transfer the player to the server with the least players.
    PHP:
     $least min(array $playerAmounts); 
    OR
    PHP:
     $least min($number1$number2$number3); 
    Last edited: Aug 3, 2015
  7. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    Nope... :)
    Plugin installed on server is not suitable for Load Balancing

    Use Round-Robin DNS, setup multiple A record with same NAME to setup Round-Robin :)
    Round-Robin distribute players before they reached the game server, it redirected them to IP set in A records accordingly when they reached DNS server, which makes load balancing all the way faster and reliable just like lbsg :)

    *But, A record required default port
    Andrey Nazarchuk likes this.
  8. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    It is if it runs in PlayerPreLogin event.
    Plus, you have to pay for Round-Robin...
    deot likes this.
  9. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    No needed, Round Robin is a function built-in in DNS Server :) And DNS server is same machine with your webhost, domain :)

    But, only bad for Round Robin is... client side cache... I didn't use it for hpmcpe is because client side Round Robin Cache.

    It happens like this: When player connected to hpmcpe.com:19132, DNS server takes him to a IP set in A Record List. At this moment, cache saved in client side (player phone). Let's say if DNS takes him to "Lobby 2", if that player disconnected and connect again, saved cache will be used... and takes the player to "Lobby 2" again... :( Cache takes more than 1 hour to refresh... So, if Lobby 2 is full, he disconnected and re-connect again, it still takes him to Lobby 2... until cache refreshed.. :(
    Andrey Nazarchuk likes this.
  10. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    That's why you transfer the player to the least full lobby in PlayerPreLoginEvent
  11. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    All my servers are on the same network though , Just ran on different ports

    Could I pay you to create a plugin for my use?
  12. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Then transfer to a different port using FastTransfers API :D
    I'm not that good at coding, but I could try since ill need a plugin like this in the future, PM me.
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Andrey Nazarchuk likes this.
  14. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
  15. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    First one right, second one wrong. Please make sure you actually know PHP before "helping" other people. Correct way to do it is this:
    PHP:
    $least min(array($num1$num2$num3));
    If you noticed, the parameter is supposed to be an array, but the second one you put was not an array.
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Please make sure you actually know PHP before "helping" (or more accurately, criticizing) other people.
    From http://php.net/min :
    TL:DR: min($array) is same as min(...$array) for count($array) > 1.
    Andrey Nazarchuk likes this.
  17. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Wups, guess I didn't see that part.

Share This Page

Advertisement