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

    bergerkiller

    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. :)

    Important:

    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

    Description

    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.

    Read more...

    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.

    Read more...

    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. :)

    Read more...

    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.

    Read more...

    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.

    Read more...

    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.

    Read more...

    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)



    Media



    Video by brandcool86


    FAQ

    - 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.

    TODO-list:
    - Add option to disable physics when the tick delay becomes too high

    Changelog

    Show your appreciation for my plugins by donating
    [​IMG]
     
  2. Offline

    Sepulzera

    seems the issue with tnt does still exist..
     
  3. Offline

    bergerkiller

    @Sepulzera what CB version? It's not compatible with 1.9, it either throws an error and ignore drops or crashes, I don't know how JVM handles missing methods in try-catches.
     
  4. Offline

    G!zmo-rus

  5. Offline

    Eminam

    I still get some pretty nasty lag after updating.
     
  6. Offline

    Sepulzera

    CB#1337 (1.8.1).
    When the chunk is not loaded (no player in range), all tnts are still handled vanilla-like.
    At least, when a player goes into range, all tnts are sent at one time to the client, thought i dont no if these are the tnts exploded so far or if they are the tnts handled right now.

    However, the server still crashes with "OutOfMemory"
     
  7. Offline

    bergerkiller

    Just a heads up, but does the lag dissipate when disabling item buffering? (enable stacking, disable buffering)

    @Sepulzera That is kinda impossible, if the chunk is not loaded it can't perform physics on blocks. OutOfMemory can be many things, I got the idea there's a memory leak hidden somewhere...

    @G!zmo-rus item duping has already been resolved, it was an issue with Showcase, not related to what you had.

    To everyone having lag:
    If anyone has an offline server and has lag feel free to PM so I can join and inspect the situation.

    EDIT

    ChunkUnloadDelay has no memory leak; when monitoring total chunk count it nicely decreases after the delay. Note that setting the delay very high (>60000) this will almost keep chunks loaded 24/7. This can impact on the server RAM, causing an out of memory error.
     
  8. Offline

    Sepulzera

    Hmm...maybe the server tries to catch up the tnts it couldnt handle as it wasnt loaded?

    [​IMG]


    Config (open)
    Code:
    bufferItems: true
    bufferTNT: true
    useSpawnLimits: false
    useChunkUnloadDelay: false
    tntDetonationInterval: 1
    tntDetonationRate: 100
    explosionRate: 100
    maxItemsPerChunk: 40
    formItemStacks: true
    chunkUnloadDelay: 10000
    autoSaveInterval: 40
    updateInterval: 20
    stackRadius: 2.5
    stackThreshold: 5
    
     
  9. Offline

    bergerkiller

    @Sepulzera Update your configuration, it has multiple issues:

    explosionRate: 200
    I have it at 5...200 is WAY too many. It is per tick, clients can handle 20 tnt explosions per tick max or it starts to freeze...

    tntDetonationRate: 150
    You are allowing 150 tnt blocks to be ignited (and thus explode) each tick, which is 3000 per second. I honestly don't think your server can handle that many and keep everything running smoothly...

    autoSaveInterval: 30
    Lower than the default? It is now saving less than every 2 seconds, I have it at 400 for comparison...
     
  10. Offline

    ProjectInfinity

    Afraid that the chunk-unload lag only partially disappeared with 1.43. I still notice a huge performance impact when enabling it.

    This is what my config currently looks like:
    http://pastebin.com/W6Vc93TB

    edit: Also like I said earlier, it still does not cause my RAM usage to increase.

    edit2: What is the softdepend LogBlock for?
     
  11. Offline

    bergerkiller

    @ProjectInfinity ok try the debug version:
    <Edit by Moderator: Redacted mediafire url>
    It shows messages of the total amount of chunks, the chunks being buffered, the chunks loaded and unloaded since previous message. There is a gap between total and buffered: chunks near the spawn do not buffer as they stay loaded.

    Generally, the higher the loaded/unloaded counts are, the higher the risk of tick lag, as it has to save/load chunk data from/to file.

    On my own I hardly notice anything weird, but maybe you (with more players) get to see more evidence. Note that it broadcasts the info, so do inform the players what is going on...
     
    Last edited by a moderator: Nov 12, 2016
  12. Offline

    ProjectInfinity

  13. Offline

    bergerkiller

    Also, I'm off, I'll look at possible results tomorrow.
     
  14. Offline

    predawnia

    does nolagg conflicts with ptweaks?
     
  15. Offline

    Chrispm84

    First off, let me say this... You sir are a hero in my book. My server is so stable with your plugin, I can't imagine living without it. I have a decent server hosted with a great company, BeastNode. They've always been good to me, at least. My server only has 2 gigs or ram, but I can host 40 players at 20 TPS, no problem! And that's with 38 bukkit plugins, lol. But, I do have one small question... I've noticed that I can't seem to get any slimes to spawn on my server... If ya don't mind, would you take a look at my config and see if I'm doing something wrong? Thanks!

    Code:
    autoSaveInterval: 400
    explosionRate: 5
    useSpawnLimits: true
    tntDetonationRate: 10
    bufferTNT: true
    bufferItems: true
    useChunkUnloadDelay: false
    updateInterval: 60
    tntDetonationInterval: 1
    chunkUnloadDelay: 5000
    formItemStacks: true
    stackRadius: 3.0
    chunkSendInterval: 5.0
    maxItemsPerChunk: 20
    spawnlimits:
      default:
        mob: 2000
        animal: 1000
        monster: 1000
     
  16. Offline

    bergerkiller

    @predawnia Nope, it does not. Beware though, many features he claims that exist (TNT lag reduction, RAM reduction) are still not in the plugin. (as for 1.61, I just reviewed it) It is compatible, but the only thing PTweaks would add is async world saving, which basically fires:
    Code:
            World bWorld;
            for(Iterator iterator = mPlugin.getServer().getWorlds().iterator(); iterator.hasNext(); saveWorld(bWorld))
                bWorld = (World)iterator.next();
    Every 30 seconds. I can easily add it, but it's too simple. I will probably make an async chunk saving system which uses onChunkUnload instead, far better than risking concurrency issues every 30 seconds.

    EDIT

    Nvm, it adds nothing. The async saving feature is not working, since the function fails. You'd get some error with getTime not being defined for WorldServer...

    Let's just say Everything Ptweaks took over from Performance Tweaks was already taken over in NoLagg a time before that...only difference is that the author of Ptweaks added invalid statements of features...lol

    Buuut not going to start another nerd rage fight over this, I decided to let it rest. However, I see it as my duty to inform people of PTweaks when comparing.

    @Chrispm84 I am not sure, but it is possible that the monster limit (1000) was already reached when slime spawning began. You can try setting limits for individual mobs too, to keep room for slimes to spawn.

    Yup not much of an option here. At the moment neither NoLagg nor PTweaks handles async saving, and I thought Performance Tweaks had that completely implemented. I'll add a working version then...

    EDIT

    Async saving implemented. It is a very simple system: When a chunk is ready to unload, I pass it to the unload thread instead. Over there it saves, adds the same chunk onto the unload stack, which a scheduled task cleans up.

    @ProjectInfinity I updated the plugin to 1.44, adding a fix which could reduce tick lag on your side. Chunks are, when unloaded, now saved asynchronously. This means that, instead of saving chunks on the main thread, taking up precious tick times, it now runs as a task elsewhere. This reduces tick lag quite a lot, someone even claimed to see a decrease in CPU usage too, although not sure how that is possible. :p

    This feature comes with an added configuration node, 'chunkUnloadAsyncSave'.

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

    Sepulzera

    Just had a quick try...
    5 TPS with the chunkunload turned on...
    Default config

    Will try your debugg version later on too, but dont have enough time now.
    Good luck ;)
     
  18. Offline

    bergerkiller

    @Sepulzera if you got time, could I join to see the results 'n stuff'?
    Not sure if you tested 1.44 or 1.43 and/or if disabling chunk unload delays fixes it.
     
  19. Offline

    Sepulzera

    Tested like always the most recent version (1.44).

    It helped alot, up to 20TPS again, thought i don't know if it was a general problem or just with your async.
     
  20. Offline

    beleg

    Nice Plugin :) Please never stop support for it :D
     
  21. Offline

    zaklampje

    Just downloaded the plugin, but it seems there isn't a monster file...
     
  22. Offline

    bergerkiller

    @Sepulzera
    [​IMG]
    Hurayyyyyyy

    No really, I have been fixing that issue since the dawn of this plugin. Very happy that, adding a fairly simple async saving system, managed to fix this. :D

    @zaklampje It's fairly small since it doesn't depend on too complicated coding, you can look at the source code to get an idea :)
     
  23. Offline

    zaklampje

    Lovely plugin, lagg is gone :p Think of making a video of the before and after adding the plugin :p Quick help, btw
     
  24. Offline

    bergerkiller

    I guess it is time for a video update on the TNT, as it got changed quite heavily...

    Worldedit + NoLagg = makng awesome canyons :)
     
  25. Offline

    beleg

    :) but I have an error for now (one of the BIG ones) in an area I xant drop items (i can but they are jumping around xd and no one can take them)
    Code:
    Could not pass event ITEM_SPAWN to NoLagg
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:62)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:65)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:71)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.handleSpawn(SpawnHandler.java:103)
            at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(NLEntityListener.java:14)
            at org.bukkit.plugin.java.JavaPluginLoader$72.execute(JavaPluginLoader.java:763)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(CraftEventFactory.java:268)
            at net.minecraft.server.World.addEntity(World.java:855)
            at net.minecraft.server.World.addEntity(World.java:826)
            at net.minecraft.server.Block.a(Block.java:332)
            at net.minecraft.server.Block.dropNaturally(Block.java:316)
            at net.minecraft.server.Block.g(Block.java:303)
            at net.minecraft.server.Block.a(Block.java:493)
            at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:229)
            at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:165)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    >
    18:52:59 [SEVERE] Could not pass event ITEM_SPAWN to NoLagg
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:62)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:65)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:71)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.handleSpawn(SpawnHandler.java:103)
            at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(NLEntityListener.java:14)
            at org.bukkit.plugin.java.JavaPluginLoader$72.execute(JavaPluginLoader.java:763)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(CraftEventFactory.java:268)
            at net.minecraft.server.World.addEntity(World.java:855)
            at net.minecraft.server.World.addEntity(World.java:826)
            at net.minecraft.server.Block.a(Block.java:332)
            at net.minecraft.server.Block.dropNaturally(Block.java:316)
            at net.minecraft.server.Block.g(Block.java:303)
            at net.minecraft.server.Block.a(Block.java:493)
            at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:229)
            at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:165)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    >
    18:52:59 [SEVERE] Could not pass event ITEM_SPAWN to NoLagg
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:62)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:65)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.canSpawn(SpawnHandler.java:71)
            at com.bergerkiller.bukkit.nolagg.SpawnHandler.handleSpawn(SpawnHandler.java:103)
            at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(NLEntityListener.java:14)
            at org.bukkit.plugin.java.JavaPluginLoader$72.execute(JavaPluginLoader.java:763)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(CraftEventFactory.java:268)
            at net.minecraft.server.World.addEntity(World.java:855)
            at net.minecraft.server.World.addEntity(World.java:826)
            at net.minecraft.server.Block.a(Block.java:332)
            at net.minecraft.server.Block.dropNaturally(Block.java:316)
            at net.minecraft.server.Block.g(Block.java:303)
            at net.minecraft.server.Block.a(Block.java:493)
            at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:229)
            at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:165)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplicatio
     
  26. Offline

    Fr0zenfr0g

    my happy time is over, i have big black holes AGAIN :(
     
  27. Offline

    beleg

    yes me too

    are you getting the spawn errors around them?
     
  28. Offline

    Fr0zenfr0g

    how do you mean, i am not getting any errors in console but i have a massive amount of mobs surounding the holes...
     
  29. Offline

    beleg

    no errors? can you drop items? i have these holes and around them i cant drop something and the monsters are just standing still and i cant attack them...
    Please big Author help me :)
     
  30. Offline

    bergerkiller

    @beleg the error has to do with the spawn handler being partly de-initialized...

    Do these things happen when first starting up the server? I'll patch the error obviously, is a simple null check.
    Any errors when reloading?

    EDIT

    Do not seem to get black holes though...you are not doing the following?:
    Since that causes Spout to stop sending chunks to you.

    EDIT2

    Re-uploaded it, fixing that NPE. If anything is wrong, it should now be clear what it is...
     
  31. Offline

    beleg

    ok everything is okay :) it was my fault i used an plugin manager to disable/enable/load/reload
     

Share This Page