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

    StevenIsBallin

    yea that was the problem, all fixed now thanks
     
  3. Offline

    Flatliner

    I hate to be the bringer of bad news but once again, with 1.49.2 chunks, I've managed to find signs with missing text. I didn't get any complaints from my users over night, but I joined the server a few minutes after the daily reboot this morning and found 4 signs with blank text scattered about (fixed after fixing lighting in the area).

    Curiously, there never seems to be more than one blank sign in a chunk, though that probably doesn't point to any reason for it happening.

    Despite finding the 4 signs just now, it does seem like overall this issue happens less often than it did, so your tweaks are certainly helping and it won't be stopping me from keeping the plugin installed.
     
  4. Offline

    Zathras

    @bergerkiller This is why I'm a bit gun-shy now. I'm still going to wait until you can more definitively solve this.
     
  5. Offline

    bergerkiller

    @Flatliner interesting...
    Just in case, I'll make sure sign text/entity spawn packets are sent at the very last moment, instead of counting on the internal list to be built-up correctly. I'll see what I can do :)
     
  6. Please update to minecraft 1.0
     
  7. Offline

    bergerkiller

    @vicente947 soo is 1.00 just as laggy as 1.81 was? xd
    I'll soon step to v1.0.0 too, but it doesn't have a recommended build yet. Rather wait for that to be sorted out, but will prob add a 1.00 link too.
     
  8. I update to 1.0.0 but i do a full backup of 1.8.1 in other site to save all data.
     
  9. Offline

    GOMW_4_GENERAL

     
  10. Offline

    ledhead900

    @bergerkiller
    Nolagg - without nolaggchunks currently do not function on 1.0 CB dev builds, I don't expect anything to be done until Reco but this is just a heads up. Also I have suggestion/request.

    Spout is not available yet for 1.0 dev builds so that explains why chunk addon and myworld timelock does not work.

    Suggestion
    Unload Mobs when chunks unload, Specifically ability to at the very least unload squids on chunkunload, as your probably aware squids lag servers due to the way they actually work and it would be nice to get rid of them when the chunks not in use, as far as I remember squids remain loaded even when the chunk is not.

    I was going to outright remove them with mob disable and add ink to creepers even still I would like to unload mobs in unloaded chunks with exceptions.

    actually you could just apply your mob control code but instead call them to be unloaded this way I can keep animals - squids but unload hostile mobs reducing ram and cpu usage even more while maintain persistency of useful mobs.
     
  11. Offline

    bergerkiller

    @ledhead900 No you are wrong, when a chunk unloads it removes (sets dead) ALL entities and tile entities in that chunk, also squids and slimes. However, these mobs do stay behind in the chunk files in a separate NBT compound, it's possible to clear entities before saving.

    What about sorting the entity list a bit more? To remove far-away entities before near entities? Isn't entirely impossible :)

    Also, updated to v1.49.3 adding support for the latest 'Standalone Showcase' plugin recently released. Also added last-minute packet sorting when sending, to make sure the sign text packets are sent AFTER the block change packets. Hopefully this fixes all possible ways text was previously failing...
     
  12. Offline

    ledhead900

    Ah well thanks for clearing that up for me, I only heard this second hand so again thx, What your saying is your plugin/Vanilla will unload the mobs on chunkunload and only thing extra that could really be any of any use is to clear the NBT compound, but wouldn't clearing this compound clear the entities you want to stay persistent like sheep and other things like that.

    In anycase it must have changed as I can swear I remember being told that squids were the only exception to this back pre 1.8.

    I a have another question then hehe, would it be possible to get natural giants to spawn with some sort of loot if set by in plugin such as "Giant: 10" or something this would give giant a chance to spawn and replace another mob.

    I was thinking a lot recently and I wondered if there were any mob inventory plugins that did just that and nothing else, if not I was wondering if it was worth adding as a separate plugin /addon to nolaggs or myworld. I mean I could run 2 extra plugins that spawn giants and one for modifying the loot of mobs but I know you probably could make them more efficient.
     
  13. Offline

    winter4w

    I get
    Code:
    20:11:19 [SEVERE] java.util.ConcurrentModificationException
    20:11:19 [SEVERE]       at java.util.AbstractList$Itr.checkForComodification(Unk
    nown Source)
    20:11:19 [SEVERE]       at java.util.AbstractList$Itr.next(Unknown Source)
    20:11:19 [SEVERE]       at java.util.AbstractCollection.removeAll(Unknown Source
    )
    20:11:19 [SEVERE]       at net.minecraft.server.World.tickEntities(World.java:11
    07)
    20:11:19 [SEVERE]       at net.minecraft.server.MinecraftServer.w(MinecraftServe
    r.java:507)
    20:11:19 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:414)
    20:11:19 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:457)
    20:11:19 [SEVERE] Unexpected exception
    java.util.ConcurrentModificationException
            at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
            at java.util.AbstractList$Itr.next(Unknown Source)
            at java.util.AbstractCollection.removeAll(Unknown Source)
            at net.minecraft.server.World.tickEntities(World.java:1107)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:507)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:414)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    >
    ( 20:11:19 [SEVERE] java.util.ConcurrentModificationException\r\n20:11:19 [SEVERE]       at java.util.AbstractList$Itr.checkForComodification(Unk\r\nnown Source)\r\n20:11:19 [SEVERE]       at java.util.AbstractList$Itr.next(Unknown Source)\r\n20:11:19 [SEVERE]       at java.util.AbstractCollection.removeAll(Unknown Source\r\n)\r\n20:11:19 [SEVERE]       at net.minecraft.server.World.tickEntities(World.java:11\r\n07)\r\n20:11:19 [SEVERE]       at net.minecraft.server.MinecraftServer.w(MinecraftServe\r\nr.java:507)\r\n20:11:19 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer\r\nver.java:414)\r\n20:11:19 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour\r\nceFile:457)\r\n20:11:19 [SEVERE] Unexpected exception\r\njava.util.ConcurrentModificationException\r\n        at java.util.AbstractList$Itr.checkForComodification(Unknown Source)\r\n        at java.util.AbstractList$Itr.next(Unknown Source)\r\n        at java.util.AbstractCollection.removeAll(Unknown Source)\r\n        at net.minecraft.server.World.tickEntities(World.java:1107)\r\n        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:507)\r\n        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:414)\r\n        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)\r\n\u003e )
     
  14. Offline

    kahlilnc

    Newest update turns whole world into a void hole :O
     
  15. Offline

    cartman-2000

    The MC 1.0 update broke the chank handling so it can't save chunks off so the server will overload after some(not much more then an hour.) time and pretty much crash.
     
  16. Offline

    Flatliner

    Same as kahlilnc I'm also finding the lastest update stops all chunks from loading. Paintings still show though.
     
  17. Offline

    bergerkiller

    What is this I didn't even...

    Ow well hang on I'll try to fix this in a sec. You are free to revert back to .2 as the newer one hardly adds changes...

    EDIT

    Ok found it, forgot to make my own packet listener ignore the packet when sending...it's to expect when deciding 'ow why not' past midnight...
     
  18. Error in CB #1488.
    PHP:
    2011-11-23 15:55:07 [SEVEREjava.util.ConcurrentModificationException
    2011
    -11-23 15:55:07 [SEVERE]     at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
    2011-11-23 15:55:07 [SEVERE]     at java.util.HashMap$KeyIterator.next(Unknown Source)
    2011-11-23 15:55:07 [SEVERE]     at net.minecraft.server.World.a(World.java:2334)
    2011-11-23 15:55:07 [SEVERE]     at net.minecraft.server.ChunkLoader.a(SourceFile:140)
    2011-11-23 15:55:07 [SEVERE]     at net.minecraft.server.ChunkRegionLoader.a(SourceFile:84)
    2011-11-23 15:55:07 [SEVERE]     at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:152)
    2011-11-23 15:55:07 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkOperation.execute(ChunkOperation.java:147)
    2011-11-23 15:55:07 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkScheduler.run(ChunkScheduler.java:137)
     
  19. Offline

    bergerkiller

    @vicente947 Ugh great they made some 'nice' world referencing when saving chunks *sigh*
    I'll try to decompile the server and see what is going on...

    Aaah cool Notch added tick list saving...but it did kinda make my code break :/
    It's impossible to fix this 'safely'. I'll put a try-catch around it checking for that error and repeat until it works

    EDIT

    Re-uploaded 1.49.3, which should at least get rid of the error mentioned by vicente947. It can still occur though, but then that exception must fire 10 times in a row...
     
  20. Offline

    Adrenaline

    I Found this :p
    Build Bukkit: #1493
    NoLagg: 1.49
    PHP:
    2011-11-23 10:33:23 [INFODisconnecting Kales [/188.47.178.11:2092]: You are not white-listed on this server!
    2011-11-23 10:33:24 [SEVEREjava.util.ConcurrentModificationException
    2011
    -11-23 10:33:24 [SEVERE]     at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
    2011-11-23 10:33:24 [SEVERE]     at java.util.HashMap$KeyIterator.next(HashMap.java:841)
    2011-11-23 10:33:24 [SEVERE]     at net.minecraft.server.World.a(World.java:2334)
    2011-11-23 10:33:24 [SEVERE]     at net.minecraft.server.ChunkLoader.a(SourceFile:140)
    2011-11-23 10:33:24 [SEVERE]     at net.minecraft.server.ChunkRegionLoader.a(SourceFile:84)
    2011-11-23 10:33:24 [SEVERE]     at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:152)
    2011-11-23 10:33:24 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkOperation.execute(ChunkOperation.java:148)
    2011-11-23 10:33:24 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkScheduler.run(ChunkScheduler.java:137)
    2011-11-23 10:33:26 [INFODisconnecting fajcyk [/83.11.211.137:3136]: Outdated client!
     
  21. Offline

    bergerkiller

    @Adrenaline nothing I can do about it for now, it's a bit of a hardcoded 'issue' in 1.00. I either have to clone and implement my own save coding or somehow pass along a world that does not cause tick lists to get out of sync...

    Seriously Bukkit, it's time to synchronize your shit!
     
  22. Offline

    jjon43

    So, will you update it? You make it sound like you won't. Come on, for the 3 days that I've had this plugin, it was amazing. But now that I've updated, I'm :(.
     
  23. I have got this problem with nolaggchunks:
    PHP:
    2011-11-23 15:48:06 [SEVEREjava.util.ConcurrentModificationException
    2011
    -11-23 15:48:06 [SEVERE]     at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
    2011-11-23 15:48:06 [SEVERE]     at java.util.HashMap$KeyIterator.next(Unknown Source)
    2011-11-23 15:48:06 [SEVERE]     at net.minecraft.server.World.a(World.java:2334)
    2011-11-23 15:48:06 [SEVERE]     at net.minecraft.server.ChunkLoader.a(SourceFile:140)
    2011-11-23 15:48:06 [SEVERE]     at net.minecraft.server.ChunkRegionLoader.a(SourceFile:84)
    2011-11-23 15:48:06 [SEVERE]     at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:152)
    2011-11-23 15:48:06 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkOperation.execute(ChunkOperation.java:147)
    2011-11-23 15:48:06 [SEVERE]     at com.bergerkiller.bukkit.nolagg.ChunkScheduler.run(ChunkScheduler.java:137)
     
  24. Offline

    bergerkiller

    @jjon43 Ow I will update it, eventually. But it will be everything from easy...

    @vicente947 That's the tick list concurrency issue which I talked about before.
     
  25. Offline

    o0AzzA0o

    Im running nolagg on 1.0 on 2x 60 player servers ... i recomend reducing save interval to 200 and updating plugin + using another plugin to schedule saves once per 40 mins or so

    Id rather run this plugin with bugs then reduce slots by 20-30

    Nice work bergerkiller!
     
  26. Offline

    ledhead900

    I swear nobody reads before posting the same error again and again, lol poor you.

    Anyway I tried to warn you about the 1.0 dev builds ;), before peeps came and saying "FIX FIX FIX" no worrys you will work it out eventually.

    I just did not have the time to paste in the errors I got when I first tried, sorry about that.

    P.S I think the built in cache is a good thing at least now we get some bandwidth reduction from vanilla clients :).
     
  27. SORRY I DONT SEE :p
     
  28. Offline

    bergerkiller

    @ledhead900 Ow I am used to that, actually, I have to be used to that. :p
    As for now I have two options to fix the new saving system causing issues:
    1. Isolate the saving code and completely neglect ChunkLoaders/ChunkProviders when saving.
    It works, but can result in losing compatibility quickly and function naming issues.

    2. Pass along a 'dummy' world object stored on my own thread.
    The best bet, but I do need the ability to have at least one world object to work with. Then I can fill the tick lists in a generic fashion for this world for different chunks and pass it along in saving operations. Downside is that it could be hard to rename it properly, else it might just fail like that.

    Ooow if only the tick lists were stored in chunks instead of in the worlds, then I'd have no problems...
     
  29. Offline

    Greylocke

    So what's the advice for servers until the hashmap iterator issue is resolved? Other than ugly errors in the console, are there any possible problems?
     
  30. Offline

    bergerkiller

    @Greylocke in the latest upload I make it retry the saving operation for 10 times with a 10 ms interval, if even that fails then I have to re-do chunk saving. The problem is that it performs a tick list update every tick...it's hard to jump between a pause...I'll see what I can come up with tomorrow, for now, don't use it for 1.00 since it fails to save. (will cause chunks to never be saved, so don't use it for your own benefits, thank you)
     
  31. Offline

    Greylocke

    @bergerkiller thanks for the update! Looking forward to the fix -- you've got a great plugin!
     

Share This Page