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

    bergerkiller

    Ok think I got the chunk unloader working again. When alone on the server, view distance 10, the chunk count stay < 900 and on average the count is 600. Minimum around 550.
     
  3. Offline

    cartman-2000

    Setting it to 0 actually makes it worse, leaked ~400-500mb in about 5-10 minutes, ~4-5k chunks loaded at this point in one of my worlds(at 7504 after about a half hour of the server running.). With the way it is in the current version of the plugin, setting it to some very high value(100 million ms or higher to pretty much disable it.) fixes it, as the if statement will be false if the chunks load time is less then the sum of the chunk load time and unload delay.
     
  4. Offline

    bergerkiller

    @cartman-2000 Yuuup the statement was reversed... :eek:
    I had to change > into < to make it work properly. Only after broadcasting the unload allow/deny/force notifications I could find out how to set it. It was basically cancelling all chunks that had to be unloaded, and allowing all chunks that should NOT be cancelled. Weird things are expected to happen...
    Also, the NPE on disable is also fixed.

    Since I'm going off, I'll upload 1.18 fixing these two things only. (I'll see tomorrow what else I had to update)

    EDIT

    Done, updated to v1.18
     
  5. Offline

    o0AzzA0o

    There is a compatiblity issue with the below plugin. It causes all sorts of crazy things to start like infinate gold ingots raining from sky :) anyhow i removed moneydrop i love nolagg to much :) just thought i would report it incase it is a fixable issue if it isnt then... no big loss. Thanks
    http://dev.bukkit.org/server-mods/moneydrop/
     
  6. Offline

    cartman-2000

    One other thing, shouldn't the unloading of chunks be based off of the time after chunk unload was called and not by chunk load time set when it was loaded, as with that fixed if statement the chunks will be unloaded immediately on chunk unload if they are older then chunk load time + chunk unload delay. Chunks may still leak if they where loaded for a period less then the chunk load time + chunk unload delay, if the area isn't very heavily traveled.
     
  7. Offline

    Jok3r539

    All I can say is sham f**king wow!
    LoL just kidding but in all seriousness this is a great plugin!
    It serves its purpose! thanks bergerkiller

     
  8. Offline

    audial

    Link to download is provided 1.17 according to server logs:

    05:13 PM [INFO] NoLagg version 1.17 is enabled!
     
  9. Offline

    Makatiel

    Is there any way to use this plug-in without the spawn limitations? I have nothing in my config file that specifies any sort of spawn limits but when this is installed the server is nearly devoid of passive MOBs.

    I also wanted to note that the item duplication exploit is still alive and well in 1.17. I haven't tried to duplicate it in 1.18 yet.

    Other than that problem this plug-in makes the server run a LOT better than it does without it.
     
  10. Offline

    MindDefect

    This new version is working even better than performance tweaks ever did in the past, very solid plugin!
     
  11. Offline

    erdrickk

    used your download link but when the plugin loads up it says 1.17 not 1.18
     
  12. Offline

    bergerkiller

    Ok got some free time now. :)

    Things to look at & fix today:
    - item duplication (first step: reproducing it, I'll try everything possible)
    - Double-check the chunk unloading system just in case @cartman-2000 is right. :)
    - Reset the version number (simple change in the plugin.yml tho)
    - Work on animal/monster/mob 'global' spawn restrictions.

    Also, how the chunk unload system works:
    - Mark freshly loaded chunks with a timestamp
    - Mark just-visited-by-player chunks with a timestamp
    - Get the 'chunk expire time' from the timestamp and unload delay
    - Expire date < current time? Unload is possible.
    - Handle chunk unloads based on the above statement
    - Cleanup task to unload chunks that are expired

    Also, didn't update the source last time. Code isn't as it is now. :)
     
  13. Offline

    Eminam

    Great to hear!! I'm enjoying this plugin. It's definitely added a little extra to my dedicated server.
     
  14. Offline

    gogorot

    this is happening in some places in the world (survival mode)


    left or right clicking on any block they disappear. Trying to place a block will briefly show it and then will make disappear the block it was placed on. Sometimes they reappear, sometimes they don't.
    And some chunks are not sent to the player at all. Walking into them will make the player fall down forever.
    I installed only this plugin today, and this issue started a couple of hours after
    Running v1.18 on bukkit #1185

    Code:
    autoSaveInterval: 1200
    explosionRate: 40
    chunkUnloadDelay: 30000
    formItemStacks: true
    tntDetonationRate: 10
    maxItemsPerChunk: 80
    orbScannerInterval: 200
    updateInterval: 20
    tntDetonationInterval: 2
    
    anything I can do to better track this issue?
    thanks
     
  15. Offline

    PhotonLance

    same problem (((
     
  16. Offline

    bergerkiller

    That is reaallly weird...I don't even have an explanation for it. :/

    Also: adding global spawn restrictions, animal/monster/mob types and defaults will be used in worlds set too.
    example:
    Code:
    spawnlimits:
        global:
            mob: 200
            minecart: 200
        default:
            monster: 10
            animal: 10
        worlds:
            World1:
                monster: 20
                animal: 0
    EDIT

    Limits working, very nicely too. :)
    Now time to check out item duplication once more.
     
  17. Offline

    Eminam

    I'm not having these problems on my server. You sure you dont have any other plugins? what are your server specs, and also might want to adjust your settings and try other settings.
     
  18. Offline

    bergerkiller

    Updated to 1.19, fixing the item duplication bug and adding global and improved spawn limits.

    EDIT

    Now considering adding a (fairly) simple 'send nearby chunks' command everyone can use, with a maximum interval of using it of course. Guess I'll look out for left-clicks being performed x times per second. :)

    EDIT

    @gogorot Just wondering, does the same happen if you set:

    To:
    Same for:

    To:
    Could be one of these is causing issues. Also, in your video, are the surrounding chunks supposed to be 'gone' or not? Because I experienced a somewhat same issue on my own server while testing...
     
  19. Offline

    fffizzz

    i removed for now until the chunk loading bug is fixed.

    tested the mentioned settings above with no change.
     
  20. Offline

    Hydrosis

    So where do we put the config for the mob limiter?
     
  21. Offline

    gogorot

    these are the only reasons i started using this plugin: to minimize disk access.
    I'll try with the settings you suggested and let you know

    the chunks are still there (restarting the server will show them correctly, at least for a while)
    so far this issue has happened only in my 3rd world managed by multiverse, no idea if that helps or is even relevant (in these days my players stay most of the time in that worl)
     
  22. Offline

    bergerkiller

    @Hydrosis in the same config.yml file as the other settings.

    @gogorot You can't cancel chunks from loading, so there is no way this plugin can cause that. Maybe it's in the Bukkit server (next to so many other issues). For now I'll keep it like this until I or someone else finds a 'cure' for this issue...
     
  23. Offline

    fffizzz

    @bergerkiller
    [​IMG]
    [​IMG]

    without the plugin loaded, this problem goes away. It seems to have gotten wose since 1.17-1.18. I tried multuple settings for unloadchunk delay and some others with no changes.
     
  24. Offline

    bergerkiller

    @fffizzz Yep that is exactly what I am now going to fix. First checking if it is MyWorlds or NoLagg that is causing this. (it could even be MyWorlds' forced region file detaching functions at work)

    No idea what it is, but I'll dismantle it and add features until this issue reoccurs.
     
  25. Offline

    fffizzz

  26. Offline

    bergerkiller

    @fffizzz not related to Multiverse. What happens is that, because of more chunks loaded per player than normal, it simply ignores some chunks because 'they are not needed'. When I do this in the ChunkHandlers' PlayerMove handle coding:
    Code:
                        int chunkX = cx + a;
                        int chunkZ = cz + b;
                        w.loadChunk(chunkX, chunkZ);
                        if (w.isChunkLoaded(chunkX, chunkZ)) {
                            Chunk c = w.getChunkAt(chunkX, chunkZ);
                            touch(c, time);
                        }
    To load the chunks as the player walks, it works and no holes appear. However, it is noticeable that black holes appear and disappear when walking towards it. In other words: chunk did not get loaded.

    OR I write my own scheduled task to update chunks around the player, OR I handle onMove to load chunks as the player walks. (and changes chunks)

    I will probably implement a new chunk loading feature right now, where chunks are loaded 'ahead' of the player, using the velocity to get the desired chunks to load. The native system simply loads all chunks in a circle around the player, loading chunks behind the player. (which are not needed at all)
     
  27. Offline

    gogorot

    With autoSaveInterval: 20 and chunkUnloadDelay: 0
    so far no missing chunks problems occurred.
    Trying now with autoSaveInterval: 1200 while keeping chunkUnloadDelay: 0
     
  28. Offline

    bergerkiller

    Hah! I just trippled the speed at which chunks appear to me! :D
    This new chunk packet sending algorithm is just boss...no other word is possible...I was flying at 300 blocks per minute and the chunks were able to keep up! This also fixes all possible ways a chunk 'not getting loaded' to a player, since all chunks nearby are sent anyway.

    @gogorot Ok, although I pretty much fixed the bugs now. :)
     
    maniacmusic likes this.
  29. Offline

    MJRamon

    Did you update the link?
     
  30. Offline

    bergerkiller

    In a few minutes...gotto do some testing (performance testing) of course. As a safety feature, players can 'schedule' a chunk to load by right/left clicking it. A packet with the chunk then gets send.
     
  31. Offline

    MJRamon

    So we don't need BananaChunk anymore :)
    Though I don't think that letting players to load chunks by wish is a good idea. Reconnect is a not bad way)
     

Share This Page