Hopper settings in spigot.yml

Discussion in 'Performance Tweaking' started by takatalvi, Feb 21, 2018.

  1. Hi, this may be an old topic, but I'd appreciate some quick insights. I'm having issues where hopper systems my player have (A LOT) cause serious tps drops (12-14tps under certain circumstances) and a substantial amount of the load is due to Worldguard and LWC (understand: locked hoppers in WG regions). Now, I've already talked to the big players about their unholy hopper systems, they are working on reduction. But I'd also like to help the server a bit, by tweaking the hopper settings.

    Until now, I've had it like this:
    Code (Text):
      hopper-transfer: 8
      hopper-check: 1
    hopper-amount: 1
    which I understand is basically the vanilla behavior. I need to change it, so I went to this:
    Code (Text):
      hopper-transfer: 8
      hopper-check: 8
    hopper-amount: 4
    But I feel like it didn't do as much as I expected. I need some help with this, I would like my players to be able to use hoppers, but we don't need express-item-highways. I want to limit them to some extent, that could reasonably reduce CPU load. Any proven settings?
  2. By the way, we're talking hundreds and hundreds of locked hoppers, a lot of them in WG regions. If we get hopper-based CPU load to half, it could seriously help my server overall.
  3. Phoenix616

    Resource Staff

    Without timings it's pretty hard to say what your issue is but I suspect that it boils down to the InventoryMoveEvent being fired a lot more than necessary. This can happen when the Hopper points into a container that is full and does not accept items. It still calls the event and plugins still have to check it (in some cases even every tick)

    Possible "solutions" (all but that last are more like workarounds):
    • Disable/use cheaper hopper protection in your plugins (e.g. I made an LWC fork that has a simpler and faster hopper protection)
    • Get players to remove hoppers. E.g. by giving them an alternative. My server added a plugin with which you can make pipes and easy item filter. That got players to stop building 10k hopper item sorters.
    • Use a plugin that I wrote which has the option to try to cancel the event if no move occurs
    • Use a modified server that includes patches to work around that issue and make hoppers more efficient
    • Like Like x 2
  4. InventoryMoveEvent is exactly the perpetrator here, it came up in the base timings, along with the WG section and LWC section. I realized it had to do with hoppers, but it didn't occur to me full chests could be a problem, that is very interesting. I plan to consider your options tomorrow (I like the first one best). Meanwhile, can you share your hopper settings from spigot.yml? I would like to work out this problem upwards - from the simplest solutions to the more sophisticated.
    #4 takatalvi, Feb 21, 2018
    Last edited: Feb 21, 2018
  5. Phoenix616

    Resource Staff

    I have hopper-amount on 4 too and ticks-per.hopper-transfer on 32 (because that's 4 times the normal rate, that way the overall transfer speed stays the same as in Vanilla) hopper-check is on 1 but iirc that's either broken or at least doesn't do anything with the version my server runs.
    • Like Like x 1
  6. I read in the Spigot config info, that for some versions hopper-check has no effect. Also, on Spigot versions below 1.8.3 there's a setting called spigot-alt-ticking, which is mutually exclusive with hopper-check. However, on my version, hopper-check has an effect, so I'll try to consolidate the settings and play around with them a bit. Thank you so much for now, I'll see what will be the best.
  7. I can reduce hopper cpu load by 80% add on discord I optmize servers. Carry Lord#8349
  8. I'd like to give your fork a shot. I'm currently running Entity LWC on Spigot 1.12.2. I chose Entity LWC back when LWC needed an SQLite update, and the main project didn't have it yet. I don't use it for locking entities though, so I could have switched back to the classic one a long time ago. But still, I wonder what kind of update it will be. If it can run on 1.12.2, I could make a new config based on the old one, plus add the settings specific to your fork. The most important thing is SQLite compatibility, and the use of my existing database (a LOT of locks).