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


    plz help me with config, i have 60+ ppl lag without NoLagg and 50+ ppl lags with NoLagg.
    all updated

    no time for me?

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


    Averus wow +99mb/s, what is going on in there? Even with 100 players it shouldn't be this high...

    What plugins are you running? I bet a plugin is logging too much data inefficiently.
    Also, if you use Orebfuscator, you may want to enable the cache for it. (or disable it alltogether, it causes RAM to rise very quickly)

    sagethor Well the buffered chunk loader was meant for that, but it caused too many problems. Right now it works on chunk packet memory usage. So, the more players you have, the least RAM it will have to spend on the packets compared to the total. (this because it no longer stored the raw packet data temporarily)
  4. Offline


    set useChunkUnloadDelay: false give me +2-3 ticks

    i can give OP if you want see it on my server

    forgot too say, we use IndustrialCraft + BuildCraft + RedPower server mods coz we bored with vanila server

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


    Argh, I was talking about the /nolagg gc command, sorry. I forgot to mention that.
  6. Offline


    I Got a real bad error when i added this to my server. The ground was non- exsistant and just bounced around.. everything seemed fine in console as long as no one was on the server but as soon as someone came on i got this.

    2012-02-03 11:24:42 [WARNING] Task of 'NoLagg' generated an exception
    java.lang.NoSuchMethodError: net.minecraft.server.EntityPlayer.getBukkitEntity()Lorg/bukkit/craftbukkit/entity/CraftPlayer;
        at com.bergerkiller.bukkit.common.Operation.doPlayers(
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1$
        at com.bergerkiller.bukkit.common.Operation.<init>(
        at com.bergerkiller.bukkit.common.Operation.<init>(
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1$1.<init>(
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
        at net.minecraft.server.MinecraftServer.w(
  7. Offline


    UltraZero use latest CraftBukkit version (RB 3)

    Averus sorry, very busy right now, NoLagg 1.60 is almost finished, currently adding the final fixes and changes to the coding library it now uses. For one, it now allows consistent 'headers' for nodes in the configuration, including spaces and all.

    I don't really know what is wrong over there, all I see is this very large memory access rate. I do notice that you use Essentials, it could possibly be related. (I have no idea how much load it adds to the server; it is quite extensive)

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


    ok, i see, but my server work better without NoLagg
    and you say i have load like 100+ ppl, so 100+ beter without NoLagg too ...
    its make plugin no sens coz we have CB++ - works perfect 250+ ppl without NoLagg.
    You def need code it a little for HEAVY load servers and i can help you with my server.
  9. Offline


    Averus Believe me, it is optimized for all servers as can be. I recommend disabling all features in the configuration, enabling them again until the tick rate drops. Since your update is <0.2 ms, I don't think it is caused by the following features:
    Do check the spawn limiter, on some older CraftBukkit versions (maybe also in newest) it infinitely spawns and despawns,causing severe tick rate drop. I know of this issue and am still working on a fix for it.

    (If you used spawn limits, you can disable that for now. It might work out for you)

    Note that 1.60 will have 'mob spawner limits', which will work 100% without tick rate drop. This should complement to all other issues.
  10. Offline


    i will try,
    cant use more then 2G-2,5G ram with noLagg, this is ok?
    i use java7 64 bit, without NoLagg i was 4-6 G and less lags
    plz see screen, i have 6 core 8g ram (testing 4g for game) + SSD drive

    UPD: yes, mob limit off give me 1-3 ticks (and +3800 mobs lol)

    UPD2: turn off bufferItems give 1-2 ticks more

    1% compression ist high? do i need add more sendThreadCount ? i have 10 now.
  11. Offline


    Averus 1% is very low, you can do with 1-2-3 threads max. Only use more than 1 or 2 threads if the percentage starts to reach 60% or so.

    The RAM looks fine; it increases steadily and then gets garbage collected again. It does garbage collect every 15 seconds, it's a bit often, but with that many players this is probably impossible to prevent.

    I'll add some more processing duration checks in various locations, so they will show up in the update bar correctly. Already included all event-handling in the spawn limiter check.

    You can first try and set the 'updateInterval' in the configuration to a higher value; 40 or 80 or so. It is possibly taking too long to update something too often.
    Averus likes this.
  12. Offline


    turn all false only last true and i have up to +60mb/s with 70 ppl
    so its Nolagg cause that.
  13. Offline


    Averus very interested in knowing what causes it. Could you post NoLagg's configuration? (and/or try to enable features until the same happens again)
  14. Offline


    If you get a minute can you help me out with the spawn limits.
    I have the following set in the config

    default: {}
    animal: 150
    monster: 250
    world: {}
    world_nether: {}

    I want a maximum of 400 mobs, however its pretty much always double this.
    I want this limit to be a maximum for all worlds combined. Can you tell me what im doing wrong?
  15. Offline


    PhunkeyMonkeh looks all right to me (except the indentation, but that's just the formatting)
    What CraftBukkit version are you using right now? It's quite possible that entity spawns are not properly cancelled by NoLagg...
  16. Offline


    Latest RB 1846
  17. Offline


    server lags 60+ without nolagg
    server lags 50+ defaul configs nolagg
    server lags 75+ with that config
    screen with last config
    (tnt turned off by worldguard month ago)
  18. Offline


    PhunkeyMonkeh Then I know what I'm dealing with. I'll see if I can add additional hooks into CraftBukkit to prevent mobs spawning after a chunk (with mobs in them) load.

    Averus I see you used:
    maxRate: 30.0
    Maybe a bit too high? No connection can possibly bear this anyway...I recommend you use a value lower than 4-5 here.
  19. Offline


    Averus I used to use MaxRate: 25.0. I do not remember ever seeing an actual rate over 10.0, and I was constantly having problems with client-side 'holes' in the world. Since I've dialed it back to 5.0 I have not had any problems.
  20. Offline


    NoLagg v1.60 is finally uploaded on GitHub :)

    This version deals with a (****load) lot of fixes and improvements. Noticeable changes will be:
    I've tested pretty extensively, so all should be well now. :)
  21. Offline


    will orebfuscator have problems with this plugin?
  22. Offline


    shauwk No, but it may log an 'synchronized code accessed from another thread' error. It's a bug/issue/problem in Orebfuscator; it inexplicitly loads the chunk in the obfuscation function, which can sometimes trigger the chunk_load event to be called on another thread. NOlagg picks this up and logs a warning - but only once.

    It's not severe and not caused by NoLagg (don't shoot the messenger!), but it is still an important thing to note. Plugins that use the chunk_load event to function properly may start throwing concurrent modification or index out of bounds exceptions, but this is not related to NoLagg in any way.

    tldr; it's stable, but Orebfuscator has a bug which is logged by NoLagg. Use Orebfuscator with caution until the issue is resolved.
    shauwk likes this.
  23. Offline



    2012-02-05 07:55:51 [WARNING] Plugin 'NoLagg' v1.6 is too old to run on CraftBukkit build 1917
    2012-02-05 07:55:51 [WARNING] Update NoLagg to a newer version or look for an older build of CraftBukkit

  24. Offline


    rtcabooservb Is that a new recommended build? I need to verify it works on that build before I allow it to be used, added that warning because I got tired of the endless people using the wrong CB with the wrong NoLagg version...
  25. Offline


    No it isn't the newest RB because knowing me, I always use the latest dev build for bug fixes, enhancements, and speed improvements. So far nolagg works on 1917.

    And if nolagg didn't work on the latest CB build, then nolagg would be removed since the server runs fine without it.
  26. Offline


    rtcabooservb ok then I can increase the max build ceiling to 1917 at least, guess 1920 is a better estimate.
  27. Offline


    Yep, updating to 1920 now.



    After a few hours of leaving the server up, I noticed the update in /lag stat states that the update took 931.3ms. (Cknk updtr took longest) I've never noticed this before because 1.59 and previous builds, it was always 0.1ms. So something you changed in 1.60 is stating the updater is taking 900ms.
    CB 1920 Spout 748

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


    2012-02-05 07:55:51 [WARNING] Plugin 'NoLagg' v1.6.1 is too old to run on CraftBukkit build 1920
    2012-02-05 07:55:51 [WARNING] Update NoLagg to a newer version or look for an older build of CraftBukkit


  29. Offline


    It is merely a warning I added to prevent confusions. It still works, but newer builds may bring incompatibility.
  30. Offline


    wow this plugin is amazing thanks so much
  31. Offline


    I dont know why Packet buffer size is acting like that, but it was introduced with 1.60 (i'm using 1.61 now)

    I dont see any side effect btw, what exactly does packet buffer size means?

    EDIT: Also, i'm using Bukkit #1871 (so i could get rid of Spout while still having VanishNoPacket on)

Share This Page