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


    Ah, that's alright then. As long as I'm not being spammed in the console, that would be great. The plugins work just fine otherwise, besides mcbans which sometimes doesn't broadcast the ban. Anyways, appreciate the effort and will wait for the temp download for the other fix.
  3. Offline


    @rtcabooservb you can ignore the errors though. Following configuration:
    - com.cypherx.xauth.xAuth$
    - com.codisimus.plugins.buttonwarp.Warp$
    This will ignore cross-thread access from those events. Do note that ignoring them can result in other errors to occur. (like concurrent modification exceptions)
  4. Offline


    Hmm, I guess I'll just deal with it then and wait for an update for ButtonWarp and MCBans. Thanks for the information though. Any ETA for that temp download? :p
  5. Offline


  6. Offline


  7. Offline


    Having an error on ur latest version, forgot what version I used before this error pop op

    Whenever some Joined this give me the error

    2011-12-17 21:41:30 [INFO] xxxxxxxxx lost connection: disconnect.overflow
    2011-12-17 21:41:30 [INFO] Connection reset
    2011-12-17 21:41:30 [SEVERE] Socket closed
    2011-12-17 21:41:30 [SEVERE]     at Source)
    2011-12-17 21:41:30 [SEVERE]     at Source)
    2011-12-17 21:41:30 [SEVERE]     at Source)
    2011-12-17 21:41:30 [SEVERE]     at Source)
    2011-12-17 21:41:30 [SEVERE]     at Source)
    2011-12-17 21:41:30 [SEVERE]     at
  8. Offline


    I also get disconnect.overflow for very few players every now and then. The question would be if it's caused by too many chunk packets being queued, which would mean your rate adaption thing doesn't work perfectly. But maybe it's just caused by a giant lag on the client's side and 5000 entity move packets being queued...

    Anyways, seeing all these problems here I'm glad your plugin is the only 3rd party plugin I'm using. All the other stuff I need I coded myself, so apparently reinventing the wheel every now and then is not as bad if you know how to do things right and many others don't. I'm using quite a few async tasks and one extra thread, and never got a single concurrent modification exception with any NoLagg version so far.
    So I can just confirm that these problems are not caused by NoLagg, it rather reveals how other plugins are doing illegal object access/method calls across threads.
  9. Offline


    @Borch You can try reducing the minimum send rate, it's possible that the minimum is still too fast for some clients.
  10. Offline


    just updated to 1.53 and this happened on start:

    2011-12-17 18:04:45 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-12-17 18:04:45 [SEVERE] java.util.ConcurrentModificationException
    2011-12-17 18:04:45 [SEVERE] at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
    2011-12-17 18:04:45 [SEVERE] at java.util.HashMap$ Source)
    2011-12-17 18:04:45 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.update(
    2011-12-17 18:04:45 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateAll(
    2011-12-17 18:04:45 [SEVERE] at com.bergerkiller.bukkit.nolagg.NoLagg$
    2011-12-17 18:04:45 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-12-17 18:04:45 [SEVERE] at net.minecraft.server.MinecraftServer.w(
    2011-12-17 18:04:45 [SEVERE] at
    2011-12-17 18:04:45 [SEVERE] at

    and every time i have nolagg on i get this from Showcase:

    2011-12-17 18:04:46 [WARNING] Wrong location for net.minecraft.server.EntityItem@1a3e in world 'Main'!
    2011-12-17 18:04:46 [WARNING] Entity is at 185.5,127.5 (chunk 11,7) but was stored in chunk 11,8
    2011-12-17 18:04:46 [WARNING] Wrong location for net.minecraft.server.EntityItem@1a40 in world 'Main'!
    2011-12-17 18:04:46 [WARNING] Entity is at 207.5,93.5 (chunk 12,5) but was stored in chunk 13,5
    2011-12-17 18:04:46 [WARNING] Wrong location for net.minecraft.server.EntityItem@1a41 in world 'Main'!
    2011-12-17 18:04:46 [WARNING] Entity is at 159.5,107.5 (chunk 9,6) but was stored in chunk 10,6
    2011-12-17 18:04:46 [WARNING] Wrong location for net.minecraft.server.EntityItem@1a42 in world 'Main'!
    2011-12-17 18:04:46 [WARNING] Entity is at 161.5,95.5 (chunk 10,5) but was stored in chunk 10,6
  11. Offline


    @kalez The first one is simply a come this causes the hashmap to be altered? ...
    What other plugins do you run? I suspect another plugin is secretly swapping chunks around, causing the chunk check to fail.

    The second one is kinda impossible to prevent; during auto-saves it saves entities. Since it's async, it is possible that an entity is right in between two chunks, which results in the entity getting stored in the wrong chunk. It's not a serious issue, very mild actually. Already tried my best to get rid of it, sadly there are cases which proof pretty hard to do. (I could go and clone the chicken entity, but this can cause the chicken to be stored twice, resulting in that duplicate animal issue like before)

    It's also possible to obtain the data before saving and write the data on the thread. I guess this is the best alternative.
  12. Offline


    Yeah its not a horrible issue, but the items that are having the problem are not visable and it spams the log with those messages like crazy! /showcase reload seems to clear it up, but then the same one or another one, sooner or later, occurs again. Sucks cause i love NoLagg and Showcase to death.
  13. Hello, I was hoping you could assist me with the installation of NoLagg, my friend has a server and it doesn't lag at all on his end, but when I try to play I have an assortment of issues, usually taking a minute after attempting to do something before the action is actually carried out, such as when I type a message and press enter, it won't appear until a minute or two later. I'm sure it needs to go into his server files folder in some way or form, but exactly how we do not know. If you could give me instructions, I could pass them on to him. Thank you.
  14. Offline


    @SlothTheIndolent First download, then open this .zip file using an archive opening program. Windows comes with one too, if needed you can use alternatives like WinZip/WinRar/7Zip.

    Inside you'll find 'NoLagg.jar' and the 'NoLagg' folder. Place both in the 'plugins' folder of your server. Then simply launch the server. Using /nolagg monitor you can review the chunk sending rate set for you. Even then, if it takes too long to send chunks, it might lag for you while you receive chunks. (I still need to review the chunk sending rate calculations, since the queue size remained low while he still had some lag)
  15. Offline


    2011-12-18 00:56:00 [SEVERE] Could not pass event PLAYER_KICK to NoLagg
    at com.all.bukkit.threadcheck.ThreadCheck.check(
    at com.all.bukkit.threadcheck.PlayerListener.onPlayerKick(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at net.minecraft.server.NetServerHandler.disconnect(
    at org.getspout.spout.SpoutNetServerHandler.disconnect(
    at org.bukkit.craftbukkit.entity.CraftPlayer.kickPlayer(
    at com.mcbans.firestar.mcbans.pluginInterface.Ban.localBan(
    When a user is kicked.
    Checked with spout and mcbans team on irc they seem to think it's you. :p
  16. Offline


    @Jadedwolf lol even if the check causes an NPE, it first has to run into a cross-thread issue anyway. Tell them they need to fix their multi-threading issues first :)
    (if it's on the main thread the check error code generation doesn't even occur)

    Also, update NoLagg, you got an NPE at an 'else' statement? xd

    @Sepulzera must be the mob tracker cleanup bit, I'll scrap that part. It's probably causing that. Added to to prevent 'fetching packet for dead entity' errors..but they still occur regardless.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Nov 10, 2018
  17. Offline


    I'll do that, thank you. :)
  18. Offline


    Bukkit: 1597
    NoLagg: v1.53
    2011-12-18 03:05:16 [SEVERECould not pass event PLAYER_KICK to NoLagg
    .lang.IllegalAccessErrorSynchronized code got accessed from another threadcom.cypherx.xauth.xAuth$1
        at org
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at net.minecraft.server.NetServerHandler.disconnect(
    at org.bukkit.craftbukkit.entity.CraftPlayer.kickPlayer(
    at com.cypherx.xauth.xAuth$
    2011-12-18 03:05:16 [SEVEREException in thread "Thread-2527"
    2011-12-18 03:05:16 [SEVEREjava.lang.IllegalAccessErrorSynchronized code got accessed from another threadcom.cypherx.xauth.xAuth$1
    -12-18 03:05:16 [SEVERE]     at com.all.bukkit.threadcheck.ThreadCheck.check(
    2011-12-18 03:05:16 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.remove(
    2011-12-18 03:05:16 [SEVERE]     at net.minecraft.server.PlayerInstance.b(
    2011-12-18 03:05:16 [SEVERE]     at net.minecraft.server.PlayerManager.removePlayer(
    2011-12-18 03:05:16 [SEVERE]     at net.minecraft.server.ServerConfigurationManager.disconnect(
    2011-12-18 03:05:16 [SEVERE]     at net.minecraft.server.NetServerHandler.disconnect(
    2011-12-18 03:05:16 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftPlayer.kickPlayer(
    2011-12-18 03:05:16 [SEVERE]     at com.cypherx.xauth.xAuth$
    2011-12-18 03:05:16 [SEVERE]     at
    2011-12-18 03:05:18 [ closed
    -12-18 03:05:18 [INFOConnection reset
    -12-18 03:05:18 [SEVERE]     at
    2011-12-18 03:05:18 [SEVERE]     at
    2011-12-18 03:05:18 [SEVERE]     at
    2011-12-18 03:05:18 [SEVERE]     at
    2011-12-18 03:05:18 [SEVERE]     at
    2011-12-18 03:05:18 [SEVERE]     at
  19. Offline


    If you read up just a few posts you can see that this has already been discussed. :p
  20. Offline


    @Adrenaline And also in the FAQ. Add the following in the configuration:
  21. Offline


  22. Offline


  23. Offline


    how can I fix this?

    14:05:03 [SEVERE] [NoLagg] An error occured while sending chunks:
    14:05:03 [SEVERE] java.util.NoSuchElementException
    14:05:03 [SEVERE]       at java.util.LinkedList$
    14:05:03 [SEVERE]       at java.util.Collections.sort(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.update(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.update(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.access$1(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue$1$1.handle(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue$Operation.execute(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue$Operation.execute(
    14:05:03 [SEVERE]       at
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.access$2(
    14:05:03 [SEVERE]       at com.bergerkiller.bukkit.nolagg.ChunkSendQueue$
    14:05:03 [SEVERE]       at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    14:05:03 [SEVERE]       at net.minecraft.server.MinecraftServer.w(
    14:05:03 [SEVERE]       at
    14:05:03 [SEVERE]       at
    14:05:03 [SEVERE] java.lang.NullPointerException
    14:05:03 [SEVERE]       at net.minecraft.server.Entity.move(
    14:05:03 [SEVERE]       at net.minecraft.server.EntityLiving.a(
    14:05:03 [SEVERE]       at net.minecraft.server.EntityLiving.d(
    14:05:03 [SEVERE]       at net.minecraft.server.EntityMonster.d(
    14:05:03 [SEVERE]       at net.minecraft.server.EntitySkeleton.d(
    14:05:03 [SEVERE]       at net.minecraft.server.EntityLiving.w_(
    14:05:03 [SEVERE]       at net.minecraft.server.EntityMonster.w_(
    14:05:03 [SEVERE]       at net.minecraft.server.World.entityJoinedWorld(
    14:05:03 [SEVERE]       at net.minecraft.server.WorldServer.entityJoinedWorld(
    14:05:03 [SEVERE]       at net.minecraft.server.World.playerJoinedWorld(
    14:05:03 [SEVERE]       at net.minecraft.server.World.tickEntities(
    14:05:03 [SEVERE]       at net.minecraft.server.MinecraftServer.w(
    14:05:03 [SEVERE]       at
    14:05:03 [SEVERE]       at
    14:05:03 [SEVERE] Unexpected exception
            at net.minecraft.server.Entity.move(
            at net.minecraft.server.EntityLiving.a(
            at net.minecraft.server.EntityLiving.d(
            at net.minecraft.server.EntityMonster.d(
            at net.minecraft.server.EntitySkeleton.d(
            at net.minecraft.server.EntityLiving.w_(
            at net.minecraft.server.EntityMonster.w_(
            at net.minecraft.server.World.entityJoinedWorld(
            at net.minecraft.server.WorldServer.entityJoinedWorld(
            at net.minecraft.server.World.playerJoinedWorld(
            at net.minecraft.server.World.tickEntities(
            at net.minecraft.server.MinecraftServer.w(
    14:05:46 [INFO] Connection reset
  24. Offline


    @beleg What other plugins do you use? Another plugin is removing a player from the world from another thread.
  25. Offline


    maybe homespawnplus or multiverse? but I think it was xAuth :/
  26. Offline


    @beleg yup it's probably xAuth, if it also kicks players from another thread that is. Nothing I can do about if sadly, cross-thread issues in other plugins are not my concern. :/
  27. Offline


    I guess its not continued so you could take it up and fix these issues with your epic skills :)
    (Please continue xAuth)
  28. Offline


    @beleg I got more than enough work and pending tasks right now, if I had time for it I would do it, but then I could revive pretty much every plugin lol. Same applies to MCbans...
  29. Offline


    yes, but I think if you would fix xAuth you dont have to do that much for noLagg (just guessing) and I would Love you =)
  30. Offline


    @beleg Yes, but don't forget I end up managing the 'fixed' version too, and 70% of plugin development is maintaining it. (reading stacktraces of people). And believe me, soon people will request all sorts of things now someone is developing it.
  31. Offline


    ok I understand this :/ I still love you.. If someone read this: Continue xAuth please :)

Share This Page