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


    Oh, I deleted my post before you replied because I was pretty sure I just messed something up, haha.

    2012-01-10 19:09:37 [SEVERE] [NoLagg] An error occured while sending chunks:
    2012-01-10 19:09:37 [SEVERE] java.util.NoSuchElementException
    2012-01-10 19:09:37 [SEVERE]     at java.util.LinkedList.remove(
    2012-01-10 19:09:37 [SEVERE]     at java.util.LinkedList.removeFirst(
    2012-01-10 19:09:37 [SEVERE]     at java.util.LinkedList.poll(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.datapool.Pool.create(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.BufferedPacket51MapChunk.<init>(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkHandler.sendChunk(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.sendFirst(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.update(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.update(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.access$0(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1.handle(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$Operation.execute(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$Operation.execute(
    2012-01-10 19:09:37 [SEVERE]     at
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue.updateAll(
    2012-01-10 19:09:37 [SEVERE]     at com.bergerkiller.bukkit.nolagg.NoLagg$
    2012-01-10 19:09:37 [SEVERE]     at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2012-01-10 19:09:37 [SEVERE]     at net.minecraft.server.MinecraftServer.w(
    2012-01-10 19:09:37 [SEVERE]     at
    2012-01-10 19:09:37 [SEVERE]     at
  3. Offline


    Also, I found out a way to boost world editing tools: temporarily stop world physics. It then no longer performs block physics on every block that gets changed, greatly improving performance. But, never jump to conclusions, so time to do some tests first.
  4. Offline


    Was told to contact you so uhhh here:

    2012-01-10 20:15:47 [WARNING] Could not properly handle event CHUNK_LOAD:
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: com.bergerkiller.bukkit.nolagg.StackFormer
        at org.bukkit.plugin.RegisteredListener.callEvent(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at net.minecraft.server.ChunkProviderServer.getChunkAt(
        at org.bukkit.craftbukkit.CraftWorld.getChunkAt(
        at com.bergerkiller.bukkit.nolagg.meta.ChunkMetaData.getChunk(
        at com.bergerkiller.bukkit.nolagg.meta.ChunkMetaData.getNativeChunk(
        at com.bergerkiller.bukkit.nolagg.meta.ChunkMetaData.add(
        at com.bergerkiller.bukkit.nolagg.meta.ChunkMetaData.<init>(
        at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.getChunk(
        at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.getChunk(
        at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.removeSpawnedItem(
        at com.bergerkiller.bukkit.nolagg.WorldStackFormer.kill(
        at com.bergerkiller.bukkit.nolagg.WorldStackFormer.updateItems(
        at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateStackFormingAsync(
    2012-01-10 20:15:47 [INFO] This error is logged only once: it could have occurred multiple times by now.
    2012-01-10 20:15:47 [INFO] Please contact one of the authors of plugin 'NoLagg': bergerkiller
  5. Offline


    @josip1 Update to the newer NoLagg build, it fixes that.
  6. Offline


    Memory usage seems to steadily rise. It was at 50 mb and after a while of playing, it steadily rose. Now it's at 160 mb, and I'm the only player online. Does it have to do with me using ChunkManager instead of the built-in chunk sender?
  7. Offline


    @sagethor possibly, chunk packet buffering is not used if internal chunk sending is not used. Note that other internal components will always increase RAM, and it's impossible to prevent that. (so the RAM memory will always steadily rise, the difference is in how fast this is)
  8. Offline


    @bergerkiller Here's the part that confuses me, though. Using /nolagg gc clears out the memory back to 50 mb, yet the built in java GC has barely any effect.

    I guess I'll try switching to the built in chunksend and report any problems with it in the future, thanks.
  9. Offline


    @sagethor There are multiple types of garbage collections performed, all based on the strength of the variable. When I perform a custom gc command, it throws in all power and tries as hard as possible to find dead variables, while the regular routine will only get rid of variables that are easily spotted. It's even possible that it doesn't search the entire memory, but only a smaller section of it.
  10. Offline


    You don't really have a problem if the memory growth can be freed in GC, but if it rose and wasn't garbage collectable then that would mean that something is leaking ram, and if it goes on long enough it would crash the server with a "java.lang.OutOfMemoryError: Java heap space" error, or freeze in GC as java only has a set amount of memory(by the startup memory flags.) it can use.
  11. Offline


    Updated it to fix the error mentioned by @PinguinAman . Also added 'physics disabling and re-enabling when the tick rate becomes too low'. It can be turned on and off in the configuration. Opinions on this are welcome, as I don't see a real purpose in it for now...hardly reduces processing time with 0,5 sec.

    *updated to version 1.56.1
  12. Offline


    Don't see it yet on the github. Still 1.56.1.
  13. Offline


    Dont see it either.
  14. Offline


  15. Offline


    I don't see the physics on/off in the configuration of 1.56.1
  16. Offline



    Please return the old (1.52.1) spawnlimits behavior. 1.52.1 let me set mob limits WHILE still allowing plugins spawnmob commands to work. Any version ABOVE 1.52.1 have the problems I already described in this thread.
  17. Offline


    Error spammed is this
        at com.bergerkiller.bukkit.nolagg.NLBlockListener.fixColumn(
    The also appears as .java66 and other numbers

    I used Notepad++ just now to do a count on the above code paste it appears over 17000 times. I made it do this error only twice ;.
    I also said it only happens on with worlds generated with the generator bSpace prev I have had no issues on non RB build of 1.0.

    I don't know if want to see for your self if it does it for you or not.
    Just in-case you do I also included the exact config I used to test a brand new world with it and it did the same thing, prev prior to upgrading to bSpace v2 I only got a server lockup with high cpu usage no errors but now it is showing what I showed you on crash. Oh and when u generate a world generate it with, /world create space:bSpace:paranoid.

    Hmm bukkit damn you why you love : P as :p and I did increase the stacksize before I came here.
    "C:\Program Files\Java\jre7\bin\java.exe" -Djline.terminal=jline.UnsupportedTerminal -server -Xms100M -Xmx3G -Xss20M -jar craftbukkit-1.0.1-R2.jar nogui -d "yyyy-MM-dd HH:mm:ss" 
    -Xss is the stacksize parameter, and your removing the mob limit why ? I love that feature its part of why I run this.

    Can I still limit mobs in myworlds after your change, how will I limite max mob counts per world ?


    Attached Files:

  18. Offline


    Test with NoLagg (all normal plugins), With Out (all normal plugins), and With (no other plugins).

    All enchanted items inside chests/on ground lose their enchantments.
    When restarting the server it happens every time.
    When disconnecting/relogging/unloading chunks. Happens sometimes. Probably in memory still.

    CB RB 1596
  19. Offline


    @silentdojo Interesting...but then where is it failing? When writing the item stack data to the nbt tag compound for saving, or during one of the smaller routines that are performed before all that? I am not what it is, as it can be many things, but I'll do some enchantments tests on my server as well.

    @ledhead900 I am pretty sure I replaced the recursive function with a while loop and added bedrock-level checks in the later versions, what NoLagg version did you use?

    @spunkiie It's more of a Bukkit bug than a NoLagg bug, the spawn event got screwed over.

    @Krunch only happens when the tick rate drops dramatically (the time can be set in the configuration also). When it enabled/disables can be seen in the server log.


    Enchantments bug found, code checked and removed with pliers. A simple case of the server using my buffered tags (which were only meant for loading data) as their own.

    Uploaded 1.56.3 (1.56.2 failed horribly due to GitHub being an ass again), it fixes the enchantments bug.

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

    If i install NoLagg plugin, start server after i got error.
    then i remove this plugin, start server its happened again!
    Before did not install NoLagg plugin, it working fine.

    I was installed a lot minecraft mods:
    Industrial Craft2 1.43b r2
    RedPower 2.0p4c
    Buildcraft 2.2.11 r3
    Buildcraft ic2 Crossover 1.14b
    Charging Bench 1.42
    Crafting TableII 1.5
    IC2 Advanced Machines 3.0
    Multi-Page Chest 1.0.6
    Nether Ores 1.1.0
    IC2 Solar helmet 2.5
    Buildcraft Additional Pipes 31.4
    Power Converters 1.3.0
    my english is not good.

    CB 1597

    Could you help me?
  21. Offline


    @mindcat wish I knew what it was, but it looks like the saved data got a non-existent 'bit' the mod needs but not gets. Contact the author of the 'BuildCraft' server/client mod and show him this stack trace:
        at buildcraft.transport.BlockGenericPipe.createPipe(
        at buildcraft.transport.TileGenericPipe.a(
        at net.minecraft.server.TileEntity.c(
        at net.minecraft.server.ChunkLoader.a(SourceFile:203)
        at net.minecraft.server.ChunkRegionLoader.a(SourceFile:66)
        at net.minecraft.server.ChunkProviderServer.loadChunk(
        at net.minecraft.server.ChunkProviderServer.getChunkAt(
        at net.minecraft.server.MinecraftServer.a(
        at net.minecraft.server.MinecraftServer.init(
    I do notice that the chunk loader is involved, it could be one of those faulty list nbt tag compounds that were in version 1.56.1...
    Nevertheless, developers have to properly handle exceptions at all times, especially when validating loaded data.
  22. Offline



    I've just tested the spawnlimit issue better.

    The latest version that DOES NOT have the bug is: 1.53.4
    Any version above that has the bug.

    The bug:
    When you disable mobs in nolagg config.yml, you normally could still spawn with CommandBook /spawnmob command. Not anymore with versions above 1.53.4. (the mob spawn, then vanish after 1 second)

    So, please if possible return the spawnlimits from 1.53.4 behavior. I hate keep using old NoLagg versions due to this :(
  23. Offline


    I'd appreciate if you could respond to a few questions I have before I start using this:
    Does this plugin work fine with SimpleSave? (A Autosave plugin)
    Does this plugin work fine with Spout? (Spout-enforced server)
    Will the mob limiter kill off mobs that go over that or just prevent them from spawning? I'd hate to have my players farms/barns get killed off.

    Thank you.
  24. Offline


    Can you implement anti x-ray into this?
  25. Offline


    @Puremin0rez right now it kills off entities, I'm working (or will eventually work on) a custom mob spawning system where I can control the amounts better.

    It won't conflict with auto-save plugins in any way, as it follows the guidelines of regular saving internally.

    Not sure about Spout, it did work the last time I checked. I also added compatibility to override Spouts chunk sending system.

    @Helladen I can't see how the standard anti-xray plugin is not compatible with NoLagg...or does he use class.equals instead of instanceof...

    @spunkiie I can't get that back, since it broke inside Bukkit, not NoLagg. Nothing got changed in the custom spawn ignore coding, the spawn event simply never gets called, so I can't know what mobs were spawned custom.
  26. Offline


    I will try it, wasn't sure if it was compatible. :p
  27. Offline


    Does this plugin play nice with anti-xray plugins? Would I need to turn off chunk sending of nolagg?
  28. Offline


    @rubberducky2277 It does not alter the packet chunk data and uses the same methods native coding used previously, in other words, all it does is add a little bit of coding before sending. Anti-xray plugins should be able to handle these packets with ease, and the data pools have in mind that the data may not be freed correctly, and thus uses weak references to clear them then as well.

    The only reason it had an issue (a long time ago) with anti-xray plugins is that I used CompressionThread.queue instead of netserverhandler.sendPacket, but that has been fixed a loooong time ago.
  29. Offline


  30. Offline


    I'm confused what do you mean. I use version 54.x or 53.x not sure what one.

    Also Space world has no bedrock at all in it at normal bedrock layers, I originally thought it may have been a deep level bug but it can't be if it was working in development builds of bukkit 1.0.

    Honestly all I know is what I have told you thus far, It lockups after some amount of time when building things and in the newer bSpace and increased stacksize it shows the error as as it locks up entire server.

    I thought it may have been a bad corrupt map I ran checks on them and I rebuilt space world as a brand new generated world. I am out of ideas other than to pin it on bukkit bugs or plugins, I will test it again with No plugins installed and then try just spout and this see what happens.

    Also I don't fully agree with the mobs being removed from nolagg but whatever, I rely on it heavily.

    Did you check the plugin to see if you had the same issue on reco build of bukkit or on one of the R2 builds?
  31. Offline


    MAJOR issue for modded servers,
    with your mod all forestry blocks like electric engines and farms, lose thier damage values, so you come back and instead of it being a 210:7 its a 210 ...electric engine becomes biogas engine becomes arbertum

    with out this plugin it doesnt happen BUT when a quarry goes wrong we lag (multiple items everywhere)
    i tried this in the config but still no go :(

    # Sets if and how many items are buffered per chunk
    bufferItems: true
    maxItemsPerChunk: 40
    bufferTNT: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    useSpawnLimits: true
        mob: 1000
      global: {}
      worlds: {}
    useChunkUnloadDelay: false
    chunkUnloadDelay: 10000
    formItemStacks: true
    stackRadius: 3.0
    stackThreshold: 2
    autoSaveInterval: 400
    updateInterval: 20
    monitorInterval: 40
    autoFixLighting: false
      enabled: false
      minRate: 0.25
      maxRate: 2.0
      boost: 25
    bufferGarbageCollectInterval: 10000
    could you buffer blocks damage values for unknown blocks too, that should fix the issue

    other then the identity crises forestry suffers with this plugin , fantastic work

Share This Page