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

    rtcabooservb

    Yeah, but I've heard PTweaks is better on the ram and NoLagg is better on the cpu usage. I'm removing PTweaks only because I don't need two plugins that do the same thing. Also, I ran into yet another bug in NoLaggChunks. When teleporting with /tp or any other method that requires a chunk update, (/home, /warp, buttonwarp plugin, etc) signs disappear and require a relog for the text to reappear. Currently had to remove NoLaggChunks to fix this issue.
     
  3. Offline

    bergerkiller

    @rtcabooservb then you must be interested to know that 40% of the features PTweaks claims are a lie. Had a complete debate with him before, complete with evidence etc. You can look at some of the pages which contain a link to the source code comparison.

    what PTweaks has:
    TNT / RAM reduction is not present in his plugin, although he claims this is the case.

    Are all non-existent features and thus lies. Feel free to ask the following questions, he won't be able to answer them:
    - What do you mean with 'loading TNT'?
    - How can chunks load faster if you only load more? Doesn't this contradict lower RAM usage? What bout chunk generators, they need to be synced, if you do this async this will cause concurrency errors. How do you get around it?
    - What methods do you use to reduce RAM usage?

    This doesn't make sense either. 'slows down and save goes faster' WHAT?
     
  4. Offline

    Borch

    Yeah I also had a look at the PTweaks thread, but those claims sound like he has no idea what he's even talking about. Reminds me of stuff "computer experts" and "hackers" use to say in movies. Make it sound smart to the normal guy who knows shit about computers/programming. :D
    -> http://www.youtube.com/watch?v=hkDD03yeLnU
     
  5. Offline

    Mrchasez

    Ptweaks can check ram usage >: D
    I win Muahahah
     
  6. Offline

    bergerkiller

    @Mrchasez so can NoLagg. On top of that, it will show the minimum RAM usage (the one after garbage collecting) AND the current usage, shows when a GC is performed and has a progress bar display. Shows the TPS as well, with the entity counts, chunk load/unload and loaded counts and a lot more, and allows you to log this information to a file. (log.txt)
    You lose Muahaahh.
     
  7. Offline

    Mrchasez

    Since when D;
    Well Ptweaks checks Total Ram, and Free ram
    :<
     
  8. Offline

    bergerkiller

    @Mrchasez ever since I had to have a way to identify lag problems people can have. By logging entity/chunk counts and more, this eases it.
    2011-11-29_16.25.05.png
    The green part is the memory statically loaded (always allocated), the yellow part is temporary memory (will be cleared by the GC) and the red part is unused memory from the total.
     
  9. Offline

    Mrchasez

  10. Offline

    w000rm

    Someone got owned.
     
    Zathras likes this.
  11. Offline

    Redstorm3265

    Works but messes with the ShowCase plugin, which stacks the item after item which makes the items pick-up-able
     
  12. Offline

    spunkiie

    REQ: An /nolagg reload option, so we could adjust mob limits on-the-fly without restart.

    BTW: Running this plugin on my two 300+ server, working like a charm.
     
  13. Offline

    Flatliner

    I've noticed sign text is disappearing a lot more since moving to one of the 1.0.0 bukkit dev builds and the latest nolagg chunks. Out of curiosity are you using any particular spout build when you're testing? I've been rolling with whatever the latest dev version is so it's entirely possible that's what's causing it.
     
  14. Offline

    cartman-2000

    found a bug in nolagg chunks, if a player gets kicked(admin kicked or floating to long kicks.) if they rejoin chunks won't load for them again until they reconnect normally.
     
  15. Offline

    bergerkiller

    @cartman-2000 thanks, I'll check if I need to handle some more to remove/update the player chunk buffer in the case of kicking. (although player Quit is part of that)

    @Flatliner used the latest Spout build for 1.00, didn't notice anything odd. When does this missing text issue happen, when first joining the world or when a player walks towards a sign previously not visible?
     
  16. Offline

    Flatliner

    Well I joined earlier, all the signs I could see upon joining were fine. I walked about 10 blocks to the other side of a small fountain to add to a board of signs and all of them were empty. I then walked to a building a few chunks away and all the signs in there were blank as well apart from 1. Upon returning to spawn all of the signs were fine apart from 2.

    Unlike before where it seemed to happen fairly randomly I can get the same behaviour almost every time, even right after a reboot. As before, fixing the lighting makes all the text show up fine.
     
  17. Offline

    bergerkiller

    Final test: I'll send the sign update one interval after the block changes. That should at least help fix this.
     
  18. Offline

    spunkiie

    @bergerkiller

    Could you please tell me how do I completely DISABLE all NoLagg features except SPAWN LIMITS ? I've tried adjusting config.yml, here's it so far:

    Code:
    bufferItems: false
    bufferTNT: false
    useSpawnLimits: true
    useChunkUnloadDelay: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    maxItemsPerChunk: -1
    formItemStacks: false
    chunkUnloadDelay: 10000
    autoSaveInterval: 400
    updateInterval: 20
    stackRadius: 1.0
    stackThreshold: 2
    monitorInterval: 40
    autoFixLighting: false
    spawnlimits:
      default:
        creeper: 10
        enderman: 30
        cavespider: 30
        spider: 30
        ghast: 1
        pigzombie: 1
        skeleton: 30
        giant: 1
        slime: 1
        zombie: 30
        chicken: 30
        cow: 30
        sheep: 30
        pig: 30
        squid: 1
        wolf: 1
    
    With the above config, we are still facing some duping BUGs with 1.0.0 (while moving item stacks from chest to chest) The bug went away after disabling NoLagg, but I really want the spawn limits feature. :(

    Please note that I'm only interested in the spawn limits feature. We doesn't have the time/interest in making any further tests besides disabling/enabling NoLagg.
     
  19. Offline

    bergerkiller

    @spunkiie This too:
    Code:
    useChunkUnloadDelay: false
    autoSaveInterval: 40
    It will probably give a warning about the interval, you can ignore that. Note that the async saving feature can be useful, if you wish to use it enable the above two. (400+ interval async chunk saving is used)

    EDIT

    @Flatliner what view distance do you use for your server? And what are the NoLaggChunks settings? I got a feeling that it is sending chunk data beyond client visibility.
     
  20. Offline

    spunkiie

    @bergerkiller

    Thank you very much. :)

    BTW: My above request (nolagg reload for changing spawn limits on the fly) has any chance to get in ?


    EDIT:

    Here's my final config, is the async save feature enabled in it or I have to set autoSaveInterval above 400?

    Code:
    bufferItems: false
    bufferTNT: false
    useSpawnLimits: true
    useChunkUnloadDelay: false
    tntDetonationInterval: -1
    tntDetonationRate: -1
    explosionRate: -1
    maxItemsPerChunk: -1
    formItemStacks: false
    chunkUnloadDelay: -1
    autoSaveInterval: 400
    updateInterval: -1
    stackRadius: 1.0
    stackThreshold: -1
    monitorInterval: 40
    autoFixLighting: false
    spawnlimits:
      default:
        creeper: 10
        enderman: 30
        cavespider: 30
        spider: 30
        ghast: 1
        pigzombie: 1
        skeleton: 30
        giant: 1
        slime: 1
        zombie: 30
        chicken: 30
        cow: 30
        sheep: 30
        pig: 30
        squid: 1
        wolf: 1
    
     
  21. Offline

    bergerkiller

    @spunkiie it's enabled;
    Code:
            if (AutoSaveChanger.newInterval < 400) {
                NoLagg.log(Level.WARNING, "Auto-save interval is too low for async auto saving to work!");
                NoLagg.log(Level.INFO, "The built-in auto-save (which saves 24 chunks at a time) will be used instead.");
                NoLagg.log(Level.INFO, "Set autoSaveInterval in NoLagg\\config.yml to a value higher than 400 ticks (20 seconds) to use async auto saving.");
            } else {
    It should actually be 'to a value higher or equal to 400' but it was a bit too long, so made it higher.
    Using /reload should reload the configuration, but I'll add a reloadconfig command, reloading both NoLagg and NoLaggChunks. (NoLaggChunks if NoLagg is available)
     
  22. Offline

    Lunar Delta

    I want to offer you my personal thanks for writing this plugin. Without it, this would never have been possible:



    In total, about 130,000 blocks of TNT were detonated. And there wasn't a hint of lag for anyone the entire time. (Although people extremely close to ground zero got disconnected. I suppose that can't be helped. ;) )
     
  23. Offline

    Flatliner

    I'm pretty sure render distance is 10 for the server and the same for nolaggchunks.

    *edit*

    I think my settings might be the cause of this happening more often. I lowered the chunksendinterval to speed up the chunk loading and I didn't notice I have it lowered to 1 (a lot lower than the default). I deleted my config so it uses the defaults and after a few minutes of testing it seems okay. I'll have to try a 2 interval see how that goes now as 4 is a bit too slow.

    *edit 2*

    So... it seems that a chunkinterval of 4 is somehow magical as if I drop it to 1 or 2 I get blank signs. But if I leave it on 4 the signs are fine. Same with chunk send rate, if I make this larger than the default (say 2 or 4) I get the sign issue too.
     
  24. Offline

    bergerkiller

    @Flatliner thanks, but I think I figured it out now. Your post does 100% match with my findings.
    I was using a static 'ignorePacket' flag to ignore packets sent by myself. However, since the packet sending code is on a separate thread, it is possible that it ignores a sign change packet but not the block change packet while sending a new chunk. This results in the client receiving a sign change packet, having no sign block near to use it, discarding this packet and thus leaving the sign blank.

    Now replaced the flag with a synchronized hashset containing the packets to ignore. Works like a charm so far, but I noticed another issue: 'Downloading terrain' is gone for some reason. Must have to do with a changed upload order, so I am changing that now.
     
  25. Offline

    spunkiie

    @bergerkiller

    Can't wait for the nolagg reload option. We are a very big server with over 30kk LWC protections, using native /reload simple crashes the server. A nolagg reload instead, would let we wrote a script to set the mob rate based on the player count. Would be very nice :)

    TY
     
  26. Offline

    o0AzzA0o

    Feature request can we have in config the ability to disable stacking of certian items. I get annoyed with players stacking pots and spawners etc. :)
     
  27. Offline

    bergerkiller

    @o0AzzA0o it's possible, but only afraid it will result in a performance loss...
    I'll add an 'ignored item types' list under the name:
    Also, download issue is now solved. It now properly lets the client download the terrain, although the code which made this happen is a bit odd...
     
    o0AzzA0o likes this.
  28. Nolagg but only Nolagg dont works in
    CB #1535

    This is the error please fix it:
    PHP:
    2011-11-30 23:47:01 [SEVEREError occurred while enabling NoLagg v1.5 (Is it up to date?): null
    java
    .lang.AbstractMethodError
        at net
    .minecraft.server.WorldMapCollection.b(SourceFile:107)
        
    at net.minecraft.server.WorldMapCollection.<init>(SourceFile:29)
        
    at net.minecraft.server.World.<init>(World.java:154)
        
    at net.minecraft.server.WorldServer.<init>(WorldServer.java:27)
        
    at com.bergerkiller.bukkit.nolagg.DummyWorld.<init>(DummyWorld.java:57)
        
    at com.bergerkiller.bukkit.nolagg.DummyWorld.<init>(DummyWorld.java:54)
        
    at com.bergerkiller.bukkit.nolagg.ChunkSaving.init(ChunkSaving.java:31)
        
    at com.bergerkiller.bukkit.nolagg.NoLagg.onEnable(NoLagg.java:195)
        
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
        
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
        
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165)
        
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
        
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
        
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Thanks for all.
    I am waiting for the next update.
     
  29. Offline

    bergerkiller

    @vicente947 *edit*

    You can try a lower build of the CB for now. The team decided to give all members of the IDataManager interface a proper name, which means my own implementation started to spit out that error. Will be fixed in next update, which will be very soon. (gotto fix the bleeding mobs issue first)
     
  30. Now i am using 1533 there is GOOD
     
  31. Offline

    FlynnTaggert

    I'm Getting same error as vicente947 in build 1537 don't know if that helps in anyway but thought I'd mention it.
     

Share This Page