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


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


    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


    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.


    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.


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


    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.


    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.


    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.


    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)


    Video by brandcool86


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

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


    Show your appreciation for my plugins by donating
  2. Offline


    @thehutch I'll send 20 empty lines when a player stops monitoring to clear the screen. :)

    @mrciku what settings do you have for TNT? (detonation interval and rate, and explosion rate)
    I'll look at your plugin to see if issues exist.

    It did have that mob spawn issue before, could be the chunks you see there still contained the mobs stored when using NoLagg v1.44. If this happens on a freshly created world, then I need to review the issue.

    Today: Going to add auto-fixing systems to fix the lighting bugs occuring in 1.8
  3. Offline


    i'm a bit confused of what this is? does this mean a auto update?
    General update to make people aware of the new version (hehe)
  4. Offline


    I have a mob issue in a custom world fresh generated ever time I test it with Terrain Control.

    Mobs spawn but some mobs become broken client sided like in that early 1.8 trailer, The pig was frozen stiff. I get that with many mobs wondering if it was ur plugin or not I cannot be sure.

    Nolaggs addon us using default settings btw.


    and a couple seconds later you can see visible chunk loading but look at the mobs
  5. Offline


    @ledhead900 I'll force entity removal for chunks getting reloaded, hopefully that fixes it.

    @Colm I had to re-upload v1.45 several times on one day, 1.46 is partly to make people aware of the newest version.
  6. Offline


    oh... its your plugin... but i don't really like that it can make some spam as i'm always up to date with your plugin but ok...

    i have an idea why don't you implement it in the config? so default is on but people can take it off?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  7. Offline


    @Colm It's async chunk saving, but I'm making it a permantenly enabled feature in the next update. It will be used to fix chunks from lighting issues (it works unbelievably well), but then I obviously need this thread running at all times.

    It does take pretty long to process all the lighting. :)
  8. Offline


    its not that i like the async chuck saving i don't know who wouldn't i'm talking about this
    General update to make people aware of the new version (hehe)
    because i don't need alarming when a new update is out i check your post regally that what i mean :).
  9. Offline


    @Colm I know, it's just that people know they can update. If I keep on pushing new v1.45 no one would notice, and it gets complicated once people start posting about issues in previous versions. :)


    Sigh well good side: it completely gets rid of lighting issues and client lag caused by this
    Downside: it literally takes ages to do this...even if I'd run 10 async threads for it. :/


    NVM! This is awesome! I forgot to return true and it was waiting half a second as if it was idling, but now I fixed it..just WOW! Everything is as it has to be: no weird trees, no weird shadows, no client lag and especially: it does not require you to use a command!

    Still added one though, to fix lighting issues on already created worlds. It works really nicely, believe me, you gonna love this :D

    @ledhead900 Whatever I try, I don't get to see 'ghost entities'. What settings do you run your server on? (esp. view distance)


    Ok after flyinf for 5 hours I managed to find one frozen skeleton - it does happen. Time to add some code to counter it :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  10. Offline


    how would this help? Why no Spout GUI me sad :( spout = awesome :D
  11. Offline


    @thehutch Because I have no idea how widgets work with Spout...I guess xD

    I'll look into it, but don't expect too much.
  12. Offline


    Awesome plugin. The new monitoring feature is absolutely amazing! Definitely suites my nerd well!

    I have one issue, and it is with the formatting of the log it gives. Reading the log with notepad, notepad++, word, and importing it to excel yields bad formatting. The headers do not line up with their corresponding values. Would it be possible to fix this? Perhaps just add a space or a | in between each colum, that way importing the list to excel will be easy. And thus, calculating averages and looking for issue areas will not be a problem.

    Also, is there a way to change the frequency of the "nolagg monitor" updates? It is doing it about every second for me, it would be nice to be able to change this. A longer time would be nice for long term monitoring... The short time is nice for short term monitoring.

    EDIT: Sorry did not notice 1.46 was out :)
    A bug I noticed.

    Starting with my server NOT monitoring, when I type "nolagg monitor" it says "you are no longer monitoring this server" (even though I just turned it on, and it begins monitoring"). Then typing it again WHILE monitoring it says "You are now monitoring this server". Only a slight bug, but worth mentioning.
  13. Offline


    @NotYetRated yeah that bug was fixed in 1.46, with the monitor message. Only happened in the console. :)

    And yes it should be possible...yup I forgot the setting for it. :/

    And yeah, I had to use some tab-formatting to get it just right without weird indent issues. I'll see if I can change the format to suit excel.
  14. Offline


    would be a really nice feature for spout users :D
  15. Offline


    What exactly would you be able to do with the spout gui for this plugin? There are only a couple of commands for it, so I don't see a use implementing a GUI for issues the commands...?
  16. Offline


    Well for the monitor command spamming yor message box can be annoying and so putting it into a GUI makes it neater
    Also @bergerkiller I just had a huge CPU spike and my server keeps lagging even when i'm the only one on it :( also why are there 2 commands for clearing everything? and one of them barely doesn anything
    /nolagg clear all and /nolagg clearall
  17. The plugin is nice, i used it for the day, i like the new chunk loading very much but i removed the plugin shortly afterwards because my tickrate was lower with it than without it.
    I'm not saying the plugin is bad, i'm just saying that for me it didn't quite do what it's advertised to do (granted, it can be a problem from my side - the configuration)
  18. Offline


    @TowelieDOH It depends on with how many players you are and how well your CPU performs. It usually has a lag spike when a lot of chunks are loaded - for example - when multiple players start running. I can do little to nothing to fix that, since you can't cancel chunk loads.

    Other than that, make sure you have an auto-save interval higher than 400, since asynchronous saving is faster and doesn't reduce tick times much. Note that in the next version this is a bit adapted; instead of saving all chunks it will save only the changed chunks.

    General note: whenever you have lag, start monitoring to find out what is going on. If you see a high value next to 'to save', you know it is performing an auto-save which can use some CPU of course. If you see high green numbers next to the chunks, then you know it is loading a lot of chunks, which causes a tick rate drop.

    Also, it is (quite) obvious that it increases CPU usage, since it implements multi-threading. Instead of performing everything in a single thread, it now utilizes 2 to 3 more threads. This reduces tick lags, but obviously increases the CPU usage since it can now perform more in less time. It's like driving on a highway: when a lot of cars are ahead of you, you are forced to slow down. But if you increase the amount of rows, you can drive freely and more efficiently. This does increase the amount of vehicles on the road. (cpu usage)
  19. Offline


  20. I generally have 80 players (at night), i have a core i7 2600k and my world(s) are ran in RAMDISK.
    And yes, my save interval was 18000
    Thanks for the reply!
  21. Offline


    Did some performance runs to be sure everything is OK.
    At max, it takes 20 ms (13 on average) to perform global updates. This includes:
    By default it runs every 20 ticks, so it will lose 1 ms per tick. This is hardly visible in the tick times and is easily adjusted by the timer in the background. Even then, you can increase the interval to adjust. No issues there.

    Now looking at chunk load and unload handlers. <- these are 0 ms...sometimes a single 1 passes through, probably a java error. I don't expect issues there either.
  22. Speaking of monitoring, if you are reffering to /nolagg monitor, that drops the tickrate even lower.
    Normally i have 12-15 tps with 80 players on and 3-4 hours uptime, but wih nolagg i had as low as 6

    PS: Here is my config:
    bufferItems: true
    bufferTNT: false
    useSpawnLimits: true
    useChunkUnloadDelay: false
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    maxItemsPerChunk: 40
    formItemStacks: true
    chunkUnloadDelay: 30000
    autoSaveInterval: 18000
    updateInterval: 20
    stackRadius: 1.0
    stackThreshold: 2
    useAsyncChunkSaving: true
  23. Offline


    @TowelieDOH you can use /nolagg monitor (also in-game) to monitor the server. It outputs everything you'd possibly need. :)

    Can't see anything wrong in that configuration, are you using 1.46? (because then having unload delay can be a lag-saver, because it does chunk saving on a separate thread)
  24. i'm using 1.46 yes, but i didn't see using unload delay any useful since i run my worlds in a ramdisk :S
  25. Offline


    @TowelieDOH Doesn't matter, it still compresses the chunk when it saves it, and this takes CPU usage. Whatever speed you have for HDD or RAMdisk, it will still take CPU to compress the chunk.

    @TowelieDOH What if you increase the update interval? I see you have 17K chunks loaded (WOW), I may need to work around a way to make it use less CPU to loop through it. Does setting the 'updateInterval' to 40, 80 or 120 reduce this tick lag? If yes, then I know where to look and I'll make the chunk time updating part async to save CPU.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Sep 9, 2018
  26. What do you recommand as a good chunk unload delay value then ?
  27. Offline


    @TowelieDOH 5000 is a nice value. In 5 seconds it can easily happen that a player leaves and gets near a chunk again, while keeping a fair RAM usage. Too high delay would keep them loaded for too long.
  28. Going to give it another try :)
    I'll let you know.
    Also, NoLaggChunks was causing invisible chunks for me btw.
    But since it's in development its obvious that there will be bugs :)

    @bergerkiller The tickrates are considerably worse even with the new settings.
    I usually have 12-15tps with 80 players online and now i have 13-15 with 40.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  29. Offline


    @TowelieDOH I see quite a lot of chunk loads, 512?! What if everyone is standing still and not exploring new areas?
    Note that generating world chunks takes quite some CPU, nothing I can prevent. (or maybe a little)
  30. @bergerkiller All the maps are generated and bordered, so no new chunk generation occurs.
    I do howver have 3 worlds (world1 + world2 + skyrealm).
    So no new areas are being explored :S
    It looks like it keeps dropping over time. Here's this from 10 minutes after the previous one
  31. @bergerkiller i thought updateInterval only affected buffered items ? :confused: what does it actually do
    Edit: To answer your question, yes, i do see a slight improvement (1-2 tps) when setting it from 20 to 40.
    But what does that setting do and what should it be kept at ?
    Edit2: A lot more improvement when its set at 80 :D (16tps with 43 players)

Share This Page