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

    bergerkiller

    @Fr0zenfr0g You don't have to choose. You can pretty much disable all features of NoLagg you don't like.
    Chunk issues? Remove add-on, set sendChunkInterval to 0, unloadDelay to 0.
     
  3. Offline

    Jdbye

    Bukkit told me to nag you about this:
     
  4. Offline

    bergerkiller

    @Jdbye Why...so many times? D:
    Also, that is a common Bukkit bug where, even after cancelling Async tasks, this message is displayed in the log. Not an issue, just Bukkit being overprotective...
     
  5. Offline

    Zathras

    @bergerkiller Thanks for the updates. I'm now running 1.25 with Chunks 1.02. It took me a minute to figure out what you meant by combining the parameters, but I figured it out and took out the obsolete one. I also set my chunk send interval at 4 ticks. I'll let you know if I see any issues.

    Thanks again for being active. Kudos.
     
  6. Offline

    Borch

    So, 1.2 did not help, back to 1.25 then, also using Spout and the Chunk addon now to see if that fixes my problems. If I only knew what I did there :/
     
  7. Offline

    Jdbye

    Don't ask me, that's what showed up in the console :p
    Still, if you can, you might want to do something about it so the message isn't displayed.

    Those duplicate messages seem to happen a lot after updating to 1.8.1, duplicate "Saving chunks" messages, duplicate messages from AutoSave, duplicate messages from /say, etc. Only duplicate in the console though, shows up once like normal ingame.
     
  8. Offline

    bergerkiller

    @Jdbye I wish that was possible...lol

    Also, I'll implement some changes.
     
  9. Offline

    Tubbytoad42

    This plugin is great for removing lag from TNT detonations, but it seems to be incompatible with some elements of the log block plugin. When you detonate tnt with this plugin installed logblock doesn't see it as a change happening (you can't rollback explosions), but when this plugin is not installed you can rollback as normal. Any way to fix this?
     
  10. Offline

    bergerkiller

    @Tubbytoad42 I'll look into that. First an emergency update to prevent chunks near players from unloading, because this is happening atm.

    EDIT

    I'll make the explosion occur one tick after the explosion event so logblock and others can read the blocks before the explosion. :)
     
  11. Offline

    Tubbytoad42

    @bergerkiller

    Ok, thanks. This plugin is amazing at exploding TNT without lag, detonated several thousand seamlessly :) (on a test world).
     
  12. Offline

    bergerkiller

    Updated it, hopefully fixing the missing chunk issues. Also some other minor changes, see changelog.

    (Please, PLEASE, let this fix work...)

    IMPORTANT: explosions are now per tick, NOT per second! If you used a rate of 90 before, then this should be changed to around 4-5. 90 is far too much!
     
  13. Offline

    Zathras

    I'm now using it. :)
     
  14. Offline

    bergerkiller

    @Zathras better re-download; had to re-export because of /nolagg clear failing for TNT. (was because of the new delayed tnt ignition, detonation came after clearing)

    Version I just uploaded (see timestamp this post) is the correct one. (no version increment)
     
  15. Offline

    QQCucumber

    Does this fix indoor rain too?
     
  16. Offline

    bergerkiller

    @QQCucumber I'm not sure. If it's caused by players being in unloaded chunks while they receive loaded chunks, then yes. I haven't really tested it though. You should be able to run without the add-on now, I added changes in the general unloaddelay feature. (it was forcing unloads even if there were players nearby, that's bad mkay :) )
     
  17. Offline

    Zathras

  18. Offline

    Flatliner

    *reworded my post a bit*

    Just detonated a ton of tnt with the first 1.26 build you put up (not the re-done one) and found that after a very smooth detonation, it hadn't actually logged anything in logblock. Not tested the last build you threw up yet so it's possible that's fixed it but just wanted to let you know.
     
  19. Offline

    cadwal

    So, there's a bug with this where occasionally chunks won't load and we have to restart the server for them to appear. I'm not sure if this has to do with our server host, the Plugin or client side communication though. The plugin is truly awesome though, we reduced our RAM usage by 500mb thanks to it.
     
  20. Offline

    Tubbytoad42

    @bergerkiller

    I downloaded the latest update (1.26) and it seems that unfortunately the same problem with TNT and LogBlock still occurs....perhaps something else is causing the issue?
     
  21. Offline

    ledhead900

    @bergerkiller
    Having any luck with the mob issue and rain, I too agree with Mrchasez you guys should work on one entire plugin, he has a nack for keeping the ram low and you cpu usage, Combine the two and have a lightweight solution for all lag for big servers and small multimap servers a like.

    @Mrchasez
    Currently I can't seem to get the mob side of this to behave it self maybe I need a higher mob count I dunno but all mobs get reset when then update interval ticks over. Bergerkiller knows more about this as he saw it first hand. http://forums.bukkit.org/threads/fi...on-your-server-1185.36986/page-13#post-719305 with JUST spout and it happens for me but berger cannot replicate it on his side.

    #edit
    damn it this is what I get for doing yet another all nigher, Completely missed version 26 update I will test this and report back as soon as I am able.


    #edit
    - spawnhandler slightly improved: wasn't properly handling creaturespawn.

    ^ back to the drawing board :( , Nothing is coming out of them still for me on a clean test server with only spout and this installed. Maybe you should add a special case for letting them bypass the restrictions altogether just like custom mob spawning, this would be useful for servers like mine where we want to keep mob spawners and create custom ones but control the natural spawning of creatures, Think about it you can remove a mob spawner! if you don't like it.
     
  22. Offline

    Tanite

    That reads a touch strange as an opening message. The plugin looks nice though :D
     
  23. Offline

    kawiz

    Loaded the plugin, didn't touch any config.

    Got this:

    Code:
    00:48:26 [SEVERE] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
    00:48:26 [SEVERE] at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    00:48:26 [SEVERE] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    00:48:26 [SEVERE] at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    00:48:26 [SEVERE] at java.io.DataOutputStream.flush(DataOutputStream.java:106)
    00:48:26 [SEVERE] at net.minecraft.server.NetworkWriterThread.run(SourceFile:104)
    Had to remove it, but damn it was causing less lag there for a sec!
     
  24. Offline

    Fr0zenfr0g

    good, i use loggblock
     
  25. Offline

    Zone

    Worldedit when copying lots of blocks crashes the client with this plugin. I need to do more testing before I'm sure tho.
     
  26. Offline

    Fr0zenfr0g

    it does not rain inside with the newest version
    edit: ok, it do rain inside... :(
     
  27. Offline

    bergerkiller

    Let's do this...leeroooooooy...jk. :D

    Achem.

    @Flatliner @Tubbytoad42 I'll look at the source of logblock and see if I can change anything. I could also make my plugin load after logblock (softdepend) so it will handle the explosion event after logblock. EDIT: It should just work fine, or am I missing something? What is supposed to happen when a TNT block explodes and destroys some blocks?

    @Fr0zenfr0g I'll disable the entire chunkload-on-click-stuff for now, until chunks are correctly send it is not a good idea.

    @Zone this is pretty hard to prevent, you would need an async task being run whenever the main thread loses 'power'. But, since it's never a good idea to use Bukkit methods in Async calls, I won't implement such a feature yet. Complain at Worldedit for this. :)

    @ledhead900 the slight change is that of no longer showing ghost mobs. I am not sure of why no pigzombies spawn on the server...got no explanation for it. (since it did spawn at my server using you settings) It is possible to keep track of entities' origins, but it would make it lag more.

    @kawiz I'll look at the error thrown, I expect the async packet sending is causing more issues, but not sure...Also, you got some more of the stacktrace? Because that error doesn't show the origin/exception thrown.
     
  28. Offline

    Flatliner

    Logblock doesn't really do anything special with tnt that I know of. When you detonate tnt, it just logs all of the blocks damaged by the explosion. As it is at the moment, if tnt is detonated with nolagg installed absolutely nothing gets logged. All of the blocks damaged by the tnt just say there is no history, and there's nothing in the queue after the explosion so it's not that the history hasn't been saved yet or anything.
     
  29. Offline

    bergerkiller

    @Flatliner In other words: it reads the blocks after the explosion, where blocks already turned into air...I see.
    I'll install LogBlock, can you give me a very simple steplist of how to reproduce it in LogBlock? Do I need certain settings, commands, etc? (Never used it before, better make it a quick test)

    EDIT

    Ow dear...it doesn't even load up for me! :/
    Code:
    18:42:24 [SEVERE] Error occurred while enabling LogBlock v1.31 (Is it up to date?): null
    18:42:24 [SEVERE] java.lang.NullPointerException
        at de.diddiz.LogBlock.LogBlock.onEnable(LogBlock.java:144)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:920)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:410)
        at org.bukkit.Bukkit.reload(Bukkit.java:173)
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:353)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:349)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:499)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:478)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  30. Offline

    Flatliner

    The only setting you might need to change with logblock is to enable explosion logging, I think it's set to true by default, but worth double checking.

    After it's installed, place a couple of blocks of tnt and blow them up. give it a few seconds to save to the db and then type:

    /lb player tnt

    It should print a bunch of messages like this if it worked:

    "TNT destroyed grass"
     
  31. Offline

    bergerkiller

    @Flatliner does it even work for 1.8? It doesn't load up here...
    Also, how to set it up w/o a DB?
     

Share This Page