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


    How sure u are that the new Version works? :D can u maybe post the "changelog" ? I dont see changes on my map yet, on 1.57 i saw instant damage on chunks on the server, everytime the same chunks ... :eek: now its gone, i hope forever and not only i need to find the dmg'ed areas ... :S

    Can u implement Orebfuscator support?

    Edit: Found a Corrupted Chunk ... >_> but less then last, just a regen with a bit water, and less corrupted chunks and it took longer after it appears ... but same area like everytime -.-
  3. Offline


    @SilencShadoW :(
    Then this isn't actual timing...for the record, did you have issues with this in the previous version with this feature? (v1.56.5)


    I'll see if I can add support for the Spout packet listener.
    (I suppose you use Spout?)
  4. Offline


    So 1.57.2 corrupts as well?
  5. Offline


    Yay, i use spout

    1.56.5 worked well ... but 1.57 is my apocalypse xD ... u mean the feature with orebfu? worked on 1.56.5 without edit the chunk sending

    but the main thread is ... 1.57.2 corrupte the map too :(
  6. Offline


    uhhh I am getting random nether chunks in my overworld >.> probably shoulda read the info b4 udpating i guess
  7. Offline


    Thanks for the update. I'm removing nolaggs then until it is 100% confirmed that it won't corrupt chunks anymore.
  8. Offline


    i dont want it too, but if noone test ... it cant be confirmed :) so i warn my user that i test at 00:00 and backup my worlds .. thats all
  9. Offline


    I now do notice some messages like 'entity at wrong location' in the log, but somehow the physical chunk is always correctly displayed to me. I'll compare 1.56.5 with 1.57.2 and see what the main differences are.

    It could possibly be the internal saving queue, but I already checked that source code line by line...and no chunk data is getting overwritten...
  10. Offline


    But anything must be wrong ... ^^ the messages i got too :p
  11. Offline



    I had to do an 8 hour rollback today. It was destroying my world. I have disabled/removed NoLagg till this is resolved.
  12. Offline


    Mmmh I THINK that I found out what is going on.

    When you monitor using NoLagg, do you see a green (GC) very often? On my server this is not the case.

    I found out that, if the garbage collector runs VERY often, it can cause a data pool to get cleared right before the origin method force-clears it. This causes the pool to be closed from the old object when it got assigned a new object, which causes the new object pool data to become free while still in use.

    Added a check in the data pool buffer to check if the current reference equals the caller, and only clear if this is the case. First need to check if this is actually the issue.


    If truly a lot of chunks have to be saved (3000+) this can indefinitely cause this issue. I hardly save 20 chunks at a time...

    @SilencShadoW I'll add a simple chunk copy and paste tool for you.
    (copies/pastes to where you are)

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


    plz reply if u uploaded a fix, ill try, with flymod speedhack to generate max chunks :eek: if u think this is the problem ... :)
  14. Offline


    @SilencShadoW well not really, what I think is that the chunk information is set free too soon because of way too many garbage collect calls...

    Actually, I doubt this can be the problem, since the buffered chunk sits in a map while it waits for it can't get garbage collected at all...


    Uploaded, added the pool check + a flush statement. (I have no idea, but a flush before closing the stream fixed it previously)
  15. Offline


    Ill test it tomorrow just give me reply if its updated..
  16. Offline


  17. Offline


    AWESOME :D u implemented a Worldedit Copy function? ... Like everytime ... the SAME Spot. now with a building of a other region :D @Corrupted ... :(
  18. Offline


    it was a sarcasm ... :( now no new chunks are generated, old get copied ... to the same spot like the old regenerated :(
  19. Offline


    @SilencShadoW Ok now I'm truly getting confused...all I did was adding a check and a stream flush...and all the flush does is write out all data to file. Do you get anything in the log? Like a 'relocating' or similar?

    Btw: post/update your plugin list, there has to be some sort of clash somewhere...
    Configuration can be useful as well.
  20. Offline


    maybe u want to see something like this? :D

    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@420215d9) at 7066,62,-11677 (SAND) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@16e87b6a) at 7068,63,-11673 (AIR) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@78fe77e5) at 7061,63,-11676 (DIRT) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@a719972) at 7071,62,-11677 (STATIONARY_WATER) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@281110b9) at 7066,64,-11676 (SAND) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@7860f63b) at 7073,63,-11678 (AIR) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@25c5d93b) at 7076,63,-11676 (AIR) where there was no entity tile!
    2012-01-15 01:15:19 [INFO] Attempted to place a tile entity (net.minecraft.server.TileEntitySign@6038c3dc) at 7072,64,-11676 (AIR) where there was no entity tile!
    only chunk errors in my log between the start and bug.
  21. Offline


    Ok I figured it out. SPOUT is the one messing things up. Somewhere spout is also re-using chunks, and this heavily clashes with NoLagg's. @SilencShadoW Could you disable Spout and only run NoLagg ,and check if that works out?

    As soon as I added Spout to the mix I saw chunks scramble eeeeerywhere.
  22. Offline


    I still get errors when running on my server, it works fine compiling but when I log-in the map isn't loading at all. It is mass erroring and displaying like star looking shapes around my character.
  23. Offline


    do you got teamspeak or something? would be nice to speak a bit ... :S
  24. Offline


    @Helladen If you use NoLagg, disable the buffered chunk loader (very important until this is resolved)
    Also, you may need a different version, fi you use CB#1597, use NoLagg 1.56.6. But, still disable buffered chunk loading.

    @SilencShadoW Sorry no, and I am not entirely sure about Spout now...after refreshing the worlds I couldn't cause it to happen again...this is strange :/

    Anyway, does it happen when ONLY having NoLagg running on the server? I need to be sure I am not fighting an unknown source...
  25. Offline


    it isn't spout, but i test it now against no plugin .. :O

    i tried it 3 times now, without plugins ... no problem ... :S

    but its a regular problem, bc its not only me ... :S

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


    @SilencShadoW Theeen it's time for a plugin list :)

    Very interested in knowing what plugins you run, as it has to contain a plugin that invokes this and a lot of servers use.

    (if it's PTweaks then I am going to rage because of the sarcasm, seriously)
  27. Offline


    you got any plugin for that? i got over 45 plugins ... :S freebuilds are hard to handle ... ^^
  28. Offline


    Im not using spout or any other chunk modifying plugin atm... i have disabled nolagg all chunk sending options all i have enabled is tnt buffering and item stacking.

    Build 1744 bukkit

    hope this helps
  29. Offline


    @o0AzzA0o you are number 3. It is caused by 'Mod loader MP', it somehow causes chunks to be loaded when world.isChunkLoaded is called. This affects not only NoLagg, but pretty much every other plugin that uses isChunkLoaded. It can cause severe tick rate drops.

    @SilencShadoW lemme make a quick batch script for you...
    (you can run .bat files in the plugins directory?)
  30. Offline


    nope sry, can u progam a plugin fast to get jars and save in yml? its not that hard, i did it a long time ago myself but lost the jar >.<
  31. Offline


    o0AzzA0o likes this.

Share This Page