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

    enkious

    Does this work with r3?
     
  3. Offline

    Borch

    Won't high rates still crash the client?
     
  4. Offline

    godgodgodgo

    Afforess said to me:
    "NoLagg can definitely cause more lag if set up improperly. I don't really care for most of it's features."

    What does he mean? :confused:
     
  5. Offline

    bergerkiller

    godgodgodgo he probably means the spawn limiter and stack former features, those that limit client lag and require some processing time to run. Otherwise he'll have to say it himself, if he knows something I should fix/remove, he should say so.

    Borch nope, that is what the scheduled packet sending is for.
     
  6. Offline

    godgodgodgo

    Ah ok
    He implemented item stack to CB++ though
     
  7. Offline

    Noxturno

    does your plugin nolagg compatible with Obfuscation(antixray)? because I was using the anti xray then I added nolagg and it seems to stop working . thanks in advance!


    Edit

    it seems your Latest update works with it now !! thank you !!!!
     
  8. Offline

    bergerkiller

    Uploaded 1.59. This one is compatible with the newest recommended build of CraftBukkit (RB3 CB 1846), but will most likely work on previous recommended 1.1 builds too. The TNT feature is now pretty much finished, allowing the fastest TNT detonation coding possible so far. I have optimized it to the point where every single block is in a interconnected map, allowing super-fast block access times. I also worked on the entity damage side of things, making it ignore walls between TNT and items to boost performance. (it was lagging badly because of all those calculations)

    If you had an error when a player joined in RB3, and this player couldn't see any chunks; this is now fixed in 1.59.

    If you use CB RB3, do use 1.59, any version below will NOT work, as a field got renamed.

    TNT still behaves like normal, only difference is that I now store a fixed mapping to perform the 'explosion shockwave' at. This means it no longer uses 1300 directions to look at, but a mere 8 - 128 blocks multiple times. It may look a bit different though, since I had to change the randomizer for a bit.

    Mercury Wish I knew why people had these issues, then it wouldn't be such a headache. But I'm getting there...

    rtcabooservb How do you mean 'random unloaded chunks'? Is it unloading chunks nearby players causing missing chunks, or do you mean something else?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 10, 2018
  9. Offline

    rtcabooservb

    Still experiencing high buffer size and slow chunk loading. I was using craftbukkit++, but I shall test 1.59 with the latest CB and spout.

    Edit: CB 1850, Spout 730, chunks are still dropping to 0.25chunks/tick and buffer is abnormally high.

    Edit2: Think I fixed it. Disabled a few things. Still don't like the random unloaded chunks when chunks load too fast. >:c
     
  10. I've ran NoLagg for the first time and it spammed the below error about 15 times in the console.

    Code:
    2012-02-01 01:14:16 [SEVERE] java.lang.NullPointerException
    2012-02-01 01:14:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.sending.ChunkCompressQueue.isAlive(ChunkCompressQueue.java:45)
    2012-02-01 01:14:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.sending.ChunkCompressionThread.nextQueue(ChunkCompressionThread.java:27)
    2012-02-01 01:14:16 [SEVERE] at com.bergerkiller.bukkit.nolagg.sending.ChunkCompressionThread.run(ChunkCompressionThread.java:164)
    I have been experiencing sudden memory drains leading to server crash on my server. I have determined that it's not the lack of ram, because it stays steady at 70% free memory, and I suspect that something with world info handling, meaning chunk loading.

    I'm using craftbukkit #1846.
    I hope you can help me, it's frustrating having to restart the server every 2 hours :S
     
  11. Offline

    SupaYoshi

    Will TNT stay working the same as before? Greetings! ;) Just alittl ebtter? what actually changed in the handling?
     
  12. Offline

    larperdoodle

    (CAPS ARE THE IMPORTANT BITS) IMPORTANT, MAJOR BUG: hey, I installed this on my server. I went far away from my spawn city to test it out with tnt. And it worked. the tnt blew up with no lag, creeper heal healed it back. But when I used /spawn to go back, there were what appeared to be massive chunk loading errors. Nothing I did fixed them. So I copied it into my singleplayer saves folder, and the errors remained!! upon further examination, i discovered that all stone has been removed in random chunks. ITS LIKE A REALLY BAD WORLD HOLE, EXCEPT THE SURFACE AND BEDROCK LAYERS ARE LEFT UNTOUCHED. It is unfix-able, even with voxel sniper, world edit, and MC Edit combined. PLEASE HELP, its been a week since my servers last world save backup!!! I HAVE UPLOADED THE WORLD SAVE TO MEDIAFIRE, if you want to download it and see for yourself. <Edit by Moderator: Redacted mediafire url>
     
    Last edited by a moderator: Nov 12, 2016
  13. Offline

    Mercury

    By all this comments this plugin sometime makes more headpain than performance booster :(
     
  14. Offline

    Borch

    Suggestion: Check if all the fields exist and do have their expected names/types right at startup, and give a meaningful error message. Maybe even check Server.getVersion() to guess whether the CB version is too new or too old for the NoLagg version currently in use.

    Also I see many problem reports here recently, but people neither bother to report their CB version nor NoLagg version in use. That's quite sad, since you even asked for it in the OP. So larperdoodle - Plugin list, CB version, NoLagg version please. ;)

    I have to add that I didn't have any problems with NoLagg for quite a while now. I did however spend some time tweaking the settings and disabling some features I don't need or that caused problems. for example I had to disable the buffered chunk loader in the end (which also got removed), as it still had issues from time to time unfortunately.
    So maybe you should consider disabling new features by default until volunteers tested them for a week or two and didn't have any problems. It would probably save you lots of posts by random server owners who just added the plugin without thoroughly reading the first post. It happens quite often. Also it should be quite easy to automatically disable features on startup that interfere with certain plugins, if they are detected at startup, and give a verbose message about it right away.
    I saw you do/did this for some plugin (Orebfuscator?), but not at startup, only at runtime when a problem occured. Some people might not see this, if it doesn't crash the server right away.
    Just some thoughts on how to make this plugin less of a pain for newbies and, in the end, yourself, by preventing the same mistakes being made and reported again and again. ;)
     
  15. Offline

    bergerkiller

    Borch Problem is that I don't know beforehand when the plugin will break, since the CB doesn't exist yet. I could provide a min and max cb version though, which will prevent a lot of confusion. I'll add it the my 'common' package, under 'PluginBase'.

    And believe me, I thoroughly test features before I added them. I tweaked the custom explosion coding for about 30 hours, testing everything from damage adjustment to the actual processing times to the resulting tick rate. But I can't know whether or not some plugins can conflict, which was the case with the Buffered chunk loader in the end. I found that it caused too many conflicts with plugins temporarily storing chunks, such as portals malfunctioning in MultiVerse. I decided to remove it, since monitoring the chunk would require more CPU than garbage-collecting the chunk would take.
     
  16. Offline

    Borch

    bergerkiller I do trust you in that you test the features for more than just quick 2 minutes ;).. But still, nobody is perfect, and I think for example you did find one or two threading issues in your buffered chunk loader a while ago (in relation to the chunk sender), if I'm not mistaken. And I'm happy to report issues I find with NoLagg, as I do backups and know what I'm dealing with here mostly. I just suggest that if you add features that significantly modify or replace inner workings of the server and potentially conflict with other plugins - like chunk loading - you should disable that feature by default first, and ask volunteers to test it for some time. So the average Jon Derp who doesn't read any information before trying the plugin won't get any problems. :)
    NoLagg is really a great plugin, from a practical point of view (just being useful) and from a technical, as you implemented some very interesting ideas here. But that just comes at the cost of being very fragile if something changes in bukkit, or when other plugins also mess with inner workings of bukkit.

    For the version testing, yes you don't know when it will break, but you could do a good guess I think:
    So you check all the fields you're using anywhere in your code at startup for existence and proper type.
    If one field doesn't match, you compare the CB# that the plugin is running in to the CB build you compiled NoLagg against.
    So let's say you compiled and tested NoLagg when you were running CB1000 and now at startup you see that a field is missing. You can then tell that CB is too old if it is <1000 and that CB is too new when it's >1000. Then just make the plugin disable itself and tell the user to upgrade either NoLagg or CB. :)
    If no fields have changed then NoLagg should still work, even if the CB version is different.
    Or am I missing something here in my train of thought?

    Again, these thoughts are mostly to make NoLagg more foolproof, it's up to you to do something about it or not.. :) I am happy with the way NoLagg currently works, as I take the time to test stuff anyways whenever I update anything.
     
  17. Offline

    bergerkiller

    Borch build version checking is all done :)
    I am building a simple commonly-used library, which I include in all plugins, to reduce the amount of code everywhere. My class also contains simple get calls and register shorteners.
    http://pastie.org/3295996
     
  18. Offline

    Greylocke

    Three questions regarding Chunk Sending:
    1. To avoid too many threads, what is a 'healthy' busy% to shoot for?
    2. What are the consequences of setting a high MaxRate?
    3. Why even have a MaxRate? Why not just let the server stream chunks as fast as it can?

    Thanks!
     
  19. Offline

    Don Redhorse

    hmm nice... but this will fail with craftbukkit++

    the way I worked around it was checking if there is a + in it and just displaying a message.... you should probably add a disable option in this case and a config setting to enable the plugin on craftbukkit++ too
     
  20. Offline

    bergerkiller

    Greylocke
    1. Should be around 0-60%, note the color changes of the read-out. 1 thread is usually just fine, but if you use plugins like Orebfuscator you need to set more to cope with the added processing need.
    2. Nothing; it will not go higher than that, and that's all.
    3. If you run a server locally, there is no network delay, which can result in 10 chunks/tick. This can cause many semi-transparent chunks for the client(s). The rate is also applied when loading chunks, so by limiting this you can reduce the lag when loading chunks. (to some extend)

    Don Redhorse
    I actually don't have an idea what Craftbukkit++ is...I thought the Spout dev was going to make their own server? Is this an official project or more of a bridge between Spout server and Bukkit?

    (I will eventually go and use Spout server, because Bukkit is simply too slow in many ways)
     
  21. Offline

    Don Redhorse

    a cb version of Afforess which uses a some optimization to make big servers run better... like herocraft..

    you can find it on the spout forums... it is mainly some minor changes in code... but one of them is the version

    from Sleaker:

    This server is running Craftbukkit version git-Bukkit-jenkins-CraftBukkit++-37 (MC: 1.1) (Implementing API version 1.1-R1-SNAPSHOT)
     
  22. Offline

    Greylocke

    bergerkiller thanks! So... I'm running 4 threads and have single-digit busy%. Probably overkill. I had a feeling that was so. :D I'll cut back on threads and continue to monitor the busy%.

    I don't run a local server, but I'm regularly pushing 8+ c/t. And yes, I'm seeing transparent chunk issues. Sounds like the server is pushing faster than the client can consume. (?) I'll push my MaxRate back down.

    Thanks for the technical info!
     
  23. Offline

    neo6633

    So where I should Fix?...
    I don't know... plz explain more detail... I'm poor at English.
     
  24. Offline

    L24D

    bergerkiller
    Hey hey. :)
    Got a strange one for you.. something has depreciated..

    Code:
    2012-02-02 00:22:12 [WARNING] Task of 'NoLagg' generated an exception
    java.lang.NoSuchMethodError: net.minecraft.server.EntityPlayer.getBukkitEntity()Lorg/bukkit/craftbukkit/entity/CraftPlayer;
        at com.bergerkiller.bukkit.common.Operation.doPlayers(Operation.java:41)
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1$1.run(ChunkSendQueue.java:58)
        at com.bergerkiller.bukkit.common.Operation.<init>(Operation.java:28)
        at com.bergerkiller.bukkit.common.Operation.<init>(Operation.java:24)
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1$1.<init>(ChunkSendQueue.java:56)
        at com.bergerkiller.bukkit.nolagg.sending.ChunkSendQueue$1.run(ChunkSendQueue.java:56)
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:502)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    Only happens when someone initially logs in. o_o
     
  25. Offline

    bergerkiller

    L24D Damn uuuuu Bukkit :(
    First it complains about getPlayer() missing, and now it's getBukkitEntity() that is missing? Sorry, but I can't fix it like this...
    Are you using CraftBukkit++ or any other server OTHER than CraftBukkit 18**?
     
  26. Offline

    rtcabooservb

    I decreased the chunk unload delay to 5,000 ( was at 10,000 by default) and increased the chunks/tick to 3. I no longer experience the random unloaded chunks. I'm going to wait for some users to get on to fully test the increased speed of how chunks load and see if they get disconnect overflow errors. Do you recommend that I lower the value back to default? Feel free to login to my server if you would like to test. (pm me if you need the IP again.)

    CB 1857 (Was using CB++ 66, but since it uses many tweaks that conflict with nolagg, I thought that you might say it would corrupt nolagg) Spout 735.
     
  27. Offline

    colin5789

    Found a bug don't know if has been reported yet but, the power of tnt is doubled with NoLagg enabled. I've included a picture( I'm using CB 1865) Nolagg.png
     
  28. Offline

    bergerkiller

    colin5789 Yeah I feared something like this would happen, you can try tweaking it to the old size by editing the explosion radius in the configuration. I'll see what I can do about it.
     
  29. Offline

    colin5789

    Ok I look forward to the next update
     
  30. Offline

    Averus

    can you work on:
    /nolagg clearall sheduler, like auto, every 30 mins
    tnx
     
  31. Offline

    sagethor

    bergerkiller
    Is it viable to use this as a memory leak cleaner? I am hoping to have a memory clean every minute. My current setup minus memory leakages should allow for around 20-25 players on 512 mb of ram.

    Averus
    Use rTriggers. It lets you setup commands that run on timers.
     
    Averus likes this.

Share This Page