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

    PcPocket

    May I ask another thing, not very related.

    To turn on my server (CentOS) i'm using
    Would you recommend me more flags in this code to start up the server? Like anything to java garbage use another core or these things to boost performance. Thanks.

    I will add ur plugin and oreobsfuscator with chunk send turned off.
     
  3. Offline

    bergerkiller

    PcPocket nah garbage collection should not be adjusted whatsoever. Low memory usage does not equal high performance. It only means that your processor is busy clearing up tiny bits of data all the time, which is a complete waste of CPU power. (it has to go through all loaded data, including data in memory that can not be unloaded)
     
  4. Offline

    rtcabooservb

    Any ETA on the low priority build that I can test?
     
  5. Offline

    bergerkiller

    Attached Files:

  6. Offline

    PcPocket

    I did not want to focus on garbage, it was just an example. Any flag that would boost performance, with less CPU USAGE would be great, if there is any '-'
     
  7. Offline

    rtcabooservb

    Odd. Testing it, it lowered the packet load, but only by a slim amount. -899.96%.

    Edit: This is probably a stupid suggestions, but maybe possibly, the server is trying to load chunks for mobs? I doubt it, but who knows?

    bergerkiller
    Latest spout version.
    http://ci.getspout.org/job/SpoutPlugin/lastSuccessfulBuild/

    Latest CB version.
    http://repo.bukkit.org/content/grou...HOT/craftbukkit-1.1-R1-20120120.195601-80.jar

    All the latest dev versions available.

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

    bergerkiller

    rtcabooservb ok found out what the issue was. Without Spout the packer buffer load is correct (0.1-10%), as soon Spout got added the buffer size returned a negative (?!) value. My guess is that Spout renamed the field somehow, or isn't correctly using it.

    This, in turn, causes the sending rate to flip to minimal all the time, which results in that horribly slow sending rate.
     
  9. Offline

    rtcabooservb

    Any fix for it besides removing spout? Because I have plugins that depend on it.
     
  10. Offline

    bergerkiller

    rtcabooservb now browsing through Spouts source to find out where the issue lies.

    EDIT

    Sigh Spout what are you doing?
    Code:
    //Lower the active packet queue size in bytes by 9 megabytes, to allow for 10mb of data in a players queue
    try {
    Field x = NetworkManager.class.getDeclaredField("x");
    x.setAccessible(true);
    int size = (Integer) x.get(this.networkManager);
    x.set(this.networkManager, size - 1024 * 1024 * 9);
    } catch (Exception e) {
    e.printStackTrace();
    }
    I'll just add auto-adjustment on this Spout 'feature'...
     
  11. Offline

    rtcabooservb

    Take your time, but any ETA?
     
  12. Offline

    bergerkiller

    Attached Files:

  13. Offline

    rtcabooservb

    Lol I don't. Spout gives out warnings saying don't reload when trying to /reload.

    bergerkiller Awesome. Packet load 0%. Seems to be working. Slight thing I've noticed though so far that it might just be the unload delay, but when you spawn and chunks start to load first based on the direction you are currently facing, if you turn around, they load very slow. Not as slow as the -900%, but a big difference in speed compared to when first logging in.

    bergerkiller Another issue. =/

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    Might have to disable chunk sending again.

    bergerkiller Well, good luck with the testing. I'm going to head out to dinner now. I disabled chunk sending through nolagg so you won't be able to experience the issue if you decide to login to my server. Don't want my users to complain. =/ Good luck and I'll be back in a few hours.

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

    phanaticd

    latest version seems to load chunks painfully slow, disabling chunk sending speeds it right up
     
  15. Offline

    bergerkiller

    rtcabooservb Looks to me as if it threw away a pending chunk. When did this happen? Did it happen after joining, after teleporting or after flying really fast?

    Also, I'll sort the pending chunks/packets to save well. I guess it is currently sending packets behind you all the time...

    Updated it to 1.58.2, adding the latest changes and added sorting of the chunk compression/sending queues. It also correctly shows the sending percentages. I have no idea if this solves your issues entirely, consider it a desperate attempt.

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

    jjon43

    YES!!! It's working for me now without any errors. Finally no more ugly holes in the world that stay there until someone walks up to it. Thank you!
     
  17. Offline

    mario00037

    Where can I download build #1795?
     
  18. Offline

    Jrog

    The latest version seems to be teleporting, rotating, and duplicating chunks on both builds 1783 and 1796 when both NoLagg and Orebfuscator are running. There is no actual damage to the server files though, everything goes back to normal after disabling either one of the plugins.

    [​IMG]
     
  19. Offline

    phanaticd

    a line of chunks in the nether disappeared, and when i teleported out of the nether into the realworld the nether chunks kept showing up around me. and having chunk buffering and chunk sending still makes chunk loading way slower than if I turned them both off. And i am going to keep those both off because its only been 1 night and i already have deleted chunks, not going to go through that again

    now i got some null pointer thing which crashed my server yet again

    rm -rf NoLagg*

    im never using this plugin again

    edit: here is the error i got though, gl


    2012-01-21 17:37:27 [INFO] Fetching addPacket for removed entity: CraftItem
    2012-01-21 17:37:27 [SEVERE] java.lang.NullPointerException
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.NetServerHandler.sendPacket(NetServerHandler.java:685)
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.EntityTrackerEntry.b(EntityTrackerEntry.java:191)
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.EntityTracker.updatePlayers(EntityTracker.java:144)
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541)
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
    2012-01-21 17:37:27 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    2012-01-21 17:37:27 [SEVERE] Unexpected exception
    java.lang.NullPointerException
    at net.minecraft.server.NetServerHandler.sendPacket(NetServerHandler.java:685)
    at net.minecraft.server.EntityTrackerEntry.b(EntityTrackerEntry.java:191)
    at net.minecraft.server.EntityTracker.updatePlayers(EntityTracker.java:144)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
     
  20. Offline

    sagethor

  21. Offline

    bergerkiller

    sagethor a nice bukkit bug I only now notice...
    In short: when 'fetching dead item entities', it will throw that error and crash the server.

    Now the question: why does it send the spawn packet for a dead item? NoLagg's item stacker does set items dead (which is on another thread), but only of items that are already spawned and already have their spawn packet sent.

    The only possible way this can happen is if an item is set dead RIGHT when a player joins or gets in reach of an entity. I'll see how I can resolve it in the item stacker...

    Guess I'll have to schedule item stacking as well, and only perform the distance checks of items on another thread...

    Also, bye bye spout support, hello plugin-specific support...
    Jrog which Ore obfuscator did you use? There appear to be 5-6 plugins for it ...

    EDIT

    Fixed the NPE by untracking the item entity before setting it dead. I still don't know why sending is so slow though.

    I do know that on local servers (where I am), there is no connection delay, but everywhere else there is. Then why does the connection delay or the fact that there is a bandwidth cause it to send so slowly, while the rate shows up normal? Questions that are hard to answer...

    It can't be chunk compression, as that is pretty much instant...or is it? It does cycle through all players, maybe this causes a synchronization issue in the long run? Ugh this will be another long ride I'll have to go through with...
     
  22. Offline

    GameFAQsRolo

    Just for confirmation, for those of us using Spout with players using Spoutcraft, does NoLagg work fine out of the box or should we disable something (like chunksending)?
     
  23. Offline

    bergerkiller

    GameFAQsRolo it works fine with Spout alone, but as soon ore obfuscation plugins come into play it starts to fail. This, because those plugins store map packets, which is impossible with Nolagg. (packet data is re-used)

    Wait a sec...quote from page 82:
    How is that even possible? It then has to add some sort of extra load to the server somewhere, and that can explain the performance loss....

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

    sagethor

    bergerkiller
    Glad to say, problem has been fixed - Bukkit accidentally committed this before investigating possible bugs. Just have to update my CB version now.
     
  25. Offline

    bergerkiller

    Uploaded a test version of 1.58.3. If you use ore obfuscator, please disable it when you test it.

    Added some simple changes in the coding, including a fix in the view distance check. (which caused missing chunks previously). Also prevents fetching dead item entities. I honestly have no idea why chunk sending would be so slow, I couldn't find anything that relates to it. Sending = sending, there is no way around it. And chunks aren't infinitely sent after another either...so no overused packet sending.

    Also removed the 'boost', as I simply don't trust the entire boosting thing. (I had it disabled on my server all the time)

    Also, just wondering, does lowering the max send rate help? It's possible that it is simply set too high...
     
  26. Offline

    rtcabooservb

    I'll test it for you. :D

    Edit: Config still states that the boost is being used.

    bergerkiller With the .3 test version, packet load is abnormally higher than usual and spiking quite a lot. With the .1 version, I was always at 0-15%. Now I'm spiking around 50-90%.

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

    bergerkiller

    rtcabooservb Wut 50-90%?! That is crazy! And what is the sending rate?
     
  28. Offline

    rtcabooservb

    Chunk sending 100% of 441 at 0.25 chunks/tick. D: It use to be 2!! And packet load is around 80-95% right now.
     
  29. Offline

    bergerkiller

    rtcabooservb that is kinda obvious, it has to slow down the sending if the buffered size is reaching the maximum. At 100% packet load you'll get an overflow error and disconnect. But why can't it send chunks at 0.25/tick (5/second?)
    That is only 5*5 = 25 kb/s...

    EDIT

    Wait it's at 100%...so nothing is going on. There is nothing to send...
    Then why the high packet buffer? What is causing so much load?
     
  30. Offline

    rtcabooservb

    ;_; I never had it drop down below 2 before, even at 100%.
     
  31. Offline

    killerciao

    Code:
    2012-01-22 01:16:25 [WARNING] Could not properly handle event PLAYER_TELEPORT:
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: com.cypherx.xauth.xAuth$2
        at org.bukkit.event.player.PlayerListener.onPlayerTeleport(PlayerListener:0)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:328)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:327)
        at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(CraftPlayer.java:299)
        at org.bukkit.craftbukkit.entity.CraftEntity.teleport(CraftEntity.java:157)
        at com.cypherx.xauth.xAuth$2.run(xAuth.java:302)
        at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2012-01-22 01:16:25 [INFO] This error is logged only once: it could have occurred multiple times by now.
    2012-01-22 01:16:25 [INFO] Please contact one of the authors of plugin 'xAuth': CypherX
    2012-01-22 01:16:34 [INFO] [xAuth] killerciao has logged in
    2012-01-22 01:16:44 [INFO] <*Illuminati [Owner]killerciao> test
    2012-01-22 01:17:07 [INFO] <*Illuminati [Owner]killerciao> hero
    2012-01-22 01:17:14 [INFO] [PLAYER_COMMAND] killerciao: /help herochat
    2012-01-22 01:20:19 [INFO] /176.31.103.83:36906 lost connection
    2012-01-22 01:21:10 [INFO] /176.31.103.83:37368 lost connection
    2012-01-22 01:22:10 [SEVERE] java.lang.NullPointerException
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.NetworkListenThread.a(SourceFile:63)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:154)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.Packet254GetInfo.handle(SourceFile:16)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:47)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.NetworkListenThread.a(SourceFile:94)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:536)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
    2012-01-22 01:22:10 [SEVERE]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    i'm getting this error! i use xauth and oreoffuscator and i dont have spouth
     

Share This Page