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


  3. Offline


    @QQCucumber thanks, downloaded it now testing...easy commands are a must, and it is easy. :)
  4. Offline


    @bergerkiller Is there any way that you can work around the Minecraft bug introduced in 1.6 where if you set the view-distance to less than the default, mobs stay in unloaded chunks and don't spawn anymore? I figured you may want to look into this since your plugin deals with both chunk management and mob nerfing and I'm sure many people would be grateful, specially server owners with limited bandwidth who have to choose between no lag or no mobs. :)
  5. Offline


    @LEOcab I will make the viewdistance as a property in the NoLaggChunks add-on. (of course player-specific)
    Kinda weird that mobs stay in there...I'll look into it. (remove all mobs in onChunkUnload, seems simple)
  6. Offline


  7. Offline


    I tested with different versions of Bukkit and about 50 different config settings.

    - Cant get spawnlimits to work (i seriously tried every possible combination of global,default,worlds,mob,animal,monster)
    - Chunks sometimes are missing in the map
    - "jumping items i cant collect"

    Would love to be able to set only the spawnlimits and change nothing else.
  8. Offline


    Cant get spawnlimits working either..
  9. Offline


    @Kademlia just a missing chunks go away if you set the unloadDelay to 0?

    I noticed black holes too, but they got filled once I came near them. However, jumping items happen when you stand in an unloaded chunk while you see the chunk.

    Also, set loadChunkOnClick to false, and if there is a difference then.

    I triple-checked the spawning code, still don't get how it can fail...annoying it is
  10. Offline


    Is this now with CraftBukkit 1240 working/compatible/recommended?

    And a have a suggestion:
    I use WorldEdit/WorldGuard, there is a command /stoplag
    Its stopping physics and Mobspawning.
    So you could add a option if the TPS are under .. lets say 16 TPS your plugin
    make /stoplag
    and if the TPS is over 17 your plugin make /stoplag -c
    (aka startlag :p)

    Sorry for bad english :(
  11. Offline


    @wassilij good suggestion. (note: it's a simple world property you can set)

    Note that I can't do much to stop the chunks from becoming invisible; it's a weird issue I already tried to fight many times...
  12. Offline


    but for the world properties i have to reload the server :(
    and with /stoplag and /stoplag -c i dont

    im not a coder .. but i had a problem that the chunks gettin invisible, then i tried the plugin bananachunk and all worked.
  13. Offline


    @wassilij this is what NoLagg offers too, all you do is send the chunk and it's tile entities to the client. But this should be 100% autonomous; but as I see now this is impossible. However, by tweaking the sending rates you can get desired results. For example, no more lag when someone joins the server, let a client download a larger part of the world before joining, and send packets to players based on priorities. For example, if someone joins this player has full priority (not many chunks sent), and all other players will receive chunks a bit slower. But no chat lag, no block placement lag, and this is a great benefit. :)
    wassilij likes this.
  14. Offline


    Sadly, same issue there :( plus that some monsters became laggy and not responding to any action
    latest plugin and CB

  15. Offline


    Those are both related to the same thing: missing chunks (nearby). Sadly I don't know what causes it. All I can say is: set ChunkUnloadDelay to 0. It's the only thing 'messing' with chunks, so without it this should be gone.

    And, I hate those spawn limits... xd

    @dog.big could you post the configuration used? I'll use it as an example to work upon.


    Owww god no. Ok I made .. um .. a giant blunder here... :eek:

        public void reset() {
            for (SpawnInfo i : info.values()) {
                i.count = 0;
        public void reset() {
            if (animal != null) animal.count = 0;
            if (monster != null) monster.count = 0;
            if (mob != null) mob.count = 0;
            if (item != null) item.count = 0;
            for (SpawnInfo i : info.values()) {
                i.count = 0;
    in other words: animals, mobs, monsters and items were not re-set to 0 during the general update call...soow eventually all mobs stopped spawning.

    I'll update ASAP



    Got some very good news! :)

    The add-on is back and running. It literally improved packet rate with 200% for me, I can't even run into an unloaded chunk while going 200 blocks/'s ridiculous!

    Features currently working:
    - player-specific chunk send interval and rate
    - global server chunk send interval and rate
    - packets are retrieved, not re-created, saving lots of CPU
    - doesn't send packets out of reach of the player
    - multiple chunk changes quickly followed up only send the last known chunk information

    Features to be added for release:
    - Commands/configuration to assign a chunk rate for players
    - Set the chunk radius/size/count to send to the player when they first join
    - Possible: chunk rates based on player ping

    General idea of this add-on:
    - Increase the player cap you can have on your server
    - No more lag when a player joins
    - Almost impossible to end up in unloaded chunks, bouncing
    - Packets synced, not all pushed into a single tick
    - From above: decreases tick issues, less stress on the server, time for other packets to go through
    - Increase or decrease bandwidth for different players. New way to make money, lol. :)

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


    I dont want to test this on my server while its running. So this is why i'm asking. Will it crash when i do /spawnmob etc... Before it did. Was this issue resolved?
  17. Offline


    Any ETA when we can get the add-on download link?
  18. Offline


    Yes I believe github still has v1.26
  19. Offline


    The Archived version which doesn't include the AddOn is the updated 1.27.
  20. Offline


    Do you know where I can get the addon? :confused:
  21. Offline


    Are there any features between Ptweaks 1.5.1 and NoLagg 1.27 that I should disable so they don't conflict with each other? I notice they both do something for chunk unloading and monster limiting, so I am concerned.

    You don't want the addon, it's not ready.
  22. Offline


    It's in testing mode, sorry. It's basically all in-code atm, as in, all variables are static and only through Eclipse I can configure it. And ofc, the TODO's. :)

    I'll publish a pre-release (lol) once I gave it proper configuration.


    AutoSaveInterval: will hardly influence. I even set my autosave value back in onDisable.
    Chunkunloaddelay: Nolagg and PTweaks both check if it's cancelled before handling, no issues there.

    In both the above cases either of the plugins is used. Since NoLagg loads before PTweaks (name is the reason) I expect NoLagg to take those features over.
  23. Offline


    Lol, you don't know me then. I always test the latest pre-released plugins and dev plugins from all the dev sites on my medium sized server. I love... testing. I also have a decent server to test plugins for memory leaks and high cpu demands too. 24Gigs of ram, 2 xeon cores @ 4ghz, and I can keep going. :p

    Edit: In fact, do you have a jenkins?
  24. Offline


    I think my server loads in reverse alphabetical order for some reason, will that be an issue?

    (Or should I say alphabetical order? What I'm trying to say is I think Ptweaks loads after).
  25. Offline


    @rtcabooservb nope, sorry. No idea how to set it up/if it is at a cost. Was hard enough to push all plugins onto Github. ;)

    @QQCucumber order only influences what plugin handles what. Also, PTweaks > NoLagg, alphabetical, so l m N o P, NoLagg loads first and gets called before Ptweaks during events. Also, not sure if he updated, but if not that version is pretty much the same as the base of Nolagg. (PerformanceTweaks, which I improved)

    I'll upload a pre-release tomorrow. Already ran into quite a lot of hurdles, most of them being caused by three different threads trying to access a single class. (netserverhandler, async update thread and main bukkit thread)
  26. Offline


    Q_Q Can't wait for pre-released addon.
  27. Offline


    @rtcabooservb I can't watch you

    Uploaded a very WIP wip. Does not have any configuration. Is now at the default settings:
    If you encounter any sort of bugs, report them. Note that the downloading terrain feature is 10% implemented: it only loads a single chunk and that's it. (just to prevent issues when logging in)
    Download terrain dialog lasts very short, and it's possible that you spawn in an unloaded chunk because of this.
  28. Offline


    Lol, I pre-render my chunks, but I'll make a temporary new world just for you and report any bugs/errors I come across. ^_^

    Edit: If a jenkins cost, I'll buy one for you. :confused:
  29. Offline


    @rtcabooservb Ow I'm just a cheap-O, if it ain't needed, I ain't buying
    Github is fine for me atm. I dislike compiling plugins outside my client machine...
    (plus I compile 300x a day...imagine the build id's)
  30. Offline


    :p And I would download it 300x a day.
  31. Offline


    Is it possible to decrease the overall block tick rate? (without recompiling craftbukkit of course :p But if there is no was i guess i'll have to change the server .jar itself...)

    This would be usefull on 2 ways:
    Slowing down the Worlds mechanics (lesser mob spawns, slower plant growing)
    simple stable performance boost

    Another suggested feature if it is possible:
    Costumizing block tick behaviour in general like:
    only tick blocks above level 20
    or disable player requiremnents(no more check the sorroundings of the player and just let all specified blocks tick all the time)
    Main reason for this would be the obvious performance boost on servers with many players. (It also would make them more realistic.)

    Yeah, i posted this on ptweaks too, but this plugin seems to fit better.

Share This Page