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

    chopstick121 open up PermissionDefaults.yml and you see all the nodes. It is this node you have to use:
     
  3. Offline

    carls1976

    great work berger all seems to be working again fine with the latest
     
  4. Offline

    bergerkiller

    Uploaded a new version, which improves the readout of the thread lock notifier and fixes a possible NullPointer exception occurring. (only happened when no tasks were scheduled on the server, so most people didn't have problems...neither did I. This is for those that did have problems)
     
  5. Offline

    Mime21

  6. Offline

    Greylocke

    Mime21 if you look at the number of posts that bk makes in this forum, it is obvious that he isn't "ignoring the people". Just because your problem isn't fixed doesn't mean that it is being ignored.

    Whenever there are dramatic changes in Mojang's code, this sort of thing should be expected.
     
  7. Offline

    bergerkiller

    Mime21
    I am not ignoring people, it looks more like a thing that will always happen over time. People forget to collect dirt or stone drops they don't need, resulting in a lot of garbage items. The item buffer, or spawn limiter, eventually kicks in and starts buffering/cancelling these spawns. You can disable the features if you want.
     
  8. Offline

    Curtis3321

    http://pastebin.com/ZEjyVedi

    Help please =D
    Cwarp is out custom plugin which allows us to warp to places.

    And NoLagg is causing Chunks not to load.
     
  9. Offline

    bergerkiller

    Curtis3321
    (I already replied on dev bukkit, but I'll reply here too to continue it)
    Code:
    2012-09-02 16:47:37 [WARNING] Could not properly handle event PLAYER_CHANGED_WORLD:
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: java.util.concurrent.ThreadPoolExecutor$Worker
            at org.bukkit.event.Listener.onPlayerChangedWorld(Listener:0)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:339)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
            at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35)
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
            at net.minecraft.server.ServerConfigurationManagerAbstract.moveToWorld(ServerConfigurationManagerAbstract.java:412)
            at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(CraftPlayer.java:378)
            at org.bukkit.craftbukkit.entity.CraftEntity.teleport(CraftEntity.java:162)
            at eu.wServers.CWarp.CWarp$1.run(CWarp.java:43)
            at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:52)
            at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    2012-09-02 16:47:37 [INFO] This error is logged only once: it could have occurred multiple times by now.
    2012-09-02 16:47:37 [INFO] Please contact one of the authors of plugin 'CWarp': Wundark
    Can you interpret this correctly? You teleported a player from a 'Thread pool Executor', probably a timer task you started. Don't do this. You can not teleport players from another thread.
     
  10. Offline

    Curtis3321

    I changed it to be a sync thread
     
  11. Offline

    Mime21

    I did this 2 months ago.
     
  12. Offline

    bergerkiller

    Mime21 Then it probably slipped my mind, my bad. I often respond directly to alerts, a ticket system is something I often forget to check.
     
  13. Offline

    Afotai

    The changelog hasn't been updated since 1.83, where can I read up on the changed features / additions?
     
  14. Offline

    bergerkiller

    Afotai look on the download page of Nolagg on dev bukkit. I try to keep that updated whenever I upload something new there.
     
  15. Offline

    brord

    Does this work together with OreObfuscator>
    Did not read anything about it in the FAQ or on the dev page.
    Do i need to use the spout build for Oreobfuscator?
    Thanks in advance

    kwek20
     
  16. Offline

    bergerkiller

    brord I'm not sure if it is still compatible, haven't tested it for a while now. I didn't see any errors about it yet though. Can someone that uses Orebfuscator a lot clarify this? (I don't have an XRay mod running to test it properly)
     
  17. Offline

    brord

    I just tried it, and its working like a charm :)
     
  18. Offline

    chopstick121

    java.lang.ClassCastException: com.bergerkiller.bukkit.nolagg.spawnlimiter.EntityWorldWatcher cannot be cast to net.minecraft.server.WorldManager
    at net.minecraft.server.World.makeSound(World.java:769)
    at net.minecraft.server.EntityLiving.aH(EntityLiving.java:257)
    at net.minecraft.server.EntityLiving.z(EntityLiving.java:267)
    at net.minecraft.server.Entity.h_(Entity.java:216)
    at net.minecraft.server.EntityLiving.h_(EntityLiving.java:435)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1245)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:511)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1227)
    at net.minecraft.server.World.tickEntities(World.java:1125)
    at net.minecraft.server.WorldServer.tickEntities(WorldServer.java:428)
    at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:563)
    at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:213)
    at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:473)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:405)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
     
  19. Offline

    bergerkiller

    chopstick121
    • Are you using a custom CraftBukkit build?
    • If so, notify them they made an error: They have to cast to IWorldAccess and not WorldManager (although the WorldManager is generally the only one there, plugins can add their own as well!)
    • If not, what CraftBukkit build is this on?
     
  20. Offline

    chopstick121

    Im using CB++ is there another way?
     
  21. Offline

    bergerkiller

    chopstick121
    What CB++ build are you using? I checked their source code, but it appears it is fixed there then. And a while ago, too...
     
  22. Offline

    Brady_

    Correct me if I'm wrong, but what I gather from the OP is that this doesn't work with WorldEdit, or at least it doesn't work well..? Sounds like an amazing plugin but I can't imagine not having WorlEdit running.
     
  23. Offline

    chopstick121

  24. Offline

    bergerkiller

    Brady_
    No no, it is compatible, it only doesn't prevent the lag occurring when you mass-change a lot of blocks. People think NoLagg can do that (or any plugin for that matter), but it can't.

    chopstick121
    Oh Spigot, that explains a lot. There were compat. issues before. I'll take a look and take possible action to fix it.

    EDIT

    Spotted the error: Link

    I'll inform the dev teams to fix this.
     
  25. Offline

    chopstick121

    thank you very much

    bergerkiller
    Is it working yet or you still working on it ?

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

    bergerkiller

    chopstick121
    I fixed your error already myself, but I'm still working on it. It is being delayed because of TrainCarts; there might be bugs in BKCommonLib that cause then. When TC is done, NoLagg is instantly done as well.
     
  27. Offline

    chopstick121

    Ok but my server is starting to lag
     
  28. Offline

    Icee2199

    I get this:
    Code:
    19:27:04 [WARNING] [NoLagg TLN] The main thread is still stuck, updated stack tr
    ace is:
    19:27:04 [INFO]    at com.maxpowa.nightlight.NightLight.createPermissableLight(
    NightLight.java:338)
    19:27:04 [INFO]    at com.maxpowa.nightlight.NightLight.onPlayerMove(NightLight
    .java:155)
    19:27:04 [INFO]    at sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Sou
    rce)
    19:27:04 [INFO]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown S
    ource)
    19:27:04 [INFO]    at java.lang.reflect.Method.invoke(Unknown Source)
    19:27:04 [INFO]    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPlu
    ginLoader.java:330)
    19:27:04 [INFO]    at org.bukkit.plugin.RegisteredListener.callEvent(Registered
    Listener.java:62)
    19:27:04 [INFO]    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePlu
    ginManager.java:477)
    19:27:04 [INFO]    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePlu
    ginManager.java:462)
    19:27:04 [INFO]    at net.minecraft.server.NetServerHandler.a(NetServerHandler.
    java:213)
    19:27:04 [INFO]    at net.minecraft.server.Packet10Flying.handle(SourceFile:136
    )
    19:27:04 [INFO]    at net.minecraft.server.NetworkManager.b(NetworkManager.java
    :276)
    19:27:04 [INFO]    at net.minecraft.server.NetServerHandler.d(NetServerHandler.
    java:109)
    19:27:04 [INFO]    at net.minecraft.server.ServerConnection.b(SourceFile:35)
    19:27:04 [INFO]    at net.minecraft.server.DedicatedServerConnection.b(SourceFi
    le:30)
    19:27:04 [INFO]    at net.minecraft.server.MinecraftServer.q(MinecraftServer.ja
    va:581)
    19:27:04 [INFO]    at net.minecraft.server.DedicatedServer.q(DedicatedServer.ja
    va:212)
    19:27:04 [INFO]    at net.minecraft.server.MinecraftServer.p(MinecraftServer.ja
    va:474)
    19:27:04 [INFO]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.
    java:406)
     
    
     
  29. Offline

    JacobSwans

    No Lagg? Since I Got This Plugin My Server Has Had 20x More Lagg?
     
  30. Offline

    bergerkiller

    Icee2199
    NightLight has a very slow player move handler. Inform them.

    JacobSwans
    If you use an older version, disable the auto saving thing. Saving takes too long and causes a lot of tick lag.
     
  31. Offline

    chopstick121

Share This Page