Help please...

Discussion in 'Spigot Discussion' started by yurinogueira, Jan 29, 2020.

  1. I have a survival server with +- 40 player online and my tps go to hell... sorry for my bad english
    I'll buy a dedicate, so it's good? upload_2020-1-28_21-48-46.png
    Or it's better?
    It's only a survival server, don't is a network.
  2. Hello you need to send more information plugins logs timings server version etc ...
  3. Attached Files:

  4. Come on parts here you have a big problem
    you have many plugins and at the same time you use version 1.15 which is unstable
    I also see that you have the auth lobby and the game mode on the same server this is a bad idea
    you need to try using less plugins
    I also recommend you not to use worldedit
    it's potentially dangerous
    I also recommend this‚ö°.283181/
  5. You got a ton going on to pinpoint any particular issue. If you are getting tps drops with either of those set-ups with only 40 people, I would guess it is one or more of your plugins.

    You can try and get some better performance by increasing the amount netty threads in your spigot.yml:
    netty-threads: <Your Max Player Number> (I use personally use 1024)
    I have no idea why people think you are locked into one thread per core and anything else hinders performance.
    CPUs were one core and only one core since their conception all the way until the 2000's, and running 10's of thousands of threads on one core was normal, and one of the best ways to obtain more performance.
  6. I don't understand what your logic here is. More threads running on a single core doesn't equal greater performance. If anything, it's less performance. I think when people say that you're "locked to one thread per core" when talking about Minecraft servers is that you want the server thread to be the primary task on one core since the Minecraft server does most of its work on one thread.

    And, uh, unless you have 1024 cores, I don't think there's a point in allowing that many netty threads to spawn. I hope that those threads aren't initialized regardless of the player count, because that would immediately consume 0.5 GB of memory for no good reason.
  7. That pretty much sums it up...

    Fine I will explain.

    There is no "logic" here, only evidence and proof.
    The proof of the matter is, setting netty threads to at least the amount of players you have connected (which is why I recommend max) has a beneficial performance impact.
    Don't believe me? Don't bother reading up on it, type it in to the config, /restart and check!

    Here is a real life example of how threading can help you. It is dumbed down, but I hope you get the idea.

    You want to ping 1000 machines. Ping will send 4 packets in 1 second intervals and then calculate the average return trip in milliseconds, and packet loss as a percent.
    If you do this in one thread, you will use minimum CPU resources, however, we have no choice but to wait 4 seconds 1 by 1, until we have pinged all 1000 machines 4 seconds apart resulting in a job time of one hour and six minutes.
    Is there not a better way to contact 1000 machines in less than an hour?
    Yes there is! We will use threading. We can open up multiple console windows, all running on their own thread, or even write an app ourselves with multiple threads. Now, it will ping all 1000 machines nearly simultaneously.
    It will take time to spool them up, and the CPU usage will increase, but pining all 1000 machines will take about 4.20 seconds. Only a fraction of a second difference compared to over an hour of wait time we had single threaded before.
    Sometimes it is not about the CPU usage it is about the time taken between things, like time between ticks. Time is money, and the set up cost might be more expensive but the time savings is invaluable.
    #8 ForbiddenSoul, Feb 10, 2020
    Last edited: Feb 10, 2020
  8. The difference between your theoretical situation and Netty is that Netty doesn't stop and wait after one packet is sent. The Netty thread will send it and immediately move on to the next task. One thread is capable of handling multiple connections. It used to be the case that the Minecraft server spawned a thread to handle each and every player's connection, but switched to Netty so that wouldn't be the case. And if you ever have a situation where you see higher performance with more Netty threads than your core count, then that has to do with how your operating system handles threading or if you have other threads eating up CPU time.