Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2523

When there are too many hoppers, slow down only hoppers instead of the entire server.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • None

      Last night, I was juggling Excel, server log files, custom Java plugin code, FTP, and WorldEdit to solve a lag problem - there were just too many hoppers in loaded chunks (according to Spigot timings, hoppers accounted for 25% of my cpu!). This has been an ongoing problem for me on my survival server - I write custom code to count the entities and tile entities per chunk and dump that to a comma-delimited format, import that into Excel, filter to hoppers and sort by highest-hitting chunks, teleport to those areas in-game, select the vicinity with world edit, expand vert, and then replace hoppers with iron blocks. I repeat this until my timings report and tps improve.

      I've repeated this entire exercise three times now in the last couple of months, and this is after increasing ticks per hopper check and transfer to 10 seconds (200 ticks) and increasing items per transfer to 100, and reducing view distance to 4. I've also implemented a rule limiting hoppers to 10 per chunk (enforced on placement), but that doesn't _retroactively _solve my hopper density problem. Protecting a server from hopper lag shouldn't be so hard.

      I suggest implementing a maximum-hoppers-processed-per-server-tick limit. If some hoppers were due for processing but couldn't get done in this tick, they're delayed to the next tick (and so on for future ticks). This way when there are too many hoppers, ONLY hoppers slow down instead of potentially wrecking the performance of other server features.

      The same could be applied to farm animals and villagers (cows, rabbits, etc - not rideables, pets, or monsters) because a little jitter in those cases wouldn't hurt gameplay. The jitter wouldn't be acceptable for minecarts, so there's a separate problem which needs a different solution.

      I read somewhere that the preferred solution for feature requests is to submit a pull request, but it's just impossible for me. I've got two servers, 7 plugins to maintain, a full time job, and two kids under 5. I hope you'll agree that in a project that's all about improving server performance, solving this problem is worth the investment.

            Unassigned Unassigned
            BigScary Ryan Hamshire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: