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

    Smex

    NoLagg v1.57.1 (CB1718) (no longer de-spawns custom-spawned entities)


    Do not use this version, it corruptes chunks and spawnes others
    widly around!

    Craftbukkit 1713.
     
  3. Offline

    hqSparx

    Tickrate randomly dropped from ~7-10 to 1-2 after some time (server's resources are used in 40-50%)
    [​IMG]
    save-all caused connection reset after
    CB 1597

    cfg (tried to disable many options, but this still happening)
     
  4. Offline

    bergerkiller

    @hqSparx It is generating 300 chunks in 40 ticks...can that be the cause? Ask everyone to stand still for a few seconds so it doesn't generate, does that fix the tick rate?

    Chunk generation is a very heavy operation, on my server generating just 1 chunk/tick brings down the tick rate to 5...
     
  5. Offline

    hqSparx

    Its possible, but the thing is normally they generate chunks and its OK,
    it drops kinda randomly and only restart helps, even if generation rate drops
    [​IMG]
     
  6. Offline

    bergerkiller

    @hqSparx mmmh only thing I can think of now is entities...what if you remove them?
    Note that this gets rid of ALL mobs, including animals in farms.
     
  7. Offline

    hqSparx

    gained 1 TPS ^^
     
  8. Offline

    migsthegod

    soo.. thats just byebye to my world? or is there anyway i can fix this?

    i should have waited before installing this into my server..
    it seemed like it was being advertised as a stable build.
     
  9. Offline

    bergerkiller

    @migsthegod Well, the chunks are still there...but scrambled. It is possible to fix it...but it'll have to be done manually by sight as if it is a huge puzzle...
    And yes, it was advertised as stable build because it was (and still is) 100% stable here...but unfortunately I don't have a huge testing crew in my basement testing 24/7...

    I'll upload a fix real soon, but before I end up having the same complaints (and I REALLY want this issue resolved), I need someone to test it. If anyone is willing to do the world a favor, please reply...because I need those people right now D:

    @hqSparx I'll add a simple event listener inside NoLagg to monitor the events, and which events take longest to execute. Then I'll add an option to obtain and list the registered plugins for specific events. This way you can check plugins for tick-rate deducting issues.
     
  10. Offline

    Smex

    @bergerkiller
     
  11. Offline

    hqSparx

    thanks
    but my server just crashed with
    Show Spoiler


    then 10MB's of spam:
     
  12. Offline

    migsthegod

    sounds good.
    time to start recreating a 9000 radius world by sight.

    i dont mean to be rude but thanks alot
     
  13. Offline

    bergerkiller

    @hqSparx ooow god you GOT to be kidding me?!?!

    Bad news: you got a corrupted CraftBukkit version. In this (weird) version it loads chunks whenever it is asked to check if a chunk is loaded. This causes endless chunks to get loaded...

    So, please update CraftBukkit or re-download it.
    Code:
    at net.minecraft.server.World.getChunkAt(World.java:336)
    at net.minecraft.server.World.isChunkLoaded(World.java:531)
    Congratulations, you are the second person with this problem...
     
  14. Offline

    Borch

    @migsthegod You should expect something like this to happen using a plugin that heavily modifies internal game mechanics. If you don't understand what it does and what the risks are, don't use it. If you decide to use it, make backups and stop whining if anything goes wrong. Multithreaded programming is a very complicated topic and hard to debug, proving an algorithm or whole application save is messing with your brain sometimes. CB 1.1 doesn't even have a RB and yet you expect one person writing such a plugin to make everything work perfectly immediately.
    I've been affected by this bug too unfortunately. In one area a couple of chunks appeard and "destroyed" a player's castle. I do however make backups every hour so I don't give too many shits. I just restored the old region file from that area and disabled the buffered loading, as bergerkiller suggested.
    @bergerkiller You should upload an emergency update without the new chunk loading stuff and remove all the builds that still contain the feature from the download page. Then start trying to fix it. I'm very sure that even right now people still download the current broken version and don't disable that feature...
     
  15. Offline

    bergerkiller

    @Borch I'll remove the builds ASAP, and put up a temp. version. (1.57.2)

    *edit* done. Could you check if 1.57.2 fixes these issues? I added a delay between saving and setting the chunk free of 20 ticks, hopefully this is enough to stop re-use of chunks that are still loaded.

    Other changes include:

    1. Fixed Notches' failing chunk relocating code.
    It caused an endless stream of throwable errors in the log previously, because he didn't use the right tag to alter the x/z coordinates. My version even tries to physically restore the chunk in two ways with a 100% chance it can be found back.

    2. Buffered chunks stay in memory a bit longer after unloading
    To prevent chunk teleportations and other nonesense.

    3. Added safety checks in the buffered chunks for type id obtaining out of range and adding tile entities at invalid coordinates, preventing server crashes.

    4. Added 'saved' output for the performance monitor, logging the amount of chunks saved since the previous message.
     
  16. Offline

    Borch

    @bergerkiller Aight I'll give it a try, but last time the issue only came up after about 10 hours, so we have to be patient. :) I really hope it was only a timing issue, not some logic being wrong.
     
  17. Offline

    hqSparx

    But this only happens sometimes, I'm using CB 1597 with modloadermp and minecraft forge
     
  18. Offline

    bergerkiller

    @hqSparx yup, that makes it clear: it is modloader. Mod loader was also installed at the other user having that issue.

    I have no idea how mod loader works, if it is being developed or where to report bugs..so could you post this issue for me?
    Code:
    ModLoader calls world.getChunkAt natively when world.isChunkLoaded is called.
    
    See: net.minecraft.server.World.java
    
    This causes chunks to get loaded when a plugin wants to check if it is loaded, invalidating the check, causing severe memory leaks and cross-threading issues for a lot of plugins.
    You probably have to post this in the ModLoaderMP section.

    @rtcabooservb do enable the buffered chunk loader as that is the only thing currently bugging everyone, it is what I need to have checked badly... (note: it's for CB#1718)

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

    hqSparx

    sure, thanks <3
     
  20. Offline

    SilencShadoW

    Can it be, that your plugin loads chunks and modify them? i got huge problems with new regend chunks on my server and your plugin is the only one who changes chunks ... :eek:

    Edit: IT was your plugin ... i imported a copy of the world, 6 times ... all got the same chunk "bug" on mass areas, not only once ... :eek: ... i deletet nolagg ... next rollbacks for my user .... finaly, the "bugs" are gone ... nolagg destroyed all :\ .. im a big fan of this ... but realy realy fix this awsm bug ... it destroys all ...

    - it generate new chunks
    - import from other worlds
    - import from other areas
    - delete chunks (complte ... with bedrock and all)

    .... and so on ... its like a mixer >.<
     
  21. Offline

    rtcabooservb

    @bergerkiller Did you fix the flying chunks with the latest build? Kinda upset I have to restart the world.
     
  22. Offline

    bergerkiller

    @rtcabooservb I don't know, there is a 1.57.2 version on GitHub but need outsiders to test it. Obviously have no problems with it here, but since others seem to have issues all the time, I decided to just wait for positive or negative results about that version.
     
  23. Offline

    rtcabooservb

    =/ I'll use it for now and look for a plugin that backs up my world every hour. Should I change any values in the config?
     
  24. Offline

    rtcabooservb

    Shouldn't it be enabled by default?

    Edit: Don't worry about the CB build. I always use the latest build. Using 1744 right now.
     
  25. Offline

    SilencShadoW

    can u please reply to my post, i realy need your plugin, but maybe i do something wrong? :'(
     
  26. Offline

    rtcabooservb

    Using the same latest build on the github. Read the OP.
     
  27. Offline

    SilencShadoW

    what you mean?
     
  28. Offline

    bergerkiller

    @SilencShadoW The latest version can be found on GitHub and is version 1.57.2. Since people have chunk corruption issues, I need someone (actually, multiple people) to check this version. As always: make a world back-up, we are dealing with chunk corruption here.
     
  29. Offline

    rtcabooservb

    Starting up my server with a fresh map now. :( I'll test as much as possible, but let me know if you fix the issue beforehand.
     
  30. Offline

    bergerkiller

    On a sidenote: I bought the game :) (took a while to transfer the money to paypal...)
    So if anyone needs assistance/needs to show a bug or anything, I can now properly join online servers. :D
     
    Don Redhorse, Borch and Inscrutable like this.
  31. Offline

    rtcabooservb

    Awesome!
     

Share This Page