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

    Flatliner

    Just ran into the blank sign issue again (sorry!). This time however, it seems it can be fixed by running nolagg fix whereas before I had to restart the server to get the sign text to reappear. The text also reappears if I leave the area for a minute and go back (although this doesn't consistently fix it).
     
  3. Offline

    silentdojo

    Sorry I mistyped 510* but you should know 529 is the latest recommended Spout not what the old Thread's Title is. http://dev.bukkit.org/server-mods/spout/
    @bergkiller I'll switch back to 510 and see if a few issues I have are gone. Although I only get a few missing chunks here and there now. All other issues have been resolved.
     
  4. Offline

    ledhead900

    There is a new one ? jesus no wonder I have been having issues thanks :)

    EDIT:
    This is what says in the OP thread.
    Development version is higher I am using latest spoutcraft tho I cannot update it due to 1.0 minecraft just yet tho.
     
  5. Offline

    silentdojo

    After testing this with Spout 510 again I realize that 529 is what is causing my problems with missing chunks. To all having issues I recommend using 510 for now.
     
  6. Offline

    Sepulzera

    Seems I got it:
    Today I tried it again, but didn't spread fire all over the surface of the tnt cube.
    Triggered TNT didn't get over 600, thought Buffered TNT was still increasing far over 100k.
    Tick was about 10-12.

    Config (open)
    Code:
    tntDetonationInterval: 1
    tntDetonationRate: 30
    explosionRate: 100


    Anyway, it's something you should take serious: Even if I was the reason for the firespread, a lava lake could do it aswell!
     
  7. Offline

    bergerkiller

    @Sepulzera I'll keep a hashset besides the list to reject queueing TNT blocks that are already stored. (thankfully the Location has a hashcode)
    I already do this...confused to what I can do then...


    @Flatliner tbh, me too, but on very rare occasions. Since altering the timestamp somehow had effect, I'll see if it works if I use the same time offset as before.

    @silentdojo I have to support the latest recommended build of Spout. If a new RB comes out which has chunk issues, I may have to find a workaround for that as well...
     
  8. Offline

    Sepulzera

    Mb, if possible, disable firespread for tnt blocks?
    So you can place fire to trigger it, but it won't spread to adjacent tnts...
     
  9. Offline

    bergerkiller

    @Sepulzera I don't think fire is the cause of it all; however I do not remove fire when a TNT explodes (denied ID)
    I'll see how MC handles this.

    EDIT

    This is extremely confusing. In the game bedrock/obsidian does not break when hit by tnt, but in code this isn't visible whatsoever :/
     
  10. Offline

    Sepulzera

  11. Offline

    bergerkiller

    @Sepulzera in-code. The WIKI is not important here, it is what is visible in the code. I only see ID checks against Fire (by CraftBukkit), but not for other types of blocks. Then I'd expect those checks to be required in the 'add to block changelist coding', but it isn't there either. Fire has no effect because it only detonates TNT 'now and then', it's not thousands of TNT detonated in a single tick.

    EDIT

    Ow well it must be hidden somewhere. Most importantly is that the tick drop can only be caused by lots of explosions occuring, can't think of anything else. When detonating a huge stack in an obsidian 'tube' I see no real tick drop, this confirms that.
     
  12. Offline

    Zathras

    Can anyone confirm that the issue with NLC and blank signs is really fixed now in 1.49.1? I'd like some assurance that it's working before I go add the new jar to my server.

    @bergerkiller Can you add version numbers to NoLaggChunks.jar so it prints that at startup? It's kind of hard to keep track of which one is in there.
     
  13. Offline

    Sepulzera

    Like I said: The tick seems to be good when I don't place fire all over the surface of the tnts. Try it yourself, build a huge cube out of bedrock, place inside (with a little space between tnt and bedrock) another cube out of tnt.
    Now set some hundred fire on tnts and say goodbye to your tick.

    [​IMG]
     
  14. Offline

    bergerkiller

    @Zathras The wiping issue is fixed yes, but NLC doesn't send the sign text packet correctly. (on very rare occasions)
    Did some changes to that today, haven't noticed missing text since then. If you want to prevent people asking 'empty sign?!' then wait for 1.49.2. I'll print the version number yeah.

    NLC will also get a memory use reduction in the next update. I noticed it was declaring a new 'byte buffer and inflater' every time it pre-compressed a chunk. This easily leads to a lot of memory issues.

    I cleared the raw data before, so it balanced it out, but I may have to keep it in memory for other plugins. Not sure though.

    @Sepulzera I see...I'll look into it then.
     
  15. Offline

    Sepulzera

    So, I tried placing 500k TNT without the bedrock cube and without fire.
    The TPS was about 6-9. Like excpected a bit lower than with bedrock cube, due to waterphysics and items.
    Triggered TNTs (Entities) were 'bout 2,5k, buffered 50k.
     
  16. Offline

    bergerkiller

    @Sepulzera I got the idea that it takes longer and longer to validate a TNT block to check if it can be added. Something with the hashcode slowly turning into a O(0) operation (Looping from the origin all the way)

    Having 500000 locations stored obviously causes hashcodes to fail, problem is that I don't know any alternatives...
    Also, tested it with 'Ore to client obfuscation', it has no issues with this plugin.

    EDIT

    Updated it to v1.49.2, fixing the sign text missing issues a bit more (haven't seen it happening since) and some memory allocation improvements when compressing chunks.
     
  17. Offline

    Sepulzera

    Hmm while testing I got some interesting thing:
    [​IMG]
    [​IMG]

    The first screenshot is below the TNT cube, the second is showing the cube itself.
    The chat is uninteresting. Strange is, that it seems the tnt explodes rather at the bedrock layer than at the environment surface, like it should.
     
  18. Offline

    bergerkiller

    @Sepulzera can be explained with the fact that TNT entities fall down when detonated. They would fall down the stack, exploding there. It then detonates the TNT over there where the cycle repeats.
     
  19. Offline

    Borch

    Instead of having a linked list and a hash set, you might want to try the LinkedHashSet, which could be a bit faster as it provides what you are trying to do, as far as I can tell. It might be worth trying a ridiculously large initial size for the hash set like = new LinkedHashSet(200000), just in case all the rehashing when it has to resize the hashmap several times from the initial capacity of 16 is the bottleneck. (Although it really shouldn't, since once it's resized there shouldn't be any more lag, but who knows...)
     
  20. Offline

    Sepulzera

    But the tnt shouldn't fall THROUGH the environments surface, should it?
     
  21. Offline

    bergerkiller

    @Sepulzera they can't, but explosions cause the terrain to bust open at some point :)
    (Plus, explosions trigger through other blocks. If a TNT explosion causes a wall to break down, any TNT behidn that wall detonates as well)
     
  22. Offline

    Sepulzera

    You got me wrong: Blocks get removed at the bedrock layer. They don't fall through any hole or anything like that.

    Try it yourself: Build a large cube above the surface. Dig a little way down to the surface (through the tnt cube or near to it). Now trigger one tnt and go down the way and watch the blocks at the bedrocklayer despawning.

    Some more Screenshots (open)

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
  23. Offline

    bergerkiller

    @Sepulzera wait now I am confused...lol
    So, you make a huge cube out of TNT above ground and detonate it, and below ground (at the bedrock layer) you see blocks disappearing, without any TNT entities near or any visible clue of detonation near the spot?
     
  24. Offline

    Sepulzera

  25. @bergerkiller
    We're going to install NoLagg :)
    I've one question:
    Why if autoSaveInterval: 400 is set to "400" but the map will saved quote: "every 20 seconds"?
    Does is mean 400 ticks?
     
  26. Offline

    bergerkiller

    @VADemon yup it's in ticks. The 20 seconds is an estimate, it can only be more. At least, it tries to sync ticks to 1/20th of a second.
     
  27. @bergerkiller
    AWESOME!
    My tickrates are BETTER now! I hope it will stay so.
    There's information:
    (/debug clock of commandbook)
    Code:
    4 guys on the server:
    2011-10-22 04:36:54 [INFO] Timing clock test for 5 IN-GAME seconds...
    2011-10-22 04:36:54 [INFO] DO NOT CHANGE A WORLD'S TIME OR PERFORM A HEAVY OPERATION.
    2011-10-22 04:36:59 [INFO] Warning: Bukkit scheduler inaccurate; expected 100, got 101
    2011-10-22 04:36:59 [INFO] Clock test result: EXCELLENT
    2011-10-22 04:36:59 [INFO] Expected time elapsed: 5000.0ms
    2011-10-22 04:36:59 [INFO] Time elapsed: 5053ms
    2011-10-22 04:36:59 [INFO] Error: -1.0488818523649317%
    2011-10-22 04:36:59 [INFO] Actual clock rate: 19.988125865822283 ticks/sec
    2011-10-22 04:36:59 [INFO] Expected clock rate: 20 ticks/sec
    
    Code:
    NoLagg:
    11 people:
    2011-11-20 23:17:02 [INFO] Timing clock test for 5 IN-GAME seconds...
    2011-11-20 23:17:02 [INFO] DO NOT CHANGE A WORLD'S TIME OR PERFORM A HEAVY OPERATION.
    2011-11-20 23:17:07 [INFO] Clock test result: EXCELLENT
    2011-11-20 23:17:07 [INFO] Expected time elapsed: 5000.0ms
    2011-11-20 23:17:07 [INFO] Time elapsed: 5002ms   (up to 5050ms)
    2011-11-20 23:17:07 [INFO] Error: -0.03998400639744103%
    2011-11-20 23:17:07 [INFO] Actual clock rate: 19.992003198720514 ticks/sec
    2011-11-20 23:17:07 [INFO] Expected clock rate: 20 ticks/sec
    Will respond tomorrow and post information about ticks with 40-50 players.
    If I were you, I would collect some information for those admins who are skeptical. (My main admin didn't want to add this plugin first:D)
     
  28. Offline

    StevenIsBallin

    I have item stacking enabled and the radius set to 5 but none of the items I drop on the ground are forming into stacks like I had hoped. Any idea as to what might be wrong?
     
  29. Offline

    bergerkiller

    @StevenIsBallin are you sure the items you drop on the ground, are of the same type and sub-type (wool)? Just in case, make sure you got 1.49.2, I believe something went broke in 1.49.1....
     
  30. Offline

    StevenIsBallin

    i went and took a look at my console and this is what i found

    20.11 16:54:31 [Server] SEVERE Error occurred while enabling NoLagg v1.49.2 (Is it up to date?): java.lang.Integer cannot be cast to java.lang.Double
    20.11 16:54:31 [Server] INFO [Modifyworld] Modifyworld enabled!
    20.11 16:54:31 [Server] INFO [NoLagg] chunk handler Spout add-on version 1.49.2 is enabled!
    20.11 16:54:31 [Server] INFO [NoLagg] [Chunks] Player chunks queued and will be sent shortly.
     
  31. Offline

    bergerkiller

    @StevenIsBallin be sure you set the stackRadius to 5.0 and not to 5, or it won't be able to read the value as a double (floating-point number)
     

Share This Page