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


    rtcabooservb I'll join your server to find out what's wrong...

    Also, updated it to 1.58.5. In the newer version I fixed:
    - chunks getting loaded from another thread because of the item stacker
    - chunk lighting fixing being terribly slow and CPU intensive, combined with unsafe Bukkit calls. This is now gone and replaced by a better operation handling system.

    Chunk lighting is fixed async on a (buffered) cloned chunk, instead of modifying a possibly unloaded chunk. After all is done it will transfer the data over (synchronized) if the chunk is loaded, and queue the chunk for sending.

    This all in an effort to prevent chunk corruption (it was possible in the lighting fixer) and to make everything a bit more stable. Lighting read-out logs the amount of chunks that were fixed from lighting issues since last message.
  3. Offline


    Let me add the plugin back.

    Edit: Added back and I snagged the 1.58.5 build.

    bergerkiller Wulfspider I tried to downgrade spout to the recommended build (644 I think) and it gave out horrible horrible errors. Couldn't even start the server because it gave out errors about chunk corruption. I upgraded back to 714 and server loaded. Still have the issue we were talking about though bergerkiller. Please talk to wulfspider about it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Dec 28, 2018
  4. Offline


    You can't use build 644 on a 1.1 build of CraftBukkit, it was made for 1.0.1 and 1.0.1 only. You can't jump between builds like that.
  5. Offline


    Lol I know. I was just testing though. That isn't the issue though. Don't quote me because I could be wrong, but bergerkiller said somewhere that spout keeps sending chunk data nonstop that conflicts with the packet buffer. Even without nolagg, it can be a problem. I would wait until bergerkiller wakes up to explain it better. Hopefully you can fix it because he said it was a problem with spout, not nolaggs.
  6. I discovered an issue with multiverse-netherportals. Netherportal nearby the end portal teleports me to the end world. Without nolagg plugin it teleports me correct to the nether world. With nolagg tt works fine one or two minutes after server start, but then it start porting me to the end instead nether.
  7. Offline


    Recommended Build:
  8. Offline


    Adrenaline yup already preparing a final version for the new RB. Already converted all my listeners to use the new event system and added some performance fixes.

    Also some more fixes to the lighting fixer; right now it stores generated chunk data too soon, causing unpopulated chunks to be made.


    All updated to work for the latest 1.1 RB build. Also fixed several other issues, of which:
  9. Offline


    bergerkiller The newest spout seems to have worked. After you went to bed last night, I updated spout to 716 and the buffer went to 0%, chunk sending 100%, 2.0 chunks/tick. Updated to CB 1820, spout 721, still is working 100% fine.
  10. Offline


    rtcabooservb yeah I visited your server to check it out for myself, and was surprised that the buffer load issue was gone. :)
    gotto' love Spout...
  11. Offline


    bergerkiller Im eager to get NoLagg back on but after having to roll back 6 hours, and then having issues with stone being replaced by air, im extremely hesitant to put this back on right away. Im using spout as well, but in all seriousness, only for VanishNoPacket. You feeling confident that the chunk scrambling is fixed? :)
  12. Offline


    fffizzz the stone to air issue is probably resolved now. The chunk lighting fixer can no longer change actual blocks, only the lighting information, which makes it impossible to screw chunks up any more.

    I am confident it is fixed yes, I see no possible way it can happen now. (the only function, h(), is called in the chunk loader, which is called after loading the chunk data from file. This is done natively as well, so there is no difference whatsoever)
  13. Offline


    please implement per plugin TPS usage detection please
  14. Offline


    Is this stable to use with spout 721 RB & 1.1 bukkit RB? (Spout is a dependency right?)
  15. Offline


    hqSparx not really possible in a simplified way: it requires me to add hooks in all scheduled tasks and the listeners of plugins. Afraid that TPS detection will slow the server down too much, but with the new event system it may be easier to do...but doubtful.

    offdps yup.

    Adrenaline yes that is a CraftBukkit issue, happens now and then when a player opens the 'Multiplayer' tab and requests your servers' information. For some reason this causes this error to pop up now and then. (not related to NoLagg; it's a CB issue that persisted for pretty long...)

    hqSparx then I recommend you use VisualVM and look for functions that use up a lot of CPU :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Mar 26, 2019
  16. Offline


    Build: 1820
    NoLagg: 1.58.6

    2012-01-26 08:28:16 [WARNINGTask of 'NoLagg' generated an exception
        at com
    at com.bergerkiller.bukkit.nolagg.NLListener.fixColumn(
    at com.bergerkiller.bukkit.nolagg.NLListener$
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    at net.minecraft.server.MinecraftServer.w(
  17. Offline


    Adrenaline thanks, I see I forgot to add some NPE checks. Will add them and upload 1.58.7, which also fixes some block-chunk reference issues. (Block objects stored reference re-allocated chunk data)


    Also adding a separate 'chunk trigger' rate. This sets at what rate chunk block change packets are sent to the clients, this is an effort to get rid of the semi-transparent chunks everywhere when sending at rates > 1.


  18. Offline


    Chunks dont work :S

    Or it is lag client xd
  19. Offline


    Adrenaline did you use 1.58.7? And it looks like client lag yes...or a really odd rendering bug (?)
    Adrenaline likes this.
  20. Offline


    Nope, now i update i need a while to test

    Sometimes i have this at logs:
    Bukkit: 1818
    NoLagg: 1.58.7

    2012-01-26 09:25:01 [SEVEREjava.lang.NullPointerException
    -01-26 09:25:01 [SEVERE]    at net.minecraft.server.NetworkListenThread.a(
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.NetLoginHandler.a(
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.Packet254GetInfo.handle(SourceFile:16)
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.NetworkManager.b(
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.NetLoginHandler.a(
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.NetworkListenThread.a(
    2012-01-26 09:25:01 [SEVERE]    at net.minecraft.server.MinecraftServer.w(
    2012-01-26 09:25:01 [SEVERE]    at
    2012-01-26 09:25:01 [SEVERE]    at
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  21. Offline


    yhymmm, thx for reply :D

    This is now not Bukkit issue:

    2012-01-26 09:50:28 [ pipe
    -01-26 09:50:28 [SEVERE]    at Method)
    2012-01-26 09:50:28 [SEVERE]    at
    2012-01-26 09:50:28 [SEVERE]    at
    2012-01-26 09:50:28 [SEVERE]    at
    2012-01-26 09:50:28 [SEVERE]    at
    2012-01-26 09:50:28 [SEVERE]    at
    2012-01-26 09:50:28 [SEVERE]    at net.minecraft.server.Packet51MapChunk.a(
    2012-01-26 09:50:28 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.BufferedPacket51MapChunk.a(
    2012-01-26 09:50:28 [SEVERE]    at net.minecraft.server.Packet.a(
    2012-01-26 09:50:28 [SEVERE]    at net.minecraft.server.NetworkManager.g(
    2012-01-26 09:50:28 [SEVERE]    at net.minecraft.server.NetworkManager.d(
    2012-01-26 09:50:28 [SEVERE]    at
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  22. Offline


    Adrenaline um, yes it is :)
    The buffered chunk packet implementation extends the native Packet51MapChunk. The error that occurred here is in native space (in the thing out of my reach; the thing I extend).

    All I could do here is catch the error and cancel sending, but since it is a socket exception, it will probably fail all next times as well.


    A closer Google search provided me with the answer: the client closed the game window, which caused the connection to break. So, even if I handled it here, it would be pointless: another packet will soon throw the exact same error.
  23. Offline


    uhm. fatal error ? :D
    2012-01-26 10:22:35 [SEVERE] [NoLaggAn error occured while sending chunks:
    2012-01-26 10:22:35 [SEVEREjava.lang.IllegalArgumentExceptionComparison method violates its general contract!
    2012-01-26 10:22:35 [SEVERE]    at java.util.ComparableTimSort.mergeHi(
    2012-01-26 10:22:35 [SEVERE]    at java.util.ComparableTimSort.mergeAt(
    2012-01-26 10:22:35 [SEVERE]    at java.util.ComparableTimSort.mergeCollapse(
    2012-01-26 10:22:35 [SEVERE]    at java.util.ComparableTimSort.sort(
    2012-01-26 10:22:35 [SEVERE]    at java.util.ComparableTimSort.sort(
    2012-01-26 10:22:35 [SEVERE]    at java.util.Arrays.sort(
    2012-01-26 10:22:35 [SEVERE]    at java.util.Collections.sort(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.update(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.update(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.access$1(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1.handle(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$Operation.execute(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$Operation.execute(
    2012-01-26 10:22:35 [SEVERE]    at
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.updateAll(
    2012-01-26 10:22:35 [SEVERE]    at com.bergerkiller.bukkit.nolagg.NoLagg$
    2012-01-26 10:22:35 [SEVERE]    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2012-01-26 10:22:35 [SEVERE]    at net.minecraft.server.MinecraftServer.w(
    2012-01-26 10:22:35 [SEVERE]    at
    2012-01-26 10:22:35 [SEVERE]    at
    2012-01-26 10:22:37 [INFORead timed out
  24. Offline


    Adrenaline sigh Java 7 all over again :)

    But they are right, there must be some sort of violation in the comparator. This is what they actually mean:
    Or the other way around; the equals check tells me it is true but I say it isn't. I wonder where this happened though, since all chunk coordinates in the viewable area have an unique index...

    (BTW: where do you manage to generate these errors? I run a server 12 hours/day and I never ever get this...I mean...seriously?)

    Aaaah got it!

    Unbelievable yet true...I return Integer.MAX_VALUE if the found coordinate is out of range. When sorting, if it encounters two of this same index, the two objects have to equal. Since this is not the case, it throws that error.

    I'll quickly add an equals check to fix this :)

    The Wizard For orebfuscator...mmh around 2-5. Best is to look at the busy percentage (monitor) and see if it's too high or not. If you think chunks are processed too slowly, you can increase the amount of threads as well.

    And I guess I haven't added a disable for xporbs yet, I'll add something like it in the next version I guess. (new suggestions are always welcome)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Sep 9, 2018
  25. Offline


    It could be 'diagnostic mode' or something, so it would analyze only on cmd
    i really need to figure out which plugins are causing laggs
  26. Offline


    Running latest #1818 RB bukkit and latest NoLagg version.
    After i used command "nolagg monitor" on console for 10 minutes, it generated error.
  27. Offline


    Mercury ok thanks, added a fix here now. Will update it all after I added support for the Spout version of 'ore to client' obfuscation.


    Ok all fixed, see the new 1.58.8 version on GitHub and soon on Bukkit Dev. Main changes:
  28. Offline

    The Wizard

    How many threads should I use if i have Orebfuscator?
    What do I have to write to ignoredItemTypes: to stop xp orb stacking?
  29. Offline


    I run a server that usually has 200 ish players during the week and 260 on the weekends. I also have the RB of bukkit at the moment installed on the server. Do you reccomend running the latest version of NoLagg on the production server or waiting a little bit longer for more bugs to be fixed?
  30. Offline


    I got this NPE logging onto my server once with the newest Nolagg and RB build 1818.

    2012-01-26 19:18:20 [SEVERE] java.lang.NullPointerException
    2012-01-26 19:18:20 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkCompressQueue.isAlive(
    2012-01-26 19:18:20 [SEVERE]    at com.bergerkiller.bukkit.nolagg.sending.ChunkCompressionThread.nextQueue(
    2012-01-26 19:18:20 [SEVERE]    at
  31. Offline


    Rungario I recommend waiting a bit longer, since new bugs still appear out of nowhere. Not severe bugs like chunk corruption, but things like unexpected exceptions because data is altered.

    cartman-2000 Yup that error, see this version:
    Also an error only few people have (3 so far, maybe it is common)

    Also, if you have issues with the sending order of chunks like some others had and you know since what version this happened, feel free to post.

Share This Page