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


    @ledhead900 I wouldn't. The entire Bukkit project is a fail IMO. Not that it was not a good initiative, it's just not well-made. Why have an API? Really?

    The API version is completely useless. Whenever you actually want to make something 'ground breaking' you need to use CraftBukkit anyway. Packets, Block charateristics, Material characteristics, chunk handling, saving,'s all behind that annoying casting. They should drop Craft- and just script everything in one library, as it only limits the abilities the API can perform. Why return a lesser version of World?

    But, I don't have time to completely rewrite everything 'like that'. Plus, it would have to be made compatible again during every single MC update, and they tend to come more often these days.

    Adding to the previous post: it's not helping the developers at ALL. I have to make all possible functions myself, in every single plugin. Instead of allowing everyone to share their knowledge and add handy functions one by one, they only allow fixes which are so small to make it useless. For a public library it isn't really that public.

    For example, the following function is in pretty much every single plugin that uses signs:
        public static BlockFace getFacing(Block b) {
            MaterialData data = getData(b);
            if (data != null && data instanceof Directional) {
                return ((Directional) data).getFacing();
            } else {
                return BlockFace.NORTH;
    Would it harm anyone if it's added to the block class? Nope, but it won't get pulled either.
    Inscrutable likes this.
  3. Offline


    Wow, that bad. So basically bukkit ended up like Hmod sigh. wonder if canary is ending in same way.

    Also why do you have to rewrite everything for each minecraft version why can it be all in one class or 2 classes and just change and add events as needed?

    Anyway I say again I fund it could/ would u make me personal rewritten bukkit reco builds. I mean could u find time for $50 each build.

    I would think you would only have do a lot of rewriting one time to get it the pull request list all sorted and ideas in and do what u said should be done. Then it would be no different then any other bukkit update just rewrite it and add functions as needed.

    I thought the WHOLE point of bukkit was to be a public thing unlike Hmod bukkit was supposed to be accepting pull requests and making it a community written best ever server replacement mod. But it sounds to me as if its as bad as Hmad when it comes to accepting decent ideas because it would take more time then they can bothered doing.

    So again why only have a couple people in the bukkit team why cant it be a community and any decent developer can sign up be approved and work on bukkit. I mean the worst worst case would be a build is terrabad and has to be re made. So would could have been awesome is now let down by the team running the place heh ?. I mean bukkit could have improved like you said really be the lime light for server but instead its held back by people who want control. I mean it would be easier for them anyway if they open the doors let anyone devlop bukkit all they would have to do is moderate then and keep an eye on the builds and change list and promote a build to reco , It would speed up the process by about 200% instead of a 4/5 man team doing it all.
  4. Offline


    How long do you think until this is ready? I would love to try it.
  5. Offline


    @ledhead900 A link says more than a hundred words
    it's the best pull ever. It allows plugins to assign flags for entities, blocks, etc. Metadata is one of the very thing we need right now. But, no. Instead every plugin is keeping 3 hashmaps to do the same, increasing RAM, CPU usage and of course, increasing the overall risk of plugin memory leaks.

    Why it is so 'locked'? Well, that is because of the fact that Notches code is locked. It is all obfuscated. During every single new version, all variable and function names change, causing plugins to break. A decent wrapper should supply a one-name method, if needed update it with it. But this is not the case.

    Deobfuscating Minecraft (server) source is still considered 'illegal', it's like hacking a game. This is why any public MC server idea gets blown away, as they are not allowed to use the original source. Blame Notch for this.

    @Grimmy777 Not sure, it still has it's issues atm. For example, it still sends out useless smaller block changes, which should be blocked or queued for the larger chunks. It looks bad when you see lots of small cubes in the void in the distance...
  6. Offline


    Now Im sad again sigh. If notch ever releases this bloody open source SDK for modding will it be unlocked and then we see these pulls being made daily ?. Your idea on the proper way to make a wrapper is what I was trying to say.

    It should be a wrapper that has all info in easily update able format so u don't have to rebuild everything else just need to update with the new source code and change events as needed.
  7. Offline


    Kk, fixed it. It was an error, caused by citizens with NoLagg (dunno how...).
    Great plugin, futhermore :p
  8. Offline


    Ok tracked down the 'allowing block changes' issue. For some reason they are not caught by Spout; I have to lock the chunk until I am actually going to send my chunk.
  9. Offline


    Hey if you want to come to our test server at your already whitelisted but if you want to see what I mean by client lockup lol come a round if u have time soon. Besides my World changes to biome and world gen will BLOW your mind.
  10. Offline


    Found one issue so far, this plugin doesnt play well with creeperheal. After the explosion is done, no matter how big or small, it does give a Tick list out of synch error and server crashes. Hope there is work around or fix soon.
  11. Offline


    @cybernetamd could you post the exact error? Especially since it can be both for scheduled tick updates and entities. Someone somewhere is using an async task :)
  12. Offline


    sure mate, this is the error im getting when using Creeperheal and NoLagg together.

    [severe] at net.minecraft.server.World.a(World.Java:2122)
    [severe] at net.minecraft.server.World.doTick(
    [severe] at net.minecraft.server.MinecraftServer.h(
    [severe] at
    [severe] at
    [severe] Unexpected exception
    java.lang.IllegalStateException: TickNextTick list out of synch
    at net.minecraft.server.World.a(
    at net.minecraft.server.World.doTick(
    at net.minecraft.server.MinecraftServer.h(
  13. Offline


    @cybernetamd Ai I looked at the code, and Creeperheal uses async scheduled tasks only...not sure if it's such a good idea. It's hard to compare decompiled code, so I'll PM the author for further help to add support.

    It obviously causes numerous issues if you try to access the main thread from another...sigh.
  14. Offline


    ah I hear ya bud, and I do appreciate your help on fixing this issue with the compatibility. Most of my people on my server love to blow stuff up and then have it regenerate. We have forts we built shooting tnt at each other from a distance, its quite hilarious to watch lol. Cheers mate.
  15. Offline


    Mobs seem to be spawning out of wack. There was out of no where about 700 mobs in one little spot in front of spawn. idk y the limit for each mob is 210 (not monster) but mob and did butcher got around 740 mobs in one little area ;( and yeah they have been doing this for a few days now.
  16. Offline


    @kahlilnc did you redownload 1.44 when I re-uploaded it? Because I had to reupload it (the same day) because of chunks not getting cleared from mobs, causing them to duplicate when the chunks re-loaded.
    kahlilnc likes this.
  17. Offline


    Oh probably not :O
  18. Offline


    Status: still under development. For a second I thought I had it..but neh. When entering not-generated bits it spazzes out.
  19. Offline


    Yeah, really great plugin! It uses round about 20% more CPU on my server than without! Throw it away and go dying!

    Sorry, but i tested it for 2 weeks and its the greatest waste ever! It prevents nothing, it does lags for every server!
  20. Offline


    @BenniRennt sorry to hear that, if you wish to disable chunkunloaddelays go ahead, as it is the main factor that increases CPU usage.


    Updated it once more, hopefully fixing the weird async saving issue someone described.
    Also added a performance monitor in it, to keep track of memory, chunks, tick rate, entities and the internal buffered items, tnts and chunks. /nolagg monitor for display, /nolagg log to write to log.

    Decided not to upload the chunks add-on yet, as it still has the annoying 'let me just cut that tree in two' issue. It does eliminate all client lag that occured before, but don't want to end up publishing something that is not entirely complete.
    Did upload a WIP version to give you an idea what it can do. Dropped all the player-specific and global settings, as it was no use to get that working. (would only lose CPU because of it)


    I now dare to say that NoLaggChunks is working. However, when entering generated regions it tends to cut trees in half. Rejoining fixes that. Also, for some reason it rains throughout the chunk when you join for the first time. (no idea why)
  21. Offline


    Getting a error with 1.45 that I didn't get with 1.44:
    2011-11-11 17:38:54 [WARNING] Task of 'NoLagg' generated an exception
    at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
    at java.util.HashMap$ Source)
    at java.util.HashMap$ Source)
    at com.bergerkiller.bukkit.nolagg.ChunkHandler.cleanUp(
    at com.bergerkiller.bukkit.nolagg.NoLagg$
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    at net.minecraft.server.MinecraftServer.h(
  22. Offline


    Are you using chunk unloading? I am not getting this, I have chunk unloading set to false.
  23. Offline


    Here is the error again mate, its doing the same thing still with the new update for running both plugins. This time it gave me a new message on the top which was interesting. I have a feeling the author of Creeper Heal will have to redo some code, unless you can have a work around on your side. Hope this helps. Cheers

    22:13:31 [WARNING] [NoLagg] Chunk [-2/1/world] was restored from the chunk savin
    g queue!
    22:13:31 [WARNING] [NoLagg] Chunk [-1/1/world] was restored from the chunk savin
    g queue!
    22:13:31 [WARNING] [NoLagg] Chunk [0/1/world] was restored from the chunk saving
    22:14:12 [SEVERE] java.lang.IllegalStateException: TickNextTick list out of sync
    22:14:12 [SEVERE] at net.minecraft.server.World.a(
    22:14:12 [SEVERE] at net.minecraft.server.World.doTick(
    22:14:12 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServe
    22:14:12 [SEVERE] at
    22:14:12 [SEVERE] at
    22:14:12 [SEVERE] Unexpected exception
    java.lang.IllegalStateException: TickNextTick list out of synch
    at net.minecraft.server.World.a(
    at net.minecraft.server.World.doTick(
    at net.minecraft.server.MinecraftServer.h(
  24. Offline


    PS: "nolagg monitor" in the console is saying the opposite. I.e. when monitoring it says "you are no longer monitoring this server", when stopping monitoring it says "you are now monitoring this server".
  25. Offline


    Ah actually mate, you might have solved it with 1.45, I deleted the config files to nolagg, and it redid the folder. So far its working amazing, its not hiccuping anymore! :-D Im a happy camper, more stuff to blow up on my Xeon lol. Thanks again :) Ill keep you posted.

    ok, when I died, lol little explosion, when I respawned, it did the same error again, I think cause I ended up in another world. Im using Multiverse.

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


    Just installed this plugin. I believe I can see a difference. I will have to wait until my server is under load to know for sure. Thank you for developing it.

    two questions:

    Is there anyway to stop this message. I watch my console like a hawk ( because I get ssh anywhere haha) and its like driving with 1/10 a windshield. Its like non-stop on my screen.

    Also, does this conflict in anyway with ptweaks? I am running both right now.
  27. Offline


    Can I trust 1.45 not to corrupt worlds :p with Async saves on ?. What exactly is benifit of Async save anyway ?

    Are these settings still any good for the Nochunks as I will test it for a little while see how it goes.
  28. Offline


    @bergerkiller Hey, I'm getting a TON of these warnings. They don't seem to affect the server at all, but they really do spam my server.log. Should I be worried about this or is there a way to disable the warnings, if there's nothing wrong? Thanks!


    Guess it'd be smart to tell you the warning, huh lol?

    2011-11-12 01:04:47 [WARNING] [NoLagg] Chunk [-26/-134/OmegaCraft] was restored from the chunk saving queue!
  29. Offline


    Did some testing with the latest updates with nolaggchunks and nolagg. It intensively increases the CPU ALOT! Just wanted to let you know. Removed the both of nlc and nl and used the previous version of just nl and its back to good ol CPU about 6% per player with this about 30% per player. I am not trying to sound like a dick :O
  30. Offline


    It's also taking loads of RAM for me, just NoLagg. Memory leak?
    kahlilnc likes this.
  31. Offline


    I was gonna say that :O Keep up the good work too :D

    Ooo I didnt do any testing with nolaggchunks with out the newest update with nolagg does that work with the previous nolagg?

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

Share This Page