Inactive [FIX/ADMN] NoLagg v1.88.1 - Prevent common lag causes on your server [2338]

Discussion in 'Inactive/Unsupported Plugins' started by bergerkiller, Sep 17, 2011.

  1. Offline


    I had already made this plugin before after having a major lag issue. (lots of torches being filled, turned into items, lag for 20 minutes) It also works for 1060.

    Some feature ideas are taken over from PerformanceTweaks by @LexManos so some credit goes to him. Code, however, written from scratch by me. :)


    If you get a warning message [NoLagg TLN] followed up with a stack trace in the log, this has to do with the main thread not having responded within 10 seconds. When a plugin takes more than this time to enable, it will show that. The warning is NOT an error and is no bug, and not a bug related to NoLagg. To disable this feature, disable 'threadlocknotifier' in the config.yml. This feature is mainly intended to notify you what plugin is causing the server to freeze, may it ever happen. It is used to debug plugins in general, as they may get stuck for whatever reason.

    NoLagg's features in a nutshell


    Prevent lag caused by many items

    Every time an item gets spawned, it is buffered per chunk. For example, you spawn 30 items using Q and the maximum allowed items per chunk is 20, then the 10 remaining items are not spawned. They are spawned as soon the item count in this chunk is < 20 again.


    Form item stacks - fully automatically

    Whenever two or more (configurable) items or experience orbs get near each other, they form a single stack of that item type. If someone drops 64 dirt blocks on the ground using Q, it will show a single item of 64 dirt instead.


    Prevent lag caused by TNT

    This plugin takes over tnt ignition caused by explosions. When exploding stacks of tnt, it does not rush all tnts into a single tick, but detonate them nicely in sync. This results in pretty awesome fireworks. :)


    Prevent lag caused by lighting glitches

    Whenever a new chunk is generated, it's lighting information is generated and all nearby players receive the updated chunk data. If the auto-method fails, you can use /nolagg fix to do it manually. This fixing fixes, for example, dark spots in and around caves lagging the client.


    Set entity spawn limits

    You can set a spawn limit on virtually every entity in the game. From mobs to items to TNT. Only thing being excluded is Players, since I can't simply kick someone 'like that'. :)
    Note: It removes already spawned entities too. So, if you want to keep your animals alive, don't set mob or animal limits, or it will possibly clear your farm animals. (or you can disable the spawn limiter all together)

    I recommend finding an alternative plugin for this instead. Removing entities after they are spawned causes more lag than it prevents!

    Global auto-saver

    Since asynchronous chunk saving is now implemented internally, it is no longer a problem to save entire worlds frequently. You can set auto-save intervals in the configuration. If used with an interval higher than 400 ticks (20 seconds) it will use a scheduled task instead of the internal saver to prevent chunks never getting saved. Another benefit is that player information is also auto-saved, preventing your players losing their inventory state.

    New chunk sending mechanics

    Instead of loading chunks all around the player, the player direction is used to load the visible chunks first. This means that players can expect chunks in front of them to load quickly, while chunks on the sides take a bit longer to appear. When the player looks into another direction, the direction changes and thus the new visible chunks get loaded first. Only if all chunks ahead of the player are loaded, chunks around the player are sent. This all can be configured using a simple minimum and maximum sending rate.


    Examining the server tick rate

    If you encounter very low tick rates and you want to find out what plugin is causing it, you can use the examine component to find it out. It comes with a graphic viewer, which makes bug tracking the easiest thing ever.


    Prevent cross-thread access for events

    As it seems, some plugins don't follow the rules and use Bukkit methods in another thread. This plugin will notify you and cancel if possible whenever this happens so other plugins understand their mistake. If you encounter a lot of spam in the console, first check the stack trace for the plugin that caused the error. Report this error to the author or remove the plugin, if you have questions you are free to ask.

    Configuration (on BukkitDev)

    Commands and Permissions (on BukkitDev)

    Synchronized code accessed by another thread? (BukkitDev)


    Video by brandcool86


    - Help I experience missing chunks
    If you are using Spout, don't use Reloads. This is also the reason why Spout added a warning when a player tries to reload the server. Not using Spout, then it's a bug which you can report.

    - Can this plugin be used with PTweaks
    (this message was really old...) Yes, they are compatible, but if certain features overlap, make sure you disable these features in either plugin.

    - I get a warning about the async auto save and interval. Wat do?
    Change the autoSaveInterval value in the configuration to a value higher than 400, like 600. The warning is to prevent endless autosaves to occur, clogging up CPU.

    - I have experienced CPU usage
    CPU usage is not the same as lag. NoLagg uses multiple (2-3) extra threads to prevent tick and network lag. If a lot has to be done, it does this quicker, but this takes more CPU obviously.

    - I have lag when using NoLagg
    See also the FAQ above. Explain what type of lag you have: tick lag, client lag, network lag and/or 'block placement' lag. You can use /nolagg monitor to check the tick rate. If this is normal (>15), then you have network lag. Client lag is when the FPS drops. Block placement lag is lag when the tick rate is normal and other network messages, like chat, are instant.

    - WorldEdit causes lag...
    YES because it is unsafe to take over the main thread while another plugin is having hold over it. I can try fixing this, but it could ultimately lead to some serious concurrency exceptions. Don't expect this to be implemented very soon...

    - Do spawn limits interfere with mob-spawning plugins like MobArena?
    No, it does not. It only limits mobs spawned by 'nature': all custom creature spawns are ignored throughout the run of the plugin. Only after you reload will it lose track of these entities and will it remove custom-spawned mobs. If you use MobArena, be sure nothing is going on when you reload the server.

    - Does item stacking interfere with Showcase or BleedingMobs?
    It supports Showcase and ShowcaseStandalone entirely. (showcased items are completely ignored at all times) The same applies to the 'particles' created by the BleedingMobs plugin. Know of a plugin where it stacks items which should not be stacked? Post the plugin name so I can add support. You are an owner and want to add support? Only having a function in your plugin to check if an item is 'ignored' is enough.

    - Can this plugin be used with Chunk Manager
    If you want to use the Chunk Manager with Nolagg, disable the chunk sending of Nolagg first. If you don't do that, this plugin will do that by itself and send a warning in the log. Of course, compare the results first. :)

    - What are the best settings if I have a lot of RAM memory?
    This plugin does not deal with reduced RAM memory. If I could, I would, but you simply can't reduce the amount of memory Java uses. This data is locked and secured, so I can't simply throw away bits of data or write and read data from/to disk. Any plugin claiming to reduce RAM usage on a server, is probably 'garbage collecting'. This fakes having less RAM usage by removing unused data, but Java does this by itself as well once it hits a certain limit. All these plugins will do is make the Garbage Collector run in overdrive, which will only kill your tick rate and/or CPU speeds. A bad thing.

    - I get a lot of 'Synchronized code accessed from another thread' errors
    Find out what plugin is acting up by inspecting the stack trace. If the plugin that causes this is inactive, all you can do is wait for a refurnished version or someone to fix it for you, or use an alternative plugin. If it's still under development, notify the author of this, it IS an error caused by that plugin. If you can't find out the cause, PM me or post in this thread.

    Before you begin writing a lag issue

    This is very important, just posting a 'it causuz lagz und shitz' won't do, won't help and I won't be able to help you any further either. Question is if I even want to help you, if you post such a message without anything worth looking at. Things to include in your message:
    - Errors in the log if possible
    - What CB version you use and what NoLagg version you use
    - When this lag occurs. Tick rate drop in general?
    - The configuration you used when running this plugin
    - What type of lag if applicable. Options are: tick lag, client lag, network lag (see above)

    Important links

    NoLagg Download page and others at Dev Bukkit
    View the source code of NoLagg at GitHub

    Use an archive extracting program (WinRar, WinZip) to open the archive.

    - Add option to disable physics when the tick delay becomes too high


    Show your appreciation for my plugins by donating
  2. Offline


    @ProjectInfinity true, but it does reduce disk usage. I'll just fix that little bug where it loads the chunks so it has no downsides...
  3. Offline


    Alright, looking forward to it.
  4. Offline


  5. Offline


  6. Offline


    When using v1.41 with RB#1337, my client crashes (server message "EndOfStream", but actually blackscreen) when a creeper explodes.
    With v1.40 its fine..
  7. Offline


    same here.
  8. Offline


    Is Creeper explosions not handled as TNT? What happens if you disable TNT buffering?
  9. Offline


    Working fine without tnt buffering
  10. Offline


    I'm a bit sceptical of downloading this, cause I have a PC with 16 GB Ram, i7 2.93 GHz, and so on....
    I want to make use of my good Specs, is this the right Plugin to make use of the Power of my PC?
    If so, what configuration do I need to use?
  11. Offline


    This plugin was now causing serious problems. I have 2 Servers running with bots up to 50 ppl online at the same time.

    We tested multiple times. The Plugin lowers the TPS more than without it.
    We tested with a massive kaktus farm too. The plugin slowed the server down massively. I dont know what exactly causes this but I imagine its the item-stack-forming code

    Tested with 1.41 CB 1337
  12. Offline


    Item stacking shouldn't help on server lag. It should help FPS lag for the clients. It's only natural that this will cause a performance hit on the server as it has to calculate and change every item into a stack.

    Someone correct me if I am wrong, but that's my take on the performance you see.

    @bergerkiller I just updated to 1.41 and basically the server is lagging worse now with chunk unloading. A lot worse. Blocks now respawn and take up to 5 seconds before the items pop up.

    Average tickrate with just 30 people on is as low as 2.7 ticks. Conclusion: DO NOT use chunkunloading.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  13. Offline


    When I build a huge cuboid of tnt (>100.000 tnt) and the chunk gets unloaded (disconnect, go out of range), your plugin won't trigger on these tnts, will it?

    This will cause massive server lag / capacity usage. Plus when the chunk gets loaded again, it will cause massive client sided lag.

    autoSaveInterval: 30
    updateInterval: 50
    useChunkUnloadDelay: false
    chunkUnloadDelay: 10000
    chunkSendInterval: 5.0
    useSpawnLimits: false
    explosionRate: 200
    tntDetonationRate: 150
    bufferTNT: true
    tntDetonationInterval: 1
    bufferItems: true
    formItemStacks: true
    stackRadius: 2.5
    maxItemsPerChunk: 20
  14. Offline


    I got
    2011-11-06 22:56:12 [SEVERE] Could not pass event CHUNK_LOAD to NoLagg
    at com.bergerkiller.bukkit.nolagg.ItemHandler.unloadChunk(
    at com.bergerkiller.bukkit.nolagg.ItemHandler.loadChunk(
    at com.bergerkiller.bukkit.nolagg.NLWorldListener.onChunkLoad(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at net.minecraft.server.ChunkProviderServer.getChunkAt(
    at org.bukkit.craftbukkit.CraftWorld.getChunkAt(
    at org.bukkit.craftbukkit.CraftWorld.getChunkAt(
    at com.garbagemule.MobArena.Arena.removeEntities(
    at com.garbagemule.MobArena.Arena.cleanup(
    at com.garbagemule.MobArena.Arena.forceEnd(
    at com.garbagemule.MobArena.MobArena.onDisable(
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(
    at org.bukkit.craftbukkit.CraftServer.disablePlugins(
    at net.minecraft.server.MinecraftServer.stop(
    When I shut down my server using 1.41 ?
  15. Offline


    @Sepulzera Good point you got there, it will probably continue igniting although it is out of range...
    I'll add a check against 'is the tnt block unloaded'.

    @G!zmo-rus I can see that the item buffer is causing this duplication, kinda weird though. Can I see your configuration & plugin list?

    Ow damn did I include the failing explosion drops in it, and ye, it causes a crash. I'll fix it ASAP :(

    I'll take a firm look at all the 'performance risks' in this plugin. I read about the chunk unload causing lag, kinda weird though. Item stacking does use 'getNearbyEntities' to perform it, it is likely that this operation is too heavy.

    @ledhead900 must be because of the fun way how Bukkit works. I'll add some NPE checks there. (it's caused by my memory leak fixing clearing and setting chunk maps to null.)
  16. Offline


    No worrys
  17. Offline


    Status update:
    • TNT handler fixed and compatible with 1.9 pre 5
    • Now working on improving the stacking function
  18. Offline


    ever since updating to 1.41 yesterday, ive been getting this. I dont know if NoLagg is the cause or not, but im desperate to find a fix.
    2011-11-06 08:53:59 [INFO] Disconnecting Garnetty [/]: Internal server error
    2011-11-06 08:53:59 [WARNING] Failed to handle packet: java.lang.NullPointerException
            at net.minecraft.server.Packet21PickupSpawn.<init>(SourceFile:22)
            at net.minecraft.server.EntityTrackerEntry.b(
            at net.minecraft.server.EntityTrackerEntry.b(
            at net.minecraft.server.EntityTracker.track(
            at net.minecraft.server.WorldManager.a(
            at net.minecraft.server.World.c(
            at net.minecraft.server.WorldServer.c(
            at net.minecraft.server.World.addEntity(
            at net.minecraft.server.World.addEntity(
            at net.minecraft.server.ServerConfigurationManager.c(
            at net.minecraft.server.NetLoginHandler.b(
            at net.minecraft.server.NetLoginHandler.a(
            at net.minecraft.server.NetworkListenThread.a(SourceFile:94)
            at net.minecraft.server.MinecraftServer.h(
    2011-11-06 08:53:59 [SEVERE] java.lang.NullPointerException
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.Packet21PickupSpawn.<init>(SourceFile:22)
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.EntityTrackerEntry.b(
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.EntityTrackerEntry.b(
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.EntityTrackerEntry.scanPlayers(
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.EntityTrackerEntry.track(
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.EntityTracker.updatePlayers(
    2011-11-06 08:53:59 [SEVERE]    at net.minecraft.server.MinecraftServer.h(
    2011-11-06 08:53:59 [SEVERE]    at
    2011-11-06 08:53:59 [SEVERE]    at
    2011-11-06 08:53:59 [SEVERE] Unexpected exception
            at net.minecraft.server.Packet21PickupSpawn.<init>(SourceFile:22)
            at net.minecraft.server.EntityTrackerEntry.b(
            at net.minecraft.server.EntityTrackerEntry.b(
            at net.minecraft.server.EntityTrackerEntry.scanPlayers(
            at net.minecraft.server.EntityTrackerEntry.track(
            at net.minecraft.server.EntityTracker.updatePlayers(
            at net.minecraft.server.MinecraftServer.h(
    2011-11-06 08:54:28 [INFO] Read timed out
    2011-11-06 08:55:56 [INFO] Read timed out
    2011-11-06 08:56:34 [INFO] Connection reset
    2011-11-06 08:56:54 [INFO] Connection reset
    2011-11-06 08:57:32 [INFO] [MCServerlist] Server updated on!
    2011-11-06 08:57:56 [INFO] Connection reset
    2011-11-06 08:58:14 [INFO] Read timed out
    2011-11-06 08:58:18 [INFO] Read timed out
  19. Offline


    I got this as well seems Im cursed with end of stream since updating spout craft and this. Will narrow this down soon likely some light should be shed in morning.
  20. Offline


    @fffizzz @ledhead900 It's kinda weird, an item which has no itemstack internally. Something or someone messed it up there...

    Ok it took some time, but the following changes will be made in 1.42:

    Updatedto v1.42 fixing the above issues.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  21. Offline


    wasnt sure if you were saying this was a NoLagg problem or not.. however since removing nolagg this morning, it has yet to crash with that error. It was happening about every 30-40 minutes previously.
  22. Offline


    @fffizzz not related to NoLagg, I am not dealing with item native nms coding and when storing/spawning items the itemstack is never null.
  23. Offline


    Ok, its strange that the problem hasnt happened since I removed NoLagg this morning. I may add 1.42 back in an see if it occurs again.
  24. Offline


    hmm I thought of an idea what about a spawn block limiter aka you know how worldedit spawns huge amounts of blocks how about making that tick over time???

    @bergerkiller Also Love how you failed in your OP :p
    hehe thats called the files :D unless of course you mean per-world basis :(
  25. Offline


    @bergerkiller 1.42 breaks compatibility with Showcase , items can be duped again - the plugin stacks them
  26. Offline


    @bergerkiller I decided to try out 1.42. It does however not fix the lag issues with chunkunloading.
    At just 24 players in the morning I started noticing block lag. One thing I have seen though, chunkunloading NEVER caused me to use more ram. Is it working correctly?
  27. Offline


    @thehutch yup I meant on a world basis there. :)
    (Read a request about it once to set limits for certain worlds)

    @Lexington Thanks for noticing it, since I don't use it when testing. Changed a word to fix it again. (it was only checking item 1, not the surrounding items found)

    @ProjectInfinity I double-checked the code once again, and :eek:
    Let's say it assumed all chunks were spawn chunks and thus ignored al chunks...chunks never got unloaded.

    Aaaand time for 1.43 -.-

    @ProjectInfinity You were right all along, the chunk unload delay WAS failing. Instead of letting the chunks unload after the delay, it simply re-set the time, so this time never came. After adding lots of debug messages I also found out a more severe bug: it was setting times for every single chunk on the world, causing a weird repeating load and unload loop. All this is now fixed and I tested it thoroughly to make sure it is.

    Also fixed support for Showcase, as it was removed previously.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  28. Offline


    Awesome, props for not being "not my code" when it comes to issues. Looking forward to testing it live.
  29. Offline


    Is anyone getting this problem as me? After I updated to 1.43, whenever a player gets kicked, the reason is always

    "End of Stream"

    I'm not sure if it's NoLagg. Anyone can confirm?
  30. Offline


    @mrciku I can kick myself perfectly well without getting errors, are you using Spout?
    Which CB build are you using?

    You are not using a plugin which alters the kick message? I can remember someone making a fake end of stream error to kick players without hurting their feelings :)
  31. Offline


    Ah, I think it's the latest Spout build in Jenkins, probably, thanks for testing anyway :D

Share This Page