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


    @kalez that part of the code is synced. It is impossible for errors to occur there: it can only be another (badly made) plugin which alters the entity list from another thread. Plugin list?
  3. Offline


    Is this compatible with the Ore to client obfuscation plugin? They both use spout, and don't really want to mess my map :D
  4. Offline


    @w000rm was compatible the last time I checked.
  5. Offline


    BugReport: With nolagg chunks, when going to a new world, the chunk you are standing on is a beta hole and you need to relog for it to appear. No beta holes when removing nolagg chunks.
  6. Offline


    @rtcabooservb It doesn't happen when joining for the first time?
  7. Offline


    It is possible that it is the Glowstone Lanterns one because it occurs right after that in the log/console WHEN it occurs.

    -BOSEconomy, CartJump, ConsoleName, DeathPenalty, DoorsOpenDoors, Fruitful, GlowstoneLanters, GoldenTools, LagMeter, MCDocs, MobBounty, MonsterHunt, MusicCraft, MyBed, NoLagg, PaintingSwitch, PlugMan, PortalStop, PorteCoulissante, Register, RetractableBridge, Safe Creeper, SheepFeed, Showcase, SpawnMob, Tables, ToughMelt, Transporter, WeatherRestrictions, WolfPound, WorldEdit, WorldGuard, Dynmap, iEmotions, Nanobots

    i think thats all of them that were enabled when it occured. Also it happened near the end of the reload/restart list, if that helps.
  8. Offline


    It only happens when you teleport from world to world, (going to nether and back, etc)
  9. Offline


    @rtcabooservb try this:
    If that solves the issue, then I know where to look. (it could easily be something left unnoticed by me because of instant connections)

    @kalez I don't think that a block plugin get to alter the world entity list from another thread...
    Looked at the plugins but couldn't spot one real quick. I'll look deeper into it...
  10. Offline


    Okay, I'll test it.
  11. Offline


    craftbukkit 1510
    nolagg ver 1.49
    not nolaggchukns

    10:29:35 [SEVERE] [NoLagg] Failed to spawn block drops during explosions!
    10:29:35 [SEVERE] java.lang.NoSuchMethodError: net.minecraft.server.Block.dropNa
    10:29:35 [SEVERE]       at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplo
    10:29:35 [SEVERE]       at com.bergerkiller.bukkit.nolagg.TnTHandler.createExplo
    10:29:35 [SEVERE]       at com.bergerkiller.bukkit.nolagg.NLEntityListener.onEnt
    10:29:35 [SEVERE]       at$66.execute(Ja
    10:29:35 [SEVERE]       at org.bukkit.plugin.RegisteredListener.callEvent(Regist
    10:29:35 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.callEvent(Simpl
    10:29:35 [SEVERE]       at net.minecraft.server.Explosion.a(
    10:29:35 [SEVERE]       at net.minecraft.server.World.createExplosion(
    10:29:35 [SEVERE]       at net.minecraft.server.WorldServer.createExplosion(Worl
    10:29:35 [SEVERE]       at net.minecraft.server.EntityTNTPrimed.explode(EntityTN
    10:29:35 [SEVERE]       at net.minecraft.server.EntityTNTPrimed.w_(EntityTNTPrim
    10:29:35 [SEVERE]       at net.minecraft.server.World.entityJoinedWorld(World.ja
    10:29:35 [SEVERE]       at net.minecraft.server.WorldServer.entityJoinedWorld(Wo
    10:29:35 [SEVERE]       at net.minecraft.server.World.playerJoinedWorld(World.ja
    10:29:35 [SEVERE]       at net.minecraft.server.World.tickEntities(
    10:29:35 [SEVERE]       at net.minecraft.server.MinecraftServer.w(MinecraftServe
    10:29:35 [SEVERE]       at
    10:29:35 [SEVERE]       at
  12. Offline


    @arsjet use the v1.00 version for Craftbukkit 1510 (mc 1.00)
  13. Offline


    Havent changed any plugins since last time i posted, but when i reloaded just a moment ago, i got:

    2011-11-28 09:10:49 [SEVERE] [NoLagg] An error occured while performing a routine update:
    2011-11-28 09:10:49 [SEVERE] java.util.ConcurrentModificationException
    2011-11-28 09:10:49 [SEVERE] at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    2011-11-28 09:10:49 [SEVERE] at java.util.ArrayList$ Source)
    2011-11-28 09:10:49 [SEVERE] at com.bergerkiller.bukkit.nolagg.Util.fillEntities(
    2011-11-28 09:10:49 [SEVERE] at com.bergerkiller.bukkit.nolagg.NoLagg$
    2011-11-28 09:10:49 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-11-28 09:10:49 [SEVERE] at net.minecraft.server.MinecraftServer.h(
    2011-11-28 09:10:49 [SEVERE] at
    2011-11-28 09:10:49 [SEVERE] at
    2011-11-28 09:10:49 [SEVERE] Could not pass event ITEM_SPAWN to NoLagg
    at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    at java.util.ArrayList$ Source)
    at com.bergerkiller.bukkit.nolagg.Util.fillEntities(
    at com.bergerkiller.bukkit.nolagg.StackFormer.stackNear(
    at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(
    at net.minecraft.server.World.addEntity(
    at net.minecraft.server.World.addEntity(
    at org.bukkit.craftbukkit.CraftWorld.dropItem(
    at org.bukkit.craftbukkit.CraftWorld.dropItemNaturally(
    at com.narrowtux.showcase.ShowcaseItem.respawn(
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    at net.minecraft.server.MinecraftServer.h(
    2011-11-28 09:10:49 [SEVERE] Could not pass event ITEM_SPAWN to NoLagg
    at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    at java.util.ArrayList$ Source)
    at com.bergerkiller.bukkit.nolagg.Util.fillEntities(
    at com.bergerkiller.bukkit.nolagg.StackFormer.stackNear(
    at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(
    at net.minecraft.server.World.addEntity(
    at net.minecraft.server.World.addEntity(
    at org.bukkit.craftbukkit.CraftWorld.dropItem(
    at org.bukkit.craftbukkit.CraftWorld.dropItemNaturally(
    at com.narrowtux.showcase.ShowcaseItem.respawn(
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    at net.minecraft.server.MinecraftServer.h(
    no idea lol. by the way, how do you make spoilers in posts?
  14. Offline


    @kalez impossible to happen unless another plugin is altering the entity list from another thread. No idea where or what plugin, but it's happening...

    This is what I mean: impossible to get a concurrency exception here unless the entityList is altered from another thread:

    public static void fillEntities(WorldServer world, List<Item> items, List<ExperienceOrb> orbs, List<org.bukkit.entity.Entity> all) {
        for (Object obj : world.entityList) {
            if (obj instanceof EntityItem) {
                Item item = (Item) ((EntityItem) obj).getBukkitEntity();
                if (ItemHandler.isShowcased(item)) continue;
                if (items != null) items.add(item);
            } else if (obj instanceof EntityExperienceOrb) {
                ExperienceOrb orb = (ExperienceOrb) ((EntityExperienceOrb) obj).getBukkitEntity();
                if (orbs != null) orbs.add(orb);
            if (all != null) all.add(((Entity) obj).getBukkitEntity());
    To make spoilers, use [spoiler ] and [/spoiler ]

    @Sergeant1337 thanks for the awesome feedback which will be of great help. Please follow the following steps to get rid of it:

    What is the problem? Why don't you read the main page thoroughly so you can KNOW I will ask you what type of lag you have etc and to use /nolagg monitor, ugh kids these days. And don't do the above or you must have an IQ < 5

    Adding to that, using improper configuration can mess things up. Same applies to using the wrong version for the wrong CB build.

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


    You shouldn't post such shit bergerkiller. Thought Sergeant1337 would deserve it with his bad manner, someone else might try this either.
  16. Offline


    @Sepulzera I know, but I am kinda getting tired of people posting 'rage posts' that don't help anyone ever. It's like going to a debate and then yelling 'I am against because you have a shitty idea!' and then throw poop at the other party. Seriously, I know there are some 13yr olds around here that expect everything to be done for them, but some constructive posts on their side is appreciated sometimes -.-

    @Sergeant1337 that's a lot better. Now, as you see in the main page, you can see that I can't reduce lag occuring when using Worldedit because it would corrupt the world and/or cause lots of errors. Believe me, I tried it, didn't work out too well...
    Your best bet is to use an alternative world editing plugin which supports something called 'synced world editing'. It basically separates the large task into multiple smaller tasks to keep the server tick rate alive.

    I don't have a clear example right here, but I believe VoxelSniper has some good features which uses this.

    Also, edited the post so people with an IQ < 5 won't actually do it.

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


    If you removed the jar (NoLagg.jar), its not affecting your outcome at all. It means your server/network/computer/something else is causing the slowness.

    on a side note, you can try //fast (worldedit command)
  18. Offline


    No idea man, lol, I'm just passing on the errors I'm getting
  19. Offline


    It started acting like this after I installed this plugin.

    And a computer with an Intel core i7, 8GB ram and a network speed of 100 MB download and 10 MB upload should not have a problem with 1890 blocks. Again, if worked perfectly to edit 1 million blocks before I installed this plugin.

    With //fast I have to rejoin the server to see any changes
  20. Offline


    @Sergeant1337 I have no idea how you ever managed to make this happen, since I use world edit as well and perform 100K edits and it takes less than a second and is instant. Why does it do it block by block there? No idea, never happened to me when using WorldEdit. (or you have a 200mhz computer which I doubt...)

    TBH it even speeds it up for me. Instead of instantly sending the new chunks NoLaggChunks makes sure it sends them one by one. This saves the client network usage when a lot of block/chunk changes are performed.

    Also, adding to your post, it is impossible for another plugin to make that happen. My guess is that your WorldEdit settings got changed, the same points to that whe nyou stated that after removing NoLagg the issue didn't change.

    TLDR; take a firm look at your worldedit plugin configuration. Somebody on your server must have f'ed it up.
  21. Offline


    Okay, I will check....
  22. Offline


    Some feedback on the 1.0 test version (running both plugins + spout 555):
    Any plans/ideas to prevent the dummy world from triggering events? My plugin got a bit confused when it received an onChunkLoad for a world named "dummy" ;)
    I mean I quickly added a check for that world name, but it would be nicest if this wouldn't even happen.

    I have two worlds and in my onPlayerPortal code I simply make players go to the other world by doing event.setTo(<some location in the other world<)
    Now it happens that the chunk the player arrives in plus all the surrounding chunks (so 9 chunks on total) do not load. All the others around these do. Only a rejoin fixes that. I also tried /nolagg fix which does indeed load the missing chunks, but then you're somehow stuck in the ground (but thats a Minecraft issue I guess)

    Other than that, no issues so far.
  23. Offline


    @Borch thanks for the report, I'll see what I can do about the dummy world not being dereferenced from the server entirely. (could be a function in the world constructor I have forgotten to handle)


    Following issues found and fixed:
    - Chunks not being sent correctly when a player is teleported using event.setTo()
    - Dummy world chunks getting loaded: fixed using overrided methods:
                dummyWorld = new WorldServer(((CraftServer) getServer()).getServer(), datmanager, worldname, 0, new WorldSettings(0, 0, true, false), Environment.NORMAL, null) {
                    public void c() {};
                    public void g() {};
                    public IChunkProvider b() {return null;}
    After testing it is now uploaded: updated to v1.50
  24. Offline


    I got this error on console being spammed:

    [WARNING] Entity is at -81.5,303.5 (chunk -6,18) but was stored in chunk -6,19

    We're on CB 1337 and NoLagg 1.49.3 and NoLaggChunks with Spout.

    Config.yml on the spoiler
    Show Spoiler
    bufferItems: true
    bufferTNT: true
    useSpawnLimits: true
    useChunkUnloadDelay: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    maxItemsPerChunk: 40
    formItemStacks: true
    chunkUnloadDelay: 10000
    autoSaveInterval: 400
    updateInterval: 20
    stackRadius: 1.0
    stackThreshold: 2
    monitorInterval: 40

    At coords (-81,5 ; 303.5) there is a ShowCase shop. Also, most items on ShowCase are duping (I received a stack of 64 wools from a duped Showcase item!)

    Everything else is just great. We have now much less lag!

    Thanks for your attention.
  25. Offline


    @agubelu Could be related to the unload delay stuff, can't remember if a world unload event was fired when the chunk was actually unloaded...
    Problem is I moved to 1.00, so can't do much for 1337. Try disabling chunk unload delays for now, I'll fix it in the new 1.00 build once I get around it...
  26. Offline


    Hello everyone. I'm sending this message from another world... that has loaded chunks around the portal. :)

    The dummy events also are gone. Great job!
  27. Offline


    I do love your plugin, but I've decided to just disable nolagg chunks. I perform better without it and chunks load much much much faster. Yes I've tried configuring the config. Keep up the good work, I'll still be using nolagg main jar.
  28. Offline


    @rtcabooservb it's obvious that NoLaggChunks sends out chunks slower: it buffers them. It's sole purpose is to keep the network connection responsive when:
    - a new player joins
    - a player flies around quickly
    - someone decides to worldedit a HUGE area resulting in a lot of chunk updates being sent out at once
    - in general to let smaller block changes be sent before and in between the larger chunks are sent around the player.
    So yes, for single-player or < 5 player servers it is pretty much useless, but above that it can greatly stabilize the server and even increase the player cap.
  29. Offline


    Hehe, I currently run a 40 person server with about 200 users. Going to upgrade the cap soon. I'll use nolaggchunks, but you'll have to give me the recommended settings for Nolagg and chunks. :p Also, using ptweaks with chunk persistence disabled, does it have any conflictions with nolagg?
  30. Offline


    I love you, I tested it by doing an ion cannon with a radius of 10 and the server never stopped responding!
  31. Offline


    @rtcabooservb See the main page, PTweaks does not add much to NoLagg in terms of features. Since I started implementing (and improving) Performance Tweaks features before PTweaks I doubt PTweaks has features NoLagg doesn't have...

Share This Page