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


    I thought it was ? what is it then and why would I need it at all if I am already doing a mini save at 30m intervals and a full backup every 5 hours.
  3. Offline


    If it is like what PerformanceTweaks promised, it would modify save-on to only save at the specified interval. Meaning you save extreme amounts of I/O usage.
  4. Offline


    @ProjectInfinity the auto-save interval is the interval, in ticks, at which a global world save takes place. One tick is around 1/20 second. When saving, only changes chunks are saved to file. Setting this very low will make the server write out the entire chunk very often, even for minor block changes. Setting it too high will result in lost data when the server crashes, and a lag spike once the server finally starts saving. When setting it very high, I recommend performing a manual world save or global save every now and then, to help the server a bit.

    @ledhead900 It's safe to use, only made a mistake in the configuration, the front end. It still loads correctly, but the default for autosaveinterval (0) is wrong, it should be 40.
  5. What about a option to /nolagg clear to flush all the current boats/minecarts on the server.
    Haters place tons of them on the ground forcing lag.
  6. Offline


    So by default it writes to disk every 40 ticks meaning every 2 seconds? What is the default minecraft save then? I'd like to see some statistics on this actually. If there is one thing that causes lag on my near 6GB world it is people spreading out all over the map when digging and building.
  7. Offline


    @ProjectInfinity 40 is the minecraft default. I have it at 4000 ticks on my server, solved all computer crashes with it. It takes CPU power to compress the chunks, and that is where the issue lies.

    @MiRROW I guess I could add options to clear specific types too, like:
    MiRROW likes this.
  8. That would be appreciated :)
  9. Offline


    Updated it to 1.40, adding an improved clear command and changed the default save interval back to 40.
  10. Offline


    I see well thanks for clearing that up mine is set at 1200 right now I might try higher now that I know what it does.
  11. Offline


    its probally somewhere i missed but how do i turn it off cuz i hit clearall and clear and i want it back to where just tnt and orbs r gone not minecarts
  12. Offline


    I get this everytime my server starts up now :O
    2011-11-01 19:45:52 [WARNING] Task of 'NoLagg' generated an exception
        at java.util.WeakHashMap$HashIterator.nextEntry(
        at java.util.WeakHashMap$
        at java.util.AbstractCollection.toArray(
        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(
  13. Offline


    @bolagna simply type:
    Right then only TNTs and items are removed, like usual. Mind the space is removed between clear and all.

    @kahlilnc Plugin list please
  14. Offline


    Yah?? I use an archive extraction tool and it does that, unarchived it 2 times.
  15. Offline


    @Tydie12 you should unarchive it only once, and place the 'archive' inside in plugins. Jar files are archives too, which can make it confusing.
  16. Offline


    Worldedit and guard
    ZombiePigmenInvasion (a specially made for the server plugin)
  17. Offline


    @kahlilnc Looked at the plugins for a bit, but can't seem to find that plugin causing this issue...

    If 'toArray' fails for a collection, the only reason can be an async thread messing it up. And since all async threads have been 'banned' in NoLagg, it can't be NoLagg...sigh

    All I can suggest is removing all plugins but NoLagg, and gradually add the old plugins until it starts happening again. Then, after finding it out, you can post the plugin name you suspect causing it.
  18. Offline


    so u just type it again to put it back to normal?
  19. Offline


    @bolagna back to normal? No I meant the standard clear command (like in the version before this) is used when you use the command without specifying entity names.
    This would work too tho:
  20. Offline



    When I restart the server after copying across the .jar I get this error and no folder or config file is generated. Any ideas?

    2011-11-02 21:16:14 [SEVERE] Error occurred while enabling NoLagg v1.4 (Is it up to date?): org/bukkit/configuration/file/YamlConfiguration
    java.lang.NoClassDefFoundError: org/bukkit/configuration/file/YamlConfiguration
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at com.bergerkiller.bukkit.nolagg.NoLagg.onEnable(
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(
        at org.bukkit.craftbukkit.CraftServer.reload(
        at org.bukkit.Bukkit.reload(
        at org.bukkit.command.defaults.ReloadCommand.execute(
        at org.bukkit.command.SimpleCommandMap.dispatch(
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
        at net.minecraft.server.NetServerHandler.handleCommand(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet3Chat.a(
        at net.minecraft.server.NetworkManager.b(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.ClassNotFoundException: org.bukkit.configuration.file.YamlConfiguration
        at Method)
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 36 more
  21. Offline


    @Eliteabix yup you need to update your CraftBukkit to the newer (1337) build.
  22. Offline


    Whoops, totally thought I was running that. Sorry for wasting your time.
  23. Offline


    2011-11-02 00:01:15 [SEVERE] Could not pass event CHUNK_LOAD to Spout
        at java.util.ArrayList$Itr.checkForComodification(
        at java.util.ArrayList$
        at org.bukkit.craftbukkit.CraftWorld.getPlayers(
        at org.getspout.spout.SpoutWorldListener.onChunkLoad(
        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 org.bukkit.craftbukkit.CraftWorld.getBlockAt(
        at org.bukkit.craftbukkit.CraftWorld.getBlockAt(
        at org.bukkit.Location.getBlock(
        at bukkit.techguard.halloween.Animator.tick(
    2011-11-02 00:01:19 [WARNING] Task of 'NoLagg' generated an exception
        at java.util.WeakHashMap$HashIterator.nextEntry(
        at java.util.WeakHashMap$
        at java.util.AbstractCollection.toArray(
        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(
    IK its spout and this but I think Spout may have something to do with it ?
  24. Offline


    I'd look into whatever plugin uses this:

  25. Offline


    Oh thats Halloween by TechGuard XD if not obvious but is it on my part?
  26. Offline


    @kahlilnc @Afforess Yup, the Halloween plugin is using an async thread in the 'Animator' class.
                (new Thread(animator)).start();
    In this animator thread (under run) this is done:
    - Get the players on the world, but synchronizing it after the call, still allowing conc. errors to occur
    - Get chunks from a world (BAD!)
    - Something with unregistering chests, whatever happens then
    - Play effects on the world

    I'll send a PM to TechGuard that he needs to fix this some how, with the error you posted here.

    Only thing I notice in this list is LogBlock and 'ServerLogSaver'. The log saver because of log compression - if all this is done on the main thread it could cause issues if done too often. LogBlock requires a Database to work correctly, if used with a flat file it would probably lag quite badly...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Oct 10, 2018
    kahlilnc likes this.
  27. Offline


    Since installing this I have experienced some pretty hefty lag. Could the item stacking/buffering be the reason? 4.8/20 ticks and it takes often a long time for items to become a stack.
  28. Offline


    @ProjectInfinity does clearing the server remove this lag, or not? You can also try increasing the update interval. It can be infinite amount of things that increase tick it's a bit hard to find out what causes it. To include or exclude NoLagg, you can disable/enable features until this lag disappears/appears.
  29. Offline


    No it did not. I guess I need to go through each plugin and feature :/
  30. Offline


    @ProjectInfinity you can always post the plugin list, perhaps I can spot potential lagging plugins by looking at the name/features.
  31. Offline


    bAntiCaps, bPermissions, ChannelChat, ChestShop, ColoredSigns, CommandBook (the updated one without the thread leak), CraftBook, CraftBookMechanisms, HelpPages, iConomy (5), InstaMode, LogBlock, LogBlockQuestioner, LWC, MCBans, mChat, MCSL, MCTelnet, Minequery, ModTRS, Multiverse-Core (2 worlds, only 1 is being populated), Multiverse-Portals, MyHome, MyWarp, NoCheat, NoLagg, PickBoat, ServerLogSaver, SpawnBed, Towny, TownyChannel, VanishNoPickup, Votifier, bPermissionsWebGUI, WorldBorder, WorldEdit, WorldGuard.

    It's a pretty long list but our server should be able to run it with 24GB of ram and a i7 920 CPU to go along with it. It starts lagging around 40-50 players.

Share This Page