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


    Greylocke it is a linear calculation. Make sure you have a minimum set up:
    And so on. Do not forget to add the '0=12' bit, as that would result in it being read as '0 = 0'.

    Curtis3321 Guess it wouldn't hurt updating it for this tiny fix, I'll upload a fixed version.

  3. Offline


    bergerkiller I think I understand how the dynamic view works, but it doesn't seem to match with what I'm seeing. For example, as the only person on my server, I did a /nolagg stats and got Chunks: 1650 (1362 Unloadable), Dynamic view distance: 9 chunks.

    But my config looks like this:
      - 0 = 13
      - 5000 = 13
      - 10000 = 10
      - 60000 = 8
    and my server max view is 13.

    None of this seems to make sense.
  4. Offline


    Greylocke it 'interpolates' between two values. 7500 chunks would be (13 + 10) / 2 = 11.5 view. It is not based on steps, it chooses values in between as well.
  5. Offline


    bergerkiller I understand the linear equation between nodes thing. But look at my example. If there are 1650 chunks loaded, why is my view distance 9? According to the config, the view distance for 1650 chunks should be 13.
  6. Offline


  7. Offline


    Greylocke(Ignore the first thing)

    I think that the view 13 is out of range, see if using the '0=12' or '0=10' works out.
  8. Offline


    bergerkiller tried the change. Didn't make a difference.
    fresh boot, one player
      - 0 = 13
      - 5000 = 13
      - 10000 = 10
      - 60000 = 8
    1691 chunks view 10

    fresh boot, one player:
      - 0 = 12
      - 5000 = 11
      - 10000 = 10
      - 60000 = 8
    1691 chunks view 10

    Puzzling, eh?
    CB build2327, NoLagg 1.87.2.
  9. Offline


    Ok. Thank you. It turns out that without me changing anything people said the problem went away days ago. Thanks again for the great plugin!
  10. Offline


    Greylocke At what view distance is the server set? The plugin does try to stay below/equal that view distance.
  11. Offline


    bergerkiller in, view-distance=13. I did a fresh boot and now with:
      - 0 = 12
      - 5000 = 11
      - 10000 = 10
      - 60000 = 8
    a /nolagg stats tells me: Chunks: 1848 Dynamic view distance: 11 chunks

    Doing the math I get 11.64. Does NL round down? That'd explain the current scenario.
  12. Offline


    Greylocke yeah, it uses (int) view which, in Java, is rounding down.
  13. Offline


    Latest dev of Bukkit broke stats :(
  14. Offline


    Puremin0rez on it.


    Well I know what broke it, but it is in the latest build. I don't like supporting development builds, rather wait until it becomes recommended. It's not an unfixable problem, though.
  15. Offline


    i think the problem is the recommend isnt anymore stable than the devlopment build so most are sticking to it
  16. Offline


    carls1976 I see...problem is that I want to avoid the b.s. from last time: People downloading a test/beta version, and when the official version comes around, they end up using the BKCommonLib of the old one, causing bugs. I want to avoid that this time, to be honest.
  17. Offline


  18. Offline


    Cliffordlittle it's not the recommended CraftBukkit build, but ok. Next version uses a more generic approach to replace the chunk provider with a timed one.


  19. Offline


    22:03:46 [SEVERE] [NoLagg] Failed to initialize dummy world for manager replacement:
    22:03:46 [SEVERE] java.lang.NoSuchFieldError: chunkList
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyChunkProvider.<init>(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyWorld.<init>(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyWorld.<init>(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyWorld.<clinit>(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyPlayerManager.convert(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.antiloader.DummyPlayerManager.convert(
    22:03:46 [SEVERE]    at com.bergerkiller.bukkit.nolagg.chunks.NLCListener.onWorldLoad(
    22:03:46 [SEVERE]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    22:03:46 [SEVERE]    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    22:03:46 [SEVERE]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    22:03:46 [SEVERE]    at java.lang.reflect.Method.invoke(Unknown Source)
    22:03:46 [SEVERE]    at$1.execute(
    22:03:46 [SEVERE]    at org.bukkit.plugin.RegisteredListener.callEvent(
    22:03:47 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.fireEvent(
    22:03:47 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.callEvent(
    22:03:47 [SEVERE]    at net.minecraft.server.MinecraftServer.d(
    22:03:47 [SEVERE]    at net.minecraft.server.MinecraftServer.a(
    22:03:47 [SEVERE]    at net.minecraft.server.DedicatedServer.init(
    22:03:47 [SEVERE]    at
    22:03:47 [SEVERE]    at
  20. Offline


    carls1976 for now, put the 'use dynamic view' to false of the chunks component in config.yml. It clearly doesn't support the latest non-rb.
  21. Offline


    bergerkiller thanks for updating! I was missing NL. Now I can get my /nolagg fix :D

    edit: pun intended :p
  22. Offline


    I'm getting this alot since I've installed the latest dev

    22:22:15 [SEVERE] [NoLagg Saving] Failed to sync region data to file:
    22:22:15 [SEVERE] sync failed
    22:22:15 [SEVERE]      at Method)
    22:22:15 [SEVERE]      at com.bergerkiller.bukkit.nolagg.saving.RegionFileFlush
    22:22:15 [SEVERE]      at com.bergerkiller.bukkit.common.AsyncTask$
    Edit: someone else on BukkitDev for Nolagg posted a pastebin of it too, so I guess it's not just me. Damn Bukkit breaking my NoLagg!
  23. Offline


    09:37:17 [SEVERE] [NoLagg Examine] Failed to enable NoLagg component 'Examine':
    09:37:17 [SEVERE] java.lang.IllegalAccessError: tried to access class org.bukkit.craftbukkit.scheduler.CraftTask from class com.bergerkiller.bukkit.nolagg.examine.SchedulerWatcher
    09:37:17 [SEVERE]    at com.bergerkiller.bukkit.nolagg.examine.SchedulerWatcher.<clinit>(
    09:37:17 [SEVERE]    at com.bergerkiller.bukkit.nolagg.examine.NoLaggExamine.onEnable(
    09:37:17 [SEVERE]    at com.bergerkiller.bukkit.nolagg.NoLaggComponent.enable(
    09:37:17 [SEVERE]    at com.bergerkiller.bukkit.nolagg.NoLagg.enable(
    09:37:17 [SEVERE]    at com.bergerkiller.bukkit.common.PluginBase.onEnable(
    09:37:17 [SEVERE]    at
    09:37:17 [SEVERE]    at
    09:37:18 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    09:37:18 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.loadPlugin(
    09:37:18 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.enablePlugins(
    09:37:18 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.<init>(
    09:37:18 [SEVERE]    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(
    09:37:18 [SEVERE]    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    09:37:18 [SEVERE]    at net.minecraft.server.DedicatedServer.init(
    09:37:18 [SEVERE]    at
    09:37:18 [SEVERE]    at
    error on dev 2350
  24. Offline


    Puremin0rez could be CraftBukkit now synchs the files too, and it is conflicting. I'll take another look at the nms source at a later time.

    carls1976 I'm at a loss to how to fix that, really. Looks more like a classloader issue in Bukkit.
  25. Offline


    well if i go back to recommended build all works fine no errors something add in 2350 seems to break nolagg and factions
  26. Offline


    using the lastest recommended build i seem to have chunks not loading everytime i login
  27. Offline


    there still some hole on the ground :S and my server host dont have lastest craftbukkit version what do i do to fix the hole
  28. Offline


    chopstick121 oh that's a problem...for now just disable the chunks component then. I am now preparing a 1.3.2 build with all these things fixed. Fixing up the examiner right now...
  29. Offline


    what does chunks component do?
  30. Offline


    chopstick121 the chunks component sorts the chunks to send, to make sure it sends the visible chunks first. It also allows you to set a rate at which chunks are sent to the client, and adjusts this rate based on the client connection with the server. This ensures that low-connection players don't get DC'd because of 'overflow' exceptions, and still see the chunks below and near. It also reduces the chunk load lag when players join, because it lazy-loads the chunks before sending. So it spreads the chunk loading over several ticks. (part of the dynamic view distance that is applied as well)

    New version is up for CB 1.3.2 R0.1 (github)

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


    i added permission for default player to type /nolagg fix nolagg.fix it didnt let the default player type that command what can i do?

Share This Page