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. I use spout recommended build.
    I use nolagg 1.52.8.
    I use CB 1597
    The player dont use spoutcraft.

    This is the error (IS VERY BIG I UPLOAD A FILE)
  3. Offline


    Ok spotted that thread check error. (forgot a ! before a boolean when checking if the previous error list had to be updated)

    Now looking at the concurrency issues.
  4. Offline


    what this means chunkUnloadDelay ????
  5. Offline


    @michbom When a player walks around in a world, it loads and unloads chunks. Instead of instantly unloading the chunk when it gets out of view, it will wait out the delay and then unload it. This ensures that commonly visited chunks are not unloaded and then loaded again. (this gets rid of the compression and read/writing steps, reducing CPU and disk usage)
  6. Offline


    1.0.0-Release of CB
    1.52.8 of NoLagg produced TONS of errors INSTANTLY.
    1.52.7 gives me this. Caused by a NoLagg-Xauth confliction.

    2011-12-16 19:08:52 [SEVERE] Could not pass event PLAYER_TELEPORT to NoLagg
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: java.lang.Thread
        at Source)
        at com.cypherx.xauth.xAuth$
        at org.bukkit.craftbukkit.entity.CraftEntity.teleport(
        at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at org.bukkit.event.PlayerListener.onPlayerTeleport(PlayerListener:0)
  7. Offline


    Updated once again. Now actually remembers the xauth exception in the configuration and yet another desperate concurrent mod. exception prevention change in the World meta data. If you run Java 7, please try it now, and post any errors you may be getting.

    - Fixed NPE in check thread
    - Now correctly shows the thread that causes a cross-thread issue (no longer shows java.lang.Thread)

    @NotYetRated remove the Thread exceptions in the configuration, update NOlagg and then try again. The XAuth except node is there by default.
    GameFAQsRolo likes this.
  8. Offline


    Hey Guy,
    if a User login i get following error:

    2011-12-16 20:35:05 [INFO] xxxx [/] logged in with entity id 21419 at ([Freebuildi] 24698.515014553468, 81.0, 24978.273955197797)
    2011-12-16 20:35:06 [SEVERE] Could not pass event PLAYER_TELEPORT to NoLagg

    Since i updated to the newest version, how can i fix it?
  9. Offline


    @SilencShadoW remaining error? (a.k.a. stacktrace?) ( Ugh not another NPE, I thought I dealt with those in 1.52.9 -.- )
  10. Offline


    Nothing, this was the full error =D ... i dont understand why there is no more trash .... but ... this was all =D rest is my chat :p or commands executed ... normal log .....

    AT server start i got following error:

    2011-12-16 20:30:34 [SEVERE] Could not pass event PLAYER_TELEPORT to NoLagg
    at com.all.bukkit.threadcheck.ThreadCheck.check(
    at com.all.bukkit.threadcheck.PlayerListener.onPlayerTeleport(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(
    at org.bukkit.craftbukkit.entity.CraftEntity.teleport(
    at com.cypherx.xauth.xAuth$

  11. Offline


    @SilencShadoW You definitely need to update NoLagg to 1.52.9 now, because at line 118 is a comment xd
  12. Offline


    What do you mean? i updated to the newest ... 1.52.8 :eek:
  13. don update it cause a lot of problem use 1.52.6
  14. Offline


  15. Offline


    Give me the link of 1.52.9 o.o
  16. Offline


  17. Offline


    Yay fixed :) I realy love your plugin! your the best =D

    Can you implement some timed world save and inventory save?
  18. Ok i use now 1.52.9 and havent got problems.

    bergerkiller likes this.
  19. Offline


    @vicente947 ... which are? Or did you forget a no xd
  20. Offline


    Your newer versions skip the death-animations of mobs sometimes.
  21. Offline


    @bergerkiller I'm getting errors with nolagg. "Could not pass event PLAYER_TELEPORT to NoLagg". Something to do with synchronized code got accessed from another thread, blablabla. It is an issue when players teleport with the plugin called buttonwarp. Also get a spawn chunk error when I use the plugin orebfuscator when teleporting between a second world such as the nether.

    @bergerkiller So many issues with 1.52.9 :(! Using CB 1602, spout 645.

    2011-12-16 18:48:11 [SEVERE] Could not pass event PLAYER_KICK to NoLagg
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: com.mcbans.firestar.mcbans.pluginInterface.Ban
        at org.bukkit.event.player.PlayerListener.onPlayerKick(PlayerListener:0)
        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(
    2011-12-16 18:48:11 [SEVERE] Exception in thread "Thread-1876"
    2011-12-16 18:48:11 [SEVERE] java.lang.IllegalAccessError: Synchronized code got accessed from another thread: com.mcbans.firestar.mcbans.pluginInterface.Ban
    2011-12-16 18:48:11 [SEVERE]     at com.all.bukkit.threadcheck.ThreadCheck.check(
    2011-12-16 18:48:11 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkSendQueue.remove(
    2011-12-16 18:48:11 [SEVERE]     at net.minecraft.server.PlayerInstance.b(
    2011-12-16 18:48:11 [SEVERE]     at net.minecraft.server.PlayerManager.removePlayer(
    2011-12-16 18:48:11 [SEVERE]     at net.minecraft.server.ServerConfigurationManager.disconnect(
    2011-12-16 18:48:11 [SEVERE]     at net.minecraft.server.NetServerHandler.disconnect(
    2011-12-16 18:48:11 [SEVERE]     at org.getspout.spout.SpoutNetServerHandler.disconnect(
    2011-12-16 18:48:11 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftPlayer.kickPlayer(
    2011-12-16 18:48:11 [SEVERE]     at com.mcbans.firestar.mcbans.pluginInterface.Ban.localBan(
    2011-12-16 18:48:11 [SEVERE]     at
    2011-12-16 18:36:48 [SEVERE] Could not pass event PLAYER_TELEPORT to NoLagg
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: com.codisimus.plugins.buttonwarp.Warp$1
        at org.bukkit.event.player.PlayerListener.onPlayerTeleport(PlayerListener:0)
        at org.bukkit.plugin.RegisteredListener.callEvent(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(
        at org.bukkit.craftbukkit.entity.CraftEntity.teleport(
        at com.codisimus.plugins.buttonwarp.Warp$
    Edit: Just want to note that I never had this error before prior to the 1.52.6 update. The orebfuscator always had the spawn chunk error with nolagg when teleporting between worlds.

    Edit2: Also want to note I'm using mcbans.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  22. i havent got problems use CB 1597 is the recommended
  23. Offline



    instantly upon restart, over and over and over
    2011-12-17 06:00:16 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-12-17 06:00:16 [SEVERE] java.util.ConcurrentModificationException
    2011-12-17 06:00:16 [SEVERE] at java.util.HashMap$HashIterator.remove(Unknown Source)
    2011-12-17 06:00:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateChunks(
    2011-12-17 06:00:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.update(
    2011-12-17 06:00:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateAll(
    2011-12-17 06:00:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.NoLagg$
    2011-12-17 06:00:16 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-12-17 06:00:16 [SEVERE] at net.minecraft.server.MinecraftServer.w(
    2011-12-17 06:00:16 [SEVERE] at
    2011-12-17 06:00:16 [SEVERE] at
    2011-12-17 06:00:19 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-12-17 06:00:19 [SEVERE] java.util.ConcurrentModificationException
    2011-12-17 06:00:19 [SEVERE] at java.util.HashMap$HashIterator.remove(Unknown Source)
    2011-12-17 06:00:19 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateChunks(
    2011-12-17 06:00:19 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.update(
    2011-12-17 06:00:19 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateAll(
    2011-12-17 06:00:19 [SEVERE] at com.bergerkiller.bukkit.nolagg.NoLagg$
    2011-12-17 06:00:19 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-12-17 06:00:19 [SEVERE] at net.minecraft.server.MinecraftServer.w(
    2011-12-17 06:00:19 [SEVERE] at
    2011-12-17 06:00:19 [SEVERE] at
    2011-12-17 06:00:19 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-12-17 06:00:19 [SEVERE] java.util.ConcurrentModificationException
  24. Offline


    @kalez Ok that's it, time for a different approach in that function. No idea why some servers have issues with it, but that's just Java...

    @rtcabooservb Huray two other plugins that misbehave. I'll contact them about it.

    Also, I am so happy I introduced the cross-thread check for the events. It finally reveals why so many people had concurrency exceptions all the time. Especially the PLAYER_KICK event is quite a shock, since it removes a player from the player list - async!
  25. Offline


    Soon as possible, if it could be updated, I would very much appreciate it. Not sure if you have to update it on your side or they have to remove the thread checks on their side.
  26. Offline


    Would FalseBook be another that misbehaves?

    06:05:36 [WARNING] Task of 'FalseBookBlock' generated an exception
            at java.util.AbstractList$Itr.checkForComodification(
            at java.util.AbstractList$
            at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
            at net.minecraft.server.MinecraftServer.w(
  27. Offline


    @silentdojo Mmmh I didn't add synchronized checks for the block listener..oops
    Well it's possible that another plugin causes block events too. (but do prepare for a lot of spam caused by 'newbie' plugin developers...
  28. Offline


    If you plan on adding the checks, how long do you think it'll be before the update is available?
  29. Offline


    @rtcabooservb Already finished here. Also, looked at FalseBooks source code.
    Only possiblitity for it to crash:
    - onBlockRedstoneChange gets called from another thread
    This because he adds an element to queuedEvents outside the synchronized body. The task that executes these events is synchronized, so no problem there. I'll upload a temp. version with the checks shortly.
                if(block.getTypeId() != Material.WALL_SIGN.getId() && block.getTypeId() != Material.SIGN_POST.getId())
                        break label0;
            queuedEventsPos.put(block.getLocation().toString(), Integer.valueOf(0));
            queuedEvents.add(new QueuedExecutionEvent(plugin, block, event.getBlock().getLocation()));
    Fired multiple times after the onBlockRedstoneChange event.
  30. Offline


    Awesome. I'll just wait for the temp version to be uploaded before I update my server, and if you could look into the plugins ButtonWarp and McBans for the on player_move and player kick, that would be great.
  31. Offline


    @rtcabooservb I can't fix those issues: I can only catch them and log and stop them from being executed. Fixing it is up to MCBans and ButtonWarp, whome I already contacted.

Share This Page