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


    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. :)


    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


    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.


    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.


    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. :)


    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.


    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.


    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.


    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)


    Video by brandcool86


    - 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.

    - Add option to disable physics when the tick delay becomes too high


    Show your appreciation for my plugins by donating
  2. Offline


    "Overflow kicks/disconnects are suppressed by adjusting the rate"
    What do you think I should use I posted my config I already adjusted the Thread count it only has 2 threads :(.
  3. Offline


    ledhead900 The config is all right. The plugin automatically calculates the right rate in between min and max, so as long you pick a min rate that is not too high, it is fine.
  4. Offline


    Alright so judging by the advice my server does not need the mob control and item buffers that use up cpu, We simply don't have the population for items to crowd the server and if it does tart being an issue I can use nolagg clear or simple add the the buffer back in ?
  5. Offline


    ledhead900 The clear command is part of the main NoLagg (unfortunately), I haven't found a good combi component for that command yet...
  6. Offline


    Oh thats fine, I mean I can just add it back if it lag happens due to items but I think due to fact that its a survival pvp server under 30 players I prob wont need the buffers. I think you agree.

    and I only used the mob spawn limit to lower mob count on the trial world rest of worlds allow a global of 2500. we only have 1 main world other than nether and the end. I mean on avrg we get like 10 on at any single time. It is only a small community of regulars I just made it public for the new faces but its mostly used for my own private playing as I don't touch SP I prefer ppl be able to jump with me at any time.

    I also Host a tekkit server its quite fun.
  7. Offline


    thanks for your help, but this time I think I surely got a memory issue
    please check my screen shot

    and you could see my loaded chunks was not actually increased (maybe a little)
    but the memory usage DID.

    I just summarized some weird points:

    1.static memory + dynamic memory are not that high (not 8GB as task manager)
    8GB - (2794+2832) = ??? where to go?

    2.the time I save "nolagg log" file is about 1 day after the server's up,
    why the Dynamic Memory started from only 128 MB?
    and increased to 2832MB within secs?
    3.I have the -xmx 12G parameter to restrict heap size for bukkit, and when the usage of java.exe reached it,
    my server start to occur lag spike

  8. Offline


    kalijason sigh

    Working set memory is shared and always more than a process really needs. My simple bf2 level converter program used up 100 mb while never storing anything of that size in memory; but still, it used it. At some point this memory is GC'd away.

    Dynamic memory is the memory that got changed since previous garbage collection. The static memory is the memory shown right after a garbage collection. This gives a clear idea of what memory will be GC'd away and what not, to accurately check if the server is about to crash. (static memory full-ed out, we got a problem!)

    Dynamic memory can increase very rapidly, mostly because of all the temp. variables used in physics calculations of entities, but also when loading and unloading chunks. The more players, the faster it increases, sometimes 100 mb/s!

    Once java passes the initial limit of memory it can use, it will either allocate a whole lot more memory (which takes a while; lag spike) or it will simply crash the server. What happens depends on your startup settings and the host performance.
  9. Offline


    huhhhh.... that's more clear now!
    I really learned a lot :)

    I'll try to enable chunkUnloadDelay

    Many thanks :)

  10. Offline


    - 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)

    Hello, Im new at making a minecraft server but it mostly has network lag. Whenever it lags it says like this or java socket exception.
    16:23:30 [SEVERE] java.lang.NoSuchMethodError: org.bukkit.plugin.PluginDescripti
    16:23:30 [SEVERE] at com.narrowtux.showcase.Metrics.postPlugin(Metrics.jav
    16:23:30 [SEVERE] at com.narrowtux.showcase.Metrics.access$100(Metrics.jav
    16:23:30 [SEVERE] at com.narrowtux.showcase.Metrics$
    16:23:30 [SEVERE] at com.bergerkiller.bukkit.nolagg.examine.TimedWrapper.r
    16:23:30 [SEVERE] at
    16:23:30 [SEVERE] at Source)

    The ticks are normally 20 all of the time. The configuration is the default and i have not touched it. It always lags but it lags like really bad when it says java.lang or java socket exception. Right now i am using CraftBukkit 1.2.5-R1.0 and nolagg v1.82. I am hosting a cracked server and I am cracked. And does it cause lag if i play on the computer that im hosting on?
  11. Offline


    _Mystic better don't say the word 'cracked' around here, the Bukkit staff don't want to be affiliated with pirated Minecraft software. (just for your own good, you don't want to be temporary banned because of something this stupid...)

    To the point, um you probably need to update Showcase then, or use 'ShowcaseStandalone' instead. Look up on dev bukkit for a newer version. (you can search there)

    And no, if you play on the server you host on, you won't have lag, unless you have a terrible computer :)
    Network connection is not harmed in any way when you do this; as the network connection isn't even used. (the flow of data pretty much stays inside your computer)
  12. Offline


    I dont have showcase. At least i dont think i do. And people are really lagging and it takes them 20 secs to see what they typed. Im guessing its cilent lag because they can barely move. Does the java.lang and socket exception effect that? and why does it say ur name and then wrapper and stuff.
  13. Offline


    _Mystic the wrapper line is of NoLaggExamine, it is a thin layer between CraftBukkit and other plugins' tasks used to measure execution times. When not examining, it makes no difference. In next versions I will try to hide NoLaggExamine from that list by surrounding the ran coding in a try-catch, tired of the same errors ending up here...just like it did with the synchronized error check I added to prevent server crashes..sigh.

    To the point: no, socket exceptions can't cause lag, unless they happen very often. After an error people get disconnected. It can also happen when someone leaves the game by pressing [X].

    Chat lag can be caused by two things: your connection is fully used or the player packet buffer is crowded. Consider lowering the min chunk send rate of NoLaggChunks (if you have that installed), or reduce the max rate if it's set too high.
  14. Offline


    Is this working with 1.2.5r1 yet? If so... do you need nolagg.jar to get nolagchunks.jar to work? I loaded nolagchunks on 1.2.5r and it was causing all sorts of problems for my "low ping" players
  15. Offline


    dabomb665m It still works yes, did you try increasing the min sending rate in the configuration? (I guess with problems you mean chunks loading slowly?)
  16. Offline


    Does this work on 1.2.5? If not please update.
  17. Offline


  18. Offline


    Seeing that there's too many .jars to install, why don't you just combine code and make options to select in configuration, rather than making plugins/ folder look awkward?
  19. Offline


    Jaker232 because it adds unneeded classes on the server otherwise, and can cause everything to fail when only one tiny component is failing. (for example, a function got changed in chunk and the lighting fixer bit causes the server to crash)
  20. Offline


    I see. Thanks for clarifying it up for me.
  21. bergerkiller Jaker232
    I like the idea with separate jars though. Gives me a feeling to remove unneeded components completely

    Now, bergerkiller. Lighting fix doesn't work for me somehow.
    Using recommended 1.2.5 bukkit and multiverse (it's happening at a mv's world). When chunks are generated there're still lighting bugs. But /nolagg fix fixes lighting issues completely.

    Why don't they get removed right after generating? (I see this **** only at the bottom of oceans)

    What I'm talking about:
  22. Offline


    VADemon it looks like areas where sand has fallen down. It probably fixed the lighting before the sand fell, and after the sand felt the lighting bug re-occurred. Just in case: You did set the 'auto' to true in the configuration?
  23. Yes, auto: true

    Maybe try to fix the lighting issue after, lets say 5 ticks, so there's no falling sand anymore?
  24. Offline


    VADemon yeah I can increase the delay between generating and fixing the lighting. Though then I need to listen for these chunks and cancel them unloading too. (just in case)
  25. Make an extra option for that, for those people who don't have problems.
    By the way: I've seen the lighting issues inside a cave. So it's not sand :(
  26. Offline


    Is this limits for each chunck? for example 60 cows per chunk?

      # The default spawn limits per world, overridden by world limits
        mob: 800
        cow: 60
        item: 600
        creepers: 30
  27. Offline


    monir entities are never in one chunk, so no, it is per world. But it would be a nice addition.

    On a sidenote: try to find a 'real' plugin for mob limiting, the one in NoLagg is very (VERY) slow compared to what is possible. The 'post-spawn' cleanup causes more lag than that it prevents, and I have found no better way to handle it.
  28. Offline


    Are you planning on updating to 1.2.5 (CB 2149) anytime soon? Cheers.
  29. Offline


    sweet_lemonade2 not as long as it still supports it. I'll change the title for the fun of it (very outdated title...)
  30. Offline


    I just updated from 1.2.4 (2126) yesterday as well -_-
    Not only did I hav to update about 10 plugins but its added lag that wasn't present before hand.
  31. Offline


    sweet_lemonade2 think first what you need, then add them. I separated the plugin on purpose as part of it (NoLagg.jar right now) had several lag-causing problems: Chunk unload delays, spawn limiter and the general chunk updating task. On high-chunk/player-count servers it will, simply put, cause the tick rate to drop way too much. Don't use it unless you really want it...

    All other plugins are safe to use, as they either respond to certain events or handle things better. NoLaggChunks is a thing you need to be careful with; you may need to adjust the min/max rate to better suit your clients. Having too many players receiving 20 chunks every tick can cause the server connection to start lagging. I recommend having a max of 2 and min of 0.25 or 0.1, or 0.5 if you feel 0.25 is too slow.

    So, to further help you with this, what components have you installed and what sort of lag do you have?

Share This Page