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

    nickj99

    Hey Im trying to fox the orbs on my server. Do i have to do anything after plugin is installed? Or No?
     
  3. Offline

    Arthius

    This plugin lies! It does NOT work no matter what i change the config. If you want to prove me wrong, then give me a config that stops the lag!
     
  4. Offline

    fffizzz

    Buy a better server. :)
     
    vlado2portos likes this.
  5. Offline

    Arthius

    what do you mean "buy" a better server?
    does this plugin only work for dedicated servers?

    Plus, I've got Windows 7 laptop so it shouldnt be so crappy with my fps
     
  6. Offline

    fffizzz

    edited: ya, im gonna remove this. Im gonna be nice and go away.
     
  7. Offline

    bergerkiller

    @nickj99 Nope, once the plugin is placed it will automatically cleanup/combine orbs together and spawn player orbs as a single orb. You can use /nolagg clear or /nolagg clear all just in case the orbs do lag you.

    @Arthius First of all, what is the lag? Is it constant lag? Is it lag caused by TNT? By orbs? Anything?
    If it is 'just lag' then no plugin can solve that issue: laggy servers are laggy. You can't magically double the CPU power or widen the network connection.
     
  8. Offline

    Arthius

    its annoying it only lags when i place a block then it places 2

    EDIT:It's fps lag which makes a spike when i place a block so it thinks i hold the button for longer and it places two, and it only does this when im playing on servers
     
  9. Offline

    bergerkiller

    @Arthius if you are running 1.8: 1.8 is known for having lots of lag. I have had it myself when wandering off 'too far' into unloaded chunks. Took 10 minutes to get some movement...

    Also, you can try setting all graphics to the minimum. I run on a short distance all the time, because on normal and far I risk getting devastating crashes. :(
     
  10. Offline

    ledodreadlow

    I see this plugin as VERY beneficial to lagging issues. I have tnt turned off on my server, but with this plugin, I may bring it back.

    I once (before this plugin) used worldedit to create a large 100x100 wall. Of course the sever lagged out and crashed me, but the server stayed alive. I then decided to add an inner wall one block high of torches. HOWEVER, I mistakenly set the selected area to torches instead of using the wall command. Because my selection was one block higher than the ground, the torches had nothing to attach to. SOOOOOOOO I had 100x100 floating torches. The LAG was horendous. I wish I had this plugin back then. It was so laggy, I couldn't even use the remove items command in chat. It took nearly an hour to remove them all. This would have never happened had I installed this plugin.

    Thanks for such an awesome plugin. And I will use this plugin once 1.8 bukkit is released.
    [diamond][diamond][diamond][diamond][diamond] for you bergerkiller!
     
  11. Offline

    Kademlia

    Attention! The plugins dupes items if the option
    formItemStacks is set to true.

    Reproduction path: spawn several items somewhere. Move away from the spot, the client ( server?) has to unload the chunk. Move back to the spot. The Items have quadrupled
     
  12. Offline

    bergerkiller

    @Kademlia I'll resolve this issue if I can reproduce it, thanks for reporting. :)

    My guess is that the item buffer doesn't remove stacked and removed items, thus onChunkLoad will trigger mass spawning.

    Yup, it's weird but a single item changed into a stack of 2-3 items. I'll see how I can fix that.

    EDIT

    It's a weird bug happening when a chunk unload delay is set. You can set chunk unload delay to 0 and use formstack true and it will work as well. *fixing...
    - only happens when returning to the items before the unload delay times out
     
  13. Offline

    EnisThenis

    Sorry to post again but how does the autosave work?
    Everytime our server crashes, it still rollsback by around an hour. We have the autosave config set to the default of 20. Any items that have been deposited between the crash and 1 hour before are duplicated.
     
  14. Offline

    Kainzo

    Hmm I want to use this but the item duping thing steers me away from it.
     
  15. Offline

    bergerkiller

    @Kainzo don't worry, it only changes the amount of items in the stacks, it doesn't spawn new items. It's a bug in the Item stacking code I guess...happens during the short time a chunk 'is kept loaded'.

    I'll see how much work I can do today

    @EnisThenis auto-save can be seen as writing the data in memory to disk. You can set auto-save to a higher value if you use your own method of saving.

    EDIT

    Item duplication should be fixed now. Give me a sec to upload it all to GitHub.

    *updated for craftbukkit build 1185 (mc. 1.81)

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

    erdrickk

    Getting this error with bukkit 1185 and NoLagg 1.14

    Code:
    11:33:27 [SEVERE] java.util.ConcurrentModificationException
    11:33:27 [SEVERE] at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
    11:33:27 [SEVERE] at java.util.ArrayList$Itr.next(ArrayList.java:754)
    11:33:27 [SEVERE] at org.bukkit.craftbukkit.CraftWorld.getEntities(CraftWorld.java:513)
    11:33:27 [SEVERE] at com.bergerkiller.bukkit.nolagg.OrbScanner.combine(OrbScanner.java:34)
    11:33:27 [SEVERE] at com.bergerkiller.bukkit.nolagg.OrbScanner.combine(OrbScanner.java:29)
    11:33:27 [SEVERE] at com.bergerkiller.bukkit.nolagg.OrbScanner$1.run(OrbScanner.java:17)
    11:33:27 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    11:33:27 [SEVERE] at java.lang.Thread.run(Thread.java:636)
     
  17. Offline

    bergerkiller

    @erdrickk kinda weird...it does not lead to this plugin. There's an error in the Craftbukkit getEntities() function...I'll check it out what it is at that line.

    EDIT

    Yup let this be a lesson: stop using Async tasks... sigh xd
    I'll quickly update to 1.15 fixing this.
     
  18. Offline

    erdrickk

    Awesome, thanks!
     
  19. thanks for update
     
  20. Offline

    bergerkiller

    Another update in a few minutes...I noticed the main lag cause was the actual explosion!
    During the mass explosions of TNT stacks lots of explosion packets get send to the client. I now add a maximum rate per second for these packets, and it works really nicely. :)

    Ok updated to v1.16. Only change: a max explosion rate per second setting. Also, tnts can now detonate ALOT faster without causing lag. Had set the rate at 50 and an interval of 1 and the server still responded. For the meaning of 'no lag' I had set it to 10 by default to have the least hinder from it.

    Also, removed the orb 'fix' since the fix is already present internally. Orb combiner is still active, although not sure if it has any use now. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
    o0AzzA0o likes this.
  21. Offline

    EtherealHC

    Seems no one can pick up items on the ground after I updated to the latest version of this mod. I turned it off and people can pick up items for now. Addon list:
    Code:
    AutoFurnace.jar      iConomy.jar                   OtherDrops.jar         Stargate.jar
    BackToBody.jar       LogBlock.jar                  PailStone.jar          Tombstone.jar
    BorderGuard.jar      LWC.jar                       PermissionsEx.jar      VanishNoPacket.jar
    CFBanner.jar         MCMA_compat.jar               Permissions.jar        VirtualChest.jar
    CraftIRC.jar         MobBounty.jar                 PorteCoulissante.jar   WorldEdit.jar
    dynmap.jar           Modifyworld.jar               properTime.jar         WorldGuard.jar
    Essentials.jar       MultiInv.jar                  Residence.jar          WurkItv1.2.0.jar
    EssentialsSpawn.jar  Multiverse-Core.jar           RetractableBridge.jar
    ForeverALoad.jar     Multiverse-NetherPortals.jar  Safe Creeper.jar
    HeroChat.jar         NoCheat.jar                   ScubaKit.jar
    CB #1188
     
  22. Offline

    EnisThenis

    I understand, but I don't see why there are still rollbacks occuring everytime the server restarts.
     
  23. Offline

    MuttsNuts

    @bergerkiller
    Love the mod btw, works really well, but unfortunately it messes up one of the other plugins I use, BleedingMobs. What happens in BleedingMobs is when an entity/player is damaged they drop wool, redstone and bones that cannot be picked up but as soon as I put the NoLagg plugin in all the drops from BleedingMobs could be picked up and caused tons of wool, redstone and bones to be laying all over the place that players could pick up. Obviously this is an issue as BleedingMobs drops a lot of stuff per entity damage so for example by killing 2 zombies, a player can get over a stack of wool, a stack of redstone and half a stack of bones easily.
    I don't know if you'd be interested in looking into this issue but it would be very much appreciated as I would rather not lose either plugin.
    Thank you.
    CB 1185, Permissions 2.7.4, BleedingMobs 2.3, NoLagg 1.16. Anything else you need to know please ask.
     
  24. Offline

    bergerkiller

    @MuttsNuts try setting the max items per chunk to 100 or so to make it spawn these items. Afraid it will be pretty hard to make NoLagg compatible with that...
     
  25. Offline

    MuttsNuts

    @bergerkiller It spawns the items but the problem is they aren't meant to be picked up, they are only temporary drops for blood effect. I tried changing a few settings as you suggested and still no luck. Not to worry :( but man the amount of TNT that can be detonated with your plugin is superb. My server doesn't even notice anythings happening :D.
    Thanks again.
     
  26. Offline

    Apower

    Wow this really works! Thanks! :)
     
  27. Offline

    Caid

    I am also interested in a default config file that has good spawn limitations. I'm playing from China, and for some reason, monsters lag the hell out of my game. When I first join the game, I can see all the mobs until the blocks load. There're SOOO many. I would like to have it limited.

    Perhaps you can tell me, you example says creeper 1, does that mean it will only load one? Or is that a multiplier of the defaul amount? If it's a multiplier, do higher numbers reduce or increase the amount?

    The example isn't very clear, I'm afraid.

    Thanks for any input, in advance.

    -Caid.
     
  28. Offline

    bergerkiller

    @Caid it is the maximum allowed 'entities' on the world. Example:
    Code:
    spawnlimits:
        default:
            pig: 0
            creeper: 0
            cow: 0
            sheep: 0
            chicken: 0
            zombie: 0
            skeleton: 0
            spider: 0
            enderman: 0
            slime: 0
    Also: I recommend using MyWorlds to do this easier. In there you can deny everything from spawning in a single command:
    And it will deny the spawning of ALL mobs/creatures on the world. Pretty simple. Use NoLagg's system if you want to set limits for certain mob types. Only problem is that there's no real value you can set in the server to change the amount of 'entity slots'.
     
  29. Offline

    ewized

    Can you tell me where I can get all the spawnlimits options. I dont know what are real options like is mobs, items a realy config option.
     
  30. Offline

    bergerkiller

    @ewized possible entities you can set limits for:
    Code:
    pig
    creeper
    cow
    sheep
    monster
    skeleton
    spider
    chicken
    squid
    slime
    giant
    itemwood
    itemgold
    itemstone
    itemglass
    boat
    minecart
    it uses the class name, so for every possible entity it is possible to set limits. There are lots more, but to list all of them... xd
     
  31. Offline

    rbos

    I've pinned down this plugin to causing a slow memory leak (about a megabyte a minute) on my server.

    Without it, memory use is stable. With it,

    07:22:54 [INFO] [MemMonitor]Total Memory:2495 MB
    07:22:54 [INFO] [MemMonitor]Free Memory:339 MB

    it takes about 8 hours to run out.

    Default settings. I suspect it'd have something to do with chunk caching.

    Edit: CB1185, /plugins:

    07:28:03 [INFO] Plugins: MyHome, MemMonitor, Spout, FalseBookCart, FalseBookCore, MyWarp, Multicast, EnderNerf, mcbans, MultiInv, FalseBookExtra, NoCheat, DelayedStop, CraftIRC, FalseBookBlock, BananaChunk, PlugMan, ForcegenChunks, SimpleReserve, PetitionPlugin, PlgSetspawn, CraftBukkitUpToDate, NoLagg, Permissions, WorldGuard, FalseBookChat, SpamHammer, LogBlockQuestioner, FalseBookIC, WorldEdit, Multiverse-Core, iChat, CommandHelper, LogBlock, LWC, General, WorldBorder, WormholeXTreme

    It's possible that some other plugin is 'touching' the chunks and keeping them resident.
     

Share This Page