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


    The same issue on my server - text is invisible but it still works - for example [Lift] Sign is still functional.
    kahlilnc likes this.
  3. Offline


    @Zathras ah thanks for clearing that up, then I know the sign update event isn't properly handled. (not too hard to fix; I'll just add a separate queue for signs)

    @Lexington inspected the log and everything seems to go all right. Did notice a steady increase of the static memory (the memory that was not cleared by the garbage collector) but it eventually dropped again.

    I do have to find out what the spawn area really is. In MC it is 12, I used 8 for some reason. It does make quite a difference.


    Ok the sign issue was easily fixed (only compare packet timestamps for block change packets). Text now properly displays to the clients. Any other issues with NoLaggChunks?
  4. Offline


    So far no issues - 26 players online and no noticeable lag.
    If I ran into any problems , I will post another log.
  5. Offline


    Am I supposed to be getting spammed with warning messages like these

    10:08 AM [WARNING] [NoLagg] Chunk [9/8/Creative] was restored from the chunk saving queue!

    with the new nolagg?
  6. Offline


    @Sk8Sanctified Well not really, but it happens every time a chunk is unloaded and then instantly loaded's kinda annoying. Mostly caused by *some* plugins not handling onChunkUnload.

    Since I don't know if the chunk will be loaded again shortly, I can't handle it properly. I did reduce the spam level now, but it still happens now and then...
  7. Offline


    Players report some client-side lags , few players have problems with teleportation , they get into the sky and fall - forcing resend of chunk (through /chunkme) does not help.

    New log
  8. Offline


    @Lexington how do you mean 'get into the sky and fall'? As in, they teleport to the new location and there is no chunk underneath them?


    Reuploaded v1.45 and NoLaggChunks, with pure fixes:
    I recommend re-updating it.


    Ugh sign issue still exists... Reuploaded to fix that in NoLaggChunks.
  9. Offline


    That is what its looks like , but it's kind of strange , because forcing chunk resend does not help.
  10. Offline


    @Lexington Then it is effectively blocking that chunk to be sent for some reason. I'll add extra checks in it to fix this, can easily make it update the player location whenever it receives a packet - a lot better IMO.
  11. Offline


    This plugin is great!!
    Nothing lagg on my server now:)
  12. Offline


    @Yoogoo That is great :)

    Re-uploaded NoLaggChunks - it now updates the internally used 'mid chunk' of the player whenever it receives a packet. This to prevent issues with de-synchronization, like teleporting somewhere and nothing can be received.
  13. Offline


  14. Offline


    @Yoogoo ?

    Also, found a nasty bug: please don't enable async saving for now. For some reason it refuses to save chunk 0/ *edit* Ok reuploaded it once again to fix that. (same 1.45 etc)

    Was due to me obtaining the native chunk from the bukkit chunk AFTER it was unloaded.


    Ok think I fixed all errors I found till now. If anyone finds something new, feel free to post.
  15. Offline


    Would it be possible for you, to include a new setting to the config file. I want it to increase or decrease the tickrate the server is trying to sync at. It would be nice to set the server to 25 ticks per second :D or even more.
  16. Offline


    I am afraid this is not easily feasible. Minecraft server is keeping its pulse comparing time delta to a constant, so it is not possible to configure this. But even if you manage to substitute the server, there are (probably) many things that depend on tick being approximately 1/20th of a second.
    Besides, why on Earth would you want it?
  17. Offline


    @bergerkiller Nice! I'll update then. Guess I'll go ahead and start using NoLaggChunks, too. :)

    When I tried to use NoLaggChunks I got an error. I'm disabling NoLaggChunks until you get back to me.

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


    @Chrispm84 that error has nothing to do with NoLaggChunks (it doesn't load or handle loading of chunks and doesn't interact with chunks other than their packets)

    What you have there is a famous native error, I'll figure out a way to fix it using MyWorlds repair command one day. A world got corrupted somehow; could be many things. Maybe the faulty async saving of the previous NoLagg? Even then, it didn't save chunks in a different x/z coordinate, so it prob. has nothing to do with NoLagg or it's saving routine.

    It's a single chunk that kinda went crazy...
  19. Offline


    Version 1.45 uses 100% CPU on empty server. Very strange...
  20. Offline


    @turbonadduv coudld you post the configuration you use? (NoLagg folder \ config.yml)
  21. Offline


    @bergerkiller Lol, sorry I'm tired... I didn't even read the error, just assumed that it was caused by NoLaggChunks. Strange that it occured immediately after installing NoLaggChunks, though. I don't believe in coincidences, :confused:. I'll fix it and try to re-enable NoLaggChunks.


    So, I fixed the corrupted chunk, restarted and got this error...
  22. Offline


    @Chrispm84 TimSort? Lol...that is even more unrelated to NoLagg(Chunks).

    Just a heads-up, the auto-save interval of a world sets the interval in which to save 24 chunks, not all chunks. If you set it to 30 minutes (36000), it will never manage to save all chunks and an alternative world save is required. (manually or using another plugin)

    Adding to that, if you use PTweaks this could now interfere with NoLagg, since both plugins alter the auto-save interval. NoLagg sets it to the maximum value when intervals higher than 400 are used, but PTweaks (which loads afterwards) would set it back to it's own value. This results in unneeded world saves and possibly, write IO exceptions.

    (Sets it to the max value to disable it, since it uses the async auto-save internally)


    After some browsing I found out it has to do with running a java 6 compiled plugin on a java 7 environment. Since Bukkit is also built on java 6, I recommend reverting back to java 6.
  23. Offline


    autoSaveInterval: 40
    explosionRate: 5
    useSpawnLimits: true
    tntDetonationRate: 10
    bufferTNT: true
    bufferItems: true
    useChunkUnloadDelay: false
    updateInterval: 20
    tntDetonationInterval: 1
    chunkUnloadDelay: 10000
    formItemStacks: true
    chunkSendInterval: 5.0
    maxItemsPerChunk: 40
    stackRadius: 1.0
    stackThreshold: 2
    useAsyncChunkSaving: true
    Installed 1.43 version - all is fine with the same config
  24. Offline


    @turbonadduv How does this work out? :
    autoSaveInterval: 600
    explosionRate: 5
    useSpawnLimits: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    bufferTNT: true
    bufferItems: true
    formItemStacks: true
    useChunkUnloadDelay: true
    updateInterval: 20
    chunkUnloadDelay: 5000
    maxItemsPerChunk: 40
    stackRadius: 1.0
    stackThreshold: 2
    useAsyncChunkSaving: true
    Before applying, re-download NoLagg to be sure you got a working version.
  25. Offline


    Hmmm... just reloaded another 1.45 version from that page:

    And problem seems to be gone even with an old config file.

    Old 1.45 version (broken) was downloaded from

    So, that's a little bit strange, that you have many 1.45 versions )

    Anyway, thanks for help!
  26. Offline


    O_O I don't notice much server issues but just saw this pop up on start up.
    13.11 02:51:04 [Server] INFO NoLagg version 1.44 is enabled!
    13.11 02:51:04 [Server] INFO [NoLagg] Auto-save field bound to 'u'!
    13.11 02:51:04 [Server] INFO [NoLagg] Native sync auto-save feature is used instead.
    13.11 02:51:04 [Server] SEVERE     at
    13.11 02:51:04 [Server] SEVERE     at
    13.11 02:51:04 [Server] SEVERE     at net.minecraft.server.MinecraftServer.init(
    13.11 02:51:04 [Server] SEVERE     at net.minecraft.server.MinecraftServer.a(
    13.11 02:51:04 [Server] SEVERE     at net.minecraft.server.MinecraftServer.e(
    13.11 02:51:04 [Server] SEVERE     at org.bukkit.craftbukkit.CraftServer.enablePlugins(
    13.11 02:51:04 [Server] SEVERE     at org.bukkit.craftbukkit.CraftServer.loadPlugin(
    13.11 02:51:04 [Server] SEVERE     at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    13.11 02:51:04 [Server] SEVERE     at
    13.11 02:51:04 [Server] SEVERE     at
    13.11 02:51:04 [Server] SEVERE     at com.bergerkiller.bukkit.nolagg.NoLagg.onEnable(
    13.11 02:51:04 [Server] SEVERE     at com.bergerkiller.bukkit.nolagg.AsyncAutoSave.init(
    13.11 02:51:04 [Server] SEVERE java.lang.Exception: Interval is too low for async auto saving to work. Set the auto save interval in the configuration to a value higher than 400 ticks (20 seconds) to use async auto saving.
    13.11 02:51:04 [Server] WARNING [NoLagg] Failed to initialize async auto saver!
  27. Offline


    "13.11 02:51:04 [Server] SEVERE java.lang.Exception: Interval is too low for async auto saving to work. Set the auto save interval in the configuration to a value higher than 400 ticks (20 seconds) to use async auto saving."

    Change auto save interval
  28. Offline


    ^ probably is what caused the issues on my main server and thus corrupting the world.

    Also I really appreciate all the effort you put into these plugins you alone spend probably more time trying to solve lag issues and stuff the bukkit team simply does not care about. That helps Home servers on at least a 1mbs up connection reach 30 players with no real lag to worry about.

    Note I dont have that many online yet but I will hopefully after the next MC release when I advertise again, I have have 20 online before with minor lag in the past but this work is amazing if it really does what it says it will do I could almost kiss lag goodbye with 20 - 30 player limits.

    Esp with the native cache support in 1.9 that is if notch did not fuck that up. In any case chunks are the main cause of lag on any server if by smoothing the flow and buffering everything else does it job right then us home server can break the 20 player mark with hopefully no issues.

    I can easily see the bigger servers being able to reach 500 player limits now due to the fact it was not bandwidth issues stopping the it it is the absolute rape on CPU and HDD's of players all mining and building and exploring at the same time.

    I defiantly see a future in these plugins helping or eliminating that rapeage of resources.
  29. Offline


    Getting this error after awhile with NoLagg v1.45 + NoLaggChunks (Reuploaded versions I think):

    2011-11-13 20:20:43 [SEVERE] java.lang.IllegalArgumentException: Comparison method violates its general contract!
    2011-11-13 20:20:43 [SEVERE] 	at java.util.TimSort.mergeLo(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.TimSort.mergeAt(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.TimSort.mergeCollapse(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.TimSort.sort(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.TimSort.sort(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.Arrays.sort(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at java.util.Collections.sort(Unknown Source)
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.BufferedChunk.send(
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.PlayerChunkBuffer.send(
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.PlayerChunkBuffer.send(
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.PlayerChunkBuffer.send(
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.PlayerChunkBuffer.sendNext(
    2011-11-13 20:20:43 [SEVERE] 	at com.bergerkiller.bukkit.nolaggchunks.PlayerChunkLoader$
    2011-11-13 20:20:43 [SEVERE] 	at
    2011-11-13 20:20:43 [SEVERE] 	at Source)
    bufferItems: true
    bufferTNT: true
    useSpawnLimits: true
    useChunkUnloadDelay: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    maxItemsPerChunk: 40
    formItemStacks: true
    chunkUnloadDelay: 5000
    autoSaveInterval: 400
    updateInterval: 20
    stackRadius: 1.0
    stackThreshold: 2
    chunkUnloadAsyncSave: true
        mob: 10000
        animal: 2500
        monster: 7500
          mob: 7000
          animal: 2500
          monster: 4500
          mob: 3000
          animal: 0
          mob: 0
          animal: 0
          mob: 0
          animal: 0
    useAsyncChunkSaving: true
    NoLaggChunks: Original

    My CPU usage is also quite high.
  30. Offline


    @mrciku You need to downgrade java; everything is built on Java 6, that error has to do with Java 7.

    I'll look into adding support though, it might work w/o the sorting bit.

    Also, could you log the server and upload it? It does use multithreading now, which could fake having a higher CPU usage. (since multiple cores are now actively used)


    I'll remove the comparison part, it can do without. This should make it work on Java 7 as well.
    Before updating going to add a simple setting for chunks to keep track which to send.
  31. Offline


    Good lol I have same error as above.

    No way I am ever going back to java 6, Java 7 is released now its not beta MC should be supporting it in next update or I will be slightly annoyed.

    7 basically works out of box no tuning needed it boasts overall better performance. I have been using 7 on all of my systems since early beta's with out issues.


    Would "chunkSendInterval: 4" benefit more from this setting or set higher/lower ?

Share This Page