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


    In your configs:
    useSpawnLimits: false
  3. Offline


    Thanks alot dude! :)
    Just making that sure before downloading it. :)
  4. Offline


    I am curious if buffered tnts do really explode.
    Created, again, a large cube of tnt with the WorldEdit cmd "//set tnt", started exploding it. Buffered tnts increased, like supposed. After some time (before everything was exploded) I had removed the cube with the WorldEdit command "//undo". Buffered tnts decreased started decreasing slowly now, but I couldn't see any further exploding tnt.

    So there are 2 possbilities:
    1. WorldEdit removed these buffered tnts too
    2. Buffered tnts won't explode.
  5. Offline


    @Sepulzera It buffers TNT blocks, not the actual TNT entities. This is what happens:
    If WorldEdit changes the block type, it will ignore the detonation of that block. (why detonate a block that is not TNT?)
  6. Offline


    I would like this plugin but I am getting lot of spam like "Can't keep up did the system time change or is the server overloaded?" and when i break a block it laggs
  7. Offline


    Hey, I'm getting the same error as @kalez:

    2011-12-27 08:05:23 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-12-27 08:05:23 [SEVERE] java.util.ConcurrentModificationException
    2011-12-27 08:05:23 [SEVERE] 	at java.util.HashMap$HashIterator.nextEntry(
    2011-12-27 08:05:23 [SEVERE] 	at java.util.HashMap$
    2011-12-27 08:05:23 [SEVERE] 	at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.update(
    2011-12-27 08:05:23 [SEVERE] 	at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateAll(
    2011-12-27 08:05:23 [SEVERE] 	at com.bergerkiller.bukkit.nolagg.NoLagg$
    2011-12-27 08:05:23 [SEVERE] 	at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-12-27 08:05:23 [SEVERE] 	at net.minecraft.server.MinecraftServer.w(
    2011-12-27 08:05:23 [SEVERE] 	at
    2011-12-27 08:05:23 [SEVERE] 	at
    What I can tell you is that my server has java 1.7.0 installed, maybe this is the issue...
  8. Offline


    @douglas_srs you need to update NoLagg, see the latest version on GitHub.


    1.53.4 is out (it was in DEBUG version before), latest version adds the option to monitor the update times:
    - Entity listing
    - Spawn limiting
    - Stack forming
    - Chunk updating (check if they can be unloaded or not)
    - Chunk unloading
  9. Offline


    I would like this plugin but I am getting lot of spam like "Can't keep up did the system time change or is the server overloaded?" and when i break a block it laggs
  10. Offline


    @LOLXDDUDE ok great, can finally find out what is lagging you then.
    1. Download the latest NoLagg version (GitHub, 1.53.4)
    2. Make sure you are an operator
    3. perform a /nolagg monitor
    4. Walk around/fly around 'play the game'
    5. Check the update times and what operation takes to longest. It uses a sort of pie-chart, the matching name per color can be found above.
    6. Tell me what the update times are and what 'bar' is the largest at that point

    I already made the spawn limiter use a lot less time by embedding the global limits in the world limits today, but that's not in 1.53.4. If the spawn lim. is the largest, then I'll upload a new version where this is greatly improved.
  11. Offline


    I just installed the latest and now its working nicely.
  12. Offline


    @LOLXDDUDE Ok great, still, could you tell me what the times are? Every millisecond processing time less is given :)

    (I am now optimizing it until it becomes madness lol)


    Lol I am bothering about flies in a wasps nest (?)...I just noticed that it took 1 whole second to unload all the wonder the tick rate drops now and then.

    Time to DO this correctly :)


    Ok that figures, the only thing I didn't log takes ages to execute. The chunk sending queue took 6 milliseconds per tick (sometimes over 500), let's see what is going on there...

    Good news: All possible lag issues are gone. For one, it will now async-save every chunk at all times. Secondly, every single element in this plugin that could have a performance boost has it now. Spawn limiter, entity list updater and stack former times are almost zero ms right now. Chunk unload system has been thrown around: instead it will take over regular chunk unloading instead of only unloading chunks I unload manually. This greatly reduces tick lag as I have seen, it's incredible.

    I'll update to 1.54 soon, first checking if the chunk send queue can be improved as well.

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


  14. Offline


    @fffizzz Todays beast
    This class brought chunk sending down 2 - 9 ms per send. It now sends incredibly fast, faster than native coding ever did. (it didn't buffer the data there and it uses some useless calculations too)

    It can't be faster, plus the reuse of the byte data reduces the memory write rate of the server :)
  15. Offline


    Got it. Love it. Especially since my players seem to like making huge chicken farms, pumping out way more eggs than they'll ever need... Stack em up - not a problem! Thanks, @bergerkiller .

    Is there a setting in NoLagg that will help with the lag caused when a new player joins?
  16. Offline


    @Greylocke Still prepping up the newest version, which does experience from this less. (all chunk data can easily be made from data regions already allocated in memory)
  17. Offline


    ive got kind of a noob question, and im sorry. Ha. But, I have NoLagg on my server, which isn't incredibly powerful, and it completely prevents explosions. the server's command window starts shooting off 'severe' messages about nolagg and explosions whenever a creeper or tnt would explode. is there something i can do to fix this, or at least at least re-enable the explosions?

    P.S also, for whatever reason, we (my friends and I who play on the server) cannot take any damage. I'm not sure if its because of nolagg or not, but it would be great if somebody could give me some advice on any of this stuff. thanks
  18. Offline


    Which version of nolagg and craftbukkit?
    Which plugins do also use?
    Sounds like an other plugin would cause it.
  19. Offline


    Updated NoLagg to 1.54. (long) list of fixes and improvements:

    What you will notice in general is that it can endure a lot more: you can fly at high speeds while the chunks keep on coming without the tick rate suffering. I wanted to add some sort of chunk buffer too (like Spout does), but it would be too hard to implement from within a plugin. :)

    Do note: generating terrain still eats the tick rate, since that simply HAS to be run on the main thread. Nothing I can do about that sadly. However, you can adjust the rate at which it is generated by adjusting the sending rates.


    *facepalm* Hang on guys, it's only stacking items on one world now...noticed it after loading a second world.
  20. Offline

    Don Redhorse

    did you get the issue with blocksOnGlass figured out?

    Perhaps the code of that plugin needs to change... I and MorganM would welcome any input there.. :)
  21. Offline


    @Don Redhorse Already figured it out and posted a comment on a ticket too. What he does is alter the actual glass/fence/etc. block to make it 'solid', but this 'solid' state is also used by lighting, thus lighting gets messed up.

    Also, fixed that stacking issue (1.54.1)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
    Don Redhorse likes this.
  22. Offline


    He fixed the bug and uploaded a new version.
    I am kinda afraid using it, but had some positive first results.

    Sadly he couldn't provide any method to fix the damaged world, except using MCEdit to replace fences with any block (like sponge) just to undo it (=fence again), so the light level gets recalculated.
  23. Offline


    Guess I'll remove it until it is 100% fixed. =/
  24. Offline


    @Sepulzera i have the 'essentials' pack of plugins on the server. i havent changed the version of any of it since i put it on, but it only recently started blocking explosions. it will say that the explosion did not go as planned, or something like that.

    Edit- When an explosion SHOULD have happened, the server gives me this (repeating a few times)

    27 22:30:20 [INFO] [NoLagg] Warning: explosion did not go as planned!
    2011-12-27 22:30:20 [SEVERE] java.lang.NoSuchMethodError: net.minecraft.server.Block.dropNaturally(Lnet/minecraft/server/World;IIIIF)V
    2011-12-27 22:30:20 [SEVERE] at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplosion(
    2011-12-27 22:30:20 [SEVERE] at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplosion(
    2011-12-27 22:30:20 [SEVERE] at com.bergerkiller.bukkit.nolagg.NLEntityListener.onEntityExplode(
    2011-12-27 22:30:20 [SEVERE] at$67.execute(
    2011-12-27 22:30:20 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(
    2011-12-27 22:30:20 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.Explosion.a(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.World.createExplosion(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.WorldServer.createExplosion(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.EntityTNTPrimed.explode(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.EntityTNTPrimed.w_(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.World.tickEntities(
    2011-12-27 22:30:20 [SEVERE] at net.minecraft.server.MinecraftServer.w(
    2011-12-27 22:30:20 [SEVERE] at
    2011-12-27 22:30:20 [SEVERE] at

    sorry if this is considered spamming. i just want to make sure that whoever can help actually understands the problem
  25. Offline


    Great anti-lag plugin. Been using it for a long time and fixes many errors too.
    I use /nolagg monitor alot and was wondering if it was possible (for spout users) to press a certain key and it would pop up on the GUI so that it doesn't spam chat? That would be awesome!
  26. Offline


  27. Offline


    @AnthonyRickard You need to update NoLagg and/or CraftBukkit itself, the 'dropnaturally' function got renamed over time.

    @convictedsaint I considered doing that, but it's simply too hard to get all the text to align correctly in a generic text field or label. In the chat this is a lot simpler.
  28. Offline


    Maybe put it into an achievement box?
  29. Offline


    Thanks for your work on this great plugin, I've noticed that sometimes (it seems random, but might have to do with a user being in the Neither) that the server starts slowing way down, but the CPU Load and Memory Load don't indicate a problem. The log gets spammed with "Can't Keep Ups". Here is a screenshot of your monitor which shows there is a tick problem.
    Don't know if it is even caused by your plugin but maybe its something worth looking into for your plugin to fix if it's not?
  30. Offline


    Items doesn't seem to stack on 1.54.1
  31. Offline


    @mrciku Do you really have the 1.54.1 version? (1.54 had that issue, it was on GitHub for a while)

    @ghost15 I recommend updating NoLagg, as it indeed fixes that 'cant keep up' issue quite well. It had to do with the item stacker and spawn limiter working on overdrive, combined with the sending queue allocating new memory at a high rate (+13 mb/s)

Share This Page