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


    LogBlock is set up with a MySQL database. I can disable the compression in ServerLogSaver so it just moves the text files rather than compressing them.

    edit: And serverlogsaver only does it on certain intervals, it doesnt explain why the lag occurs all the time.
  3. Offline


    - Does this lag occur w/o NoLagg?
    - How many players are on that single world? Spreaded?
    - What happens w/o MCTelnet?
  4. Offline


    Slightly, not as badly though.
    Most. It's impossible to tell, I do not use any mapping plugins.

    My IPN stops working and the "command-line" via our website also stops working. I have been using it for months without issues. I don't think MCTelnet is the issue. It doesn't open any connections unless someone connects.
  5. Offline


    @ProjectInfinity You said not badly, what if you enable NoLagg and set:
    In the config.yml to false?

    I did notice a slighlty weak point in was loading all chunks visible to the one tick. This could cause issues at some point.
  6. Offline


    Alright, I'll try that.

    edit: Removing SpamHammer and using NoCheat's anti spam, disabling buffering items, the unload chunk feature and removing some garbage collection options (I don't know if I was too aggressive with them...) I am now at 12.3/20 TPS with 46 players immediately upon login.

    It could be our world as well, it is currently 5.8GB large.

    edit 2: 7 minutes later. 6.8 ticks. UGH.
  7. Offline


    Look a very great plugin, but i have a problem with it : when installed on my server, i can't break or place any block ! What can i do for fix the problem please ?
  8. Offline


    @Mike77 are you sure you are not at the spawn area, which is protected? You can set the spawn area size to 1 or something to fix this, or make yourself OP.
  9. Offline


    I am already op and i set the spawn protection to 0, but no changes ! =(
  10. Offline


    What are the rest of the mechanics behind unloading chunks? NoLagg allows me to set a delay on when chunks are considered "unloadable", but what happens then? How does CB/MC determine when to unload the chunk once the delay expires?
  11. Offline


    @Greylocke It basically handles onChunkUnload, cancels it the first time, puts the chunk with the time into a hashmap. It then unloads chunks in a scheduled task when they are considered unloadable (using the timestamp that was added in the map). Of course it also checks if players are near, and if so, instead of unloading update the timestamp.

    @Mike77 any world protection plugin you run?
  12. Offline


    No protection plugin !
  13. Offline


    ah. So NoLagg hooks it when CB/MC has already determined to unload it, then holds onto it until either the delay expires or it becomes active again.

    Do you know how CB/MC initially determined that the chunk should unload? Is it as simple as "chunk is outside of viewable radius"? I am trying to assess the overall effect of setting the delay.
  14. Offline


    I just saw that Nolagg is not the problem, but it's strange, it's when i've installed it !

    I have deleted Nolagg, but i have ever the protection problem ... Strange ...
  15. Offline


    @Greylocke yep, as soon the chunk is out of reach it gets unloaded. As soon it gets into view, it loads again. Thus, if players move from one chunk to the other frequently, it would load and unload the entire row (2*viewdistance + 1) of chunks, which is obviously not desired.
  16. Offline


    It unarchives it once, and it does it on its own by which I have no control.
  17. Offline


    Heads Up: NoLagg interferes with TNT explosions in 1.9 pre-5 w/ CB from 11/2 at

    "Explosion did not go as planned" followed by SEVERE errors.
  18. Offline


    this plugin is duplicating items.
  19. Offline


    @G!zmo-rus that comment truly helps me fix a duplication bug...NOT
    At least state when, what, why, and the plugin list. If it doesn't happen here, it can't be NoLagg alone.

    @GravelSocks ow I can easily fix that, hang on...


    Or not...can't get the dropped block from within the bukkit API :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Sep 9, 2018
  20. Offline


    when you break chest containing too many items it gives you more items, than were in chest. + on industrial craft server it happens when you die. e.g. you had 64 copper ore and 1 wire and after death and picking items you have 64 wires. deleting nolagg fixed that problems
  21. Offline


    @G!zmo-rus Neither of the two issues occur, had chest full of random-count items, broke it, got exactly the amount that was in it. What CB version and NoLagg version do you have? And what plugins?
  22. Offline


    Can someone explain to me exactly how moblimiting works? I wish to only set a total limit of what can spawn, I do not wish to to limit a certain mob (i.e. a amount of 5000 mobs globally). What would I need to put in my config for this to work? Whatever I did caused mobs to not spawn...
  23. Offline


    @ProjectInfinity this should work for global limits:
        mob: 5000
    In the newer CB build an indent of 2 spaces is used instead of 4.

    It could be that, if you set it to 100 for example, all mobs spawn only on a single world. In that case, also set a default to limit it per world. For example:

        mob: 200
        mob: 50
  24. Offline


    Here is the specific error from the above TNT issue with NL1.4/CBw/1.9pre-5:
    2011-11-03 15:28:04 [INFO] [NoLagg] Warning: explosion did not go as planned!
    2011-11-03 15:28:04 [SEVERE] java.lang.NoSuchMethodError: net.minecraft.server.Block.dropNaturally(Lnet/minecraft/server/World;IIIIF)V
    2011-11-03 15:28:04 [SEVERE]     at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplosion(
    2011-11-03 15:28:04 [SEVERE]     at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplosion(
    2011-11-03 15:28:04 [SEVERE]     at com.bergerkiller.bukkit.nolagg.NLEntityListener.onEntityExplode(
    2011-11-03 15:28:04 [SEVERE]     at$66.execute(
    2011-11-03 15:28:04 [SEVERE]     at org.bukkit.plugin.RegisteredListener.callEvent(
    2011-11-03 15:28:04 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.callEvent(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.Explosion.a(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.World.createExplosion(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.WorldServer.createExplosion(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.EntityTNTPrimed.explode(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.EntityTNTPrimed.x_(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.World.entityJoinedWorld(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.WorldServer.entityJoinedWorld(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.World.playerJoinedWorld(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.World.tickEntities(
    2011-11-03 15:28:04 [SEVERE]     at net.minecraft.server.MinecraftServer.w(
    2011-11-03 15:28:04 [SEVERE]     at
    2011-11-03 15:28:04 [SEVERE]     at
  25. Offline


    Could you add a setting to define a limit of items in a chunk, before they get stacked?
    Means when you destroy 3 blocks of dirt, that they won't get stacked, when the limit is 5? (example)

    Thought maxItemsPerChunk would to it, but it doesnt^^

    Edit: Maybe define formItemStacks as integer...
  26. Offline


    @Sepulzera it's a bit useless to do that IMO, why have 3 dirt items very near to each other?
  27. Offline


    Does the saving feature of this plugin actually work? With 95 users the following happens:
    ^ Over a time span of 5 minutes.
    The important part is TPS. A regular harddrive does about 140-200 TPS depending on RPM.

    Should it be that high when it doesn't do any writing other than every X specified tick? Which in my case is 4000 ticks.
  28. Offline


    @ProjectInfinity are you sure the saveInterval (config.yml) is not set too low? If it's at 0, you will have to change this. Also check the log if the auto save field could be bound to.


    Misread, but do check the log if the field was bound to.
    Adding to that, this plugin obviously doesn't stop other plugins from writing data. It is likely that LogBlock is logging lots of block placements, thus writing out data to the local database.
  29. Offline


    autoSaveInterval: 4000
    2011-11-04 16:29:04 [INFO] [NoLagg] Auto-save field bound to 'u'!

    It could be LogBlock, but I don't know. It seems to be a lot for just LogBlock.
  30. Offline


    @ProjectInfinity I guess that the server is saving the chunks when they unload. Else chunks would be lost, so it seems obvious. What if you increase the chunk unload delay to something like 30 seconds? (30000)
  31. Offline


Share This Page