Holographic Displays lag when using placeholders

Discussion in 'Spigot Plugin Help' started by ImEvo2, Feb 13, 2020.

  1. So I've been trying to get scoreboards to works on my server for the past year or so without causing lag but every time I've tried at 40+ players it starts to hit the TPS so I'm hoping the spigot community can help me find a solution :)

    I have multiple scoreboards setup for mob arenas, parkour, votes etc. These all work fine.
    However, when I set one up for top balance is lags the server to high hell, I believe this is caused by essentials player data being at around 20,000+ unique players and it takes essentials a hot second to sort them all. This in turn delays placeholders in holographic displays from updating. This is a serious issue on one of the older servers, trying to load a baltop scoreboard after a restart will just crash the server.

    I've tried:
    - Giving the server 30GB RAM but it doesn't fix the hit on TPS each time the scoreboard is loaded
    - Using /essentials cleanup 1 1000 2 to remove old player data but all the data seems to return after a restart (maybe doing something wrong)
    - Only using single placeholder leaderboards instead of one that holds top 10
    - Manually removing player data that hasn't been used in a while but that kinda risky and time-consuming
    - Using the holographic scoreboards plugin rather than extensions but this has the same issue

    So I'm at a loss for how to get a baltop scoreboard to work consistently.

    Any suggestions would be greatly appreciated or just another way to display these leaderboards.
     
  2. you need a plugin which would calculate baltop on a separate thread where it won't hit your TPS and only then display it, also one which won't do this too often - at most every 15 minutes

    also increasing RAM won't help you here, the calculation is mostly CPU intensive, 20k players balance data is less than a few megabytes of RAM I think, so giving it 30GB only will make things worse, reduce your TPS further, more RAM = less TPS, unless you have a lack of RAM, then lack of it can affect things negatively.

    also how is your player data saved? it is going to be significantly slower if you have to sort data with every player being a different file, it would be much more efficient to store it in a single file (like mysql table) for leaderboard calculations, per-player files are good when you need to only load the player's data on join, but not for when you need to compare the data with many other players
     
    #2 Govindas, Feb 13, 2020
    Last edited: Feb 13, 2020
    • Like Like x 1
  3. Are you using HolographicExtension? If yes, is your placeholder prefixed by {slowest} ? (Refresh rate of 10 seconds)
    If that does not help, the only real solution is what Govindas said
     
  4. It's essentials economy so it's all stored inside the player data folder.


    It's set to slowest but it doesn't change the fact it's struggling to efficiently sort the player data.

    I just need to remove old/inactive players but not manually as it's a ballache
     
  5. To be entirely fair, do you even need a baltop scoreboard? You could make a baltop gui using deluxemenus or any menu plugin that supports placeholderapi.
     
  6. I don't think that'd change performance much