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

    Greylocke

    I'll second this for two reasons:
    1. it 'fits' with the purpose of this plugin
    2. the dev of LagMeter has said that he will no longer support it.
     
  3. Offline

    bergerkiller

    In addition I will add the amount of memory increased/decreased since last message.

    EDIT

    Nice memory message is done, automatically made me spot a pretty severe memory leak was occuring. When flying around for a few minutes, the average memory usage went from 336 to 726. This is obviously not a good thing to have.

    EDIT

    Performance Manager 90% done. Player display is finished, only have to add some sort of nifty formatting for the console.
    2011-11-09_22.21.47.png
     
    ledhead900 likes this.
  4. Offline

    ledhead900

    Nope. Does not help really at all no more than turning it off does, only slightly. I still get strips that don't appear and I can see thru to the tunnel networks until I get closer or land on it.
     
  5. Offline

    Chrispm84

    This didn't work... Bad thing is, I'm not even sure it's your plugin, at this point. I guess I'll have start pulling out plugins one by one... :/
     
  6. Offline

    bergerkiller

    @Chrispm84 to be honest, neither do I. Found out I had multiple worlds loaded...it obviously was more RAM. However, it did not decrease, which was odd. If you can run local, check the RAM usage.
     
  7. Offline

    ledhead900

    My rams seems ok, its not going above 500mb at idle and with 1 player its about 1gb our of 3 that's only coz its xms is 1gb. Only thing I got is strange stuttering with the ghost chunks tho its probably my drivers or my crazy custom world that needs lighting regenerated every couple hours lol.
     
  8. Offline

    Chrispm84

    @bergerkiller Well, thanks anyways. I'll try to figure out which plugin it is. If you think of something, let me know. And I love your performance monitor! I too, am still using LagMeter and was stressing over what I was gonna do within the next few bukkit RBs. Thanks to you, problem solved! Our server's paid up for a good while, so next few donations we get, I'll send some your way! Thanks!!!
     
  9. Offline

    zaklampje

    When I installed NoLagg, everything ran fine... But now I got an error. Everytime someone tries to connect, it sais: Connection Overflow...

    Ideas?

    *Now the error is gone?!

    *Can't handle 2 players on the server, and it's definitely NoLagg causing that :(
     
  10. Offline

    silentdojo

    Just stopping in to report our 12GB server has never ran better since the latest updates.
    We use PEX (the newest 1.16 is also a good fix on lag), CB 1337, Spout 410, an oreobfuscator, and about 30 other plugins including having multiworlds. With an average of 16 players online at once we experience noticeably less lag with this plugin. Come load some chunks in one of the creative maps to see for yourself.
    -we use a 5000 ms delay. might need to tweak that setting a bit though still testing.
    thanks @bergerkiller
     
  11. Offline

    bergerkiller

    @zaklampje When testing on a friends server we did notice that, at some point, the RAM usage extends 1024 MB for some reason, causing lots of garbage collections to occur, decreasing tick speeds, causing everything to slowly stop. Socket errors were a result of that. Since you mention player counts, I say chunk counts. Try disabling the chunk unload delay (or set it really low)

    EDIT

    Are you having tick lag (placing blocks takes too long to be processed) or client lag? Because to prevent client lag I have NoLaggChunks, but it's still not entirely finished. It does reduce client lag to none, you can freely run around without having massive lags when chunks are received.
     
  12. Offline

    Fr0zenfr0g

    how do i do to remove all mobs?
     
  13. Offline

    bergerkiller

    @Fr0zenfr0g
    Supports the same naming system as the spawn limits, such as Creeper, Item, Animal, Monster, Mob, tnt, arrow, etc.
     
  14. Offline

    Fr0zenfr0g

    how do you config that?
     
  15. Offline

    bergerkiller

    @Fr0zenfr0g In the config.yml file, see the Configuration spoiler for more info of all keys.
     
  16. Offline

    Sepulzera

    Bet he wants to know his config, to get an idea how it should looks like :p
     
  17. Offline

    bergerkiller

    This is mine:
    Code:
    bufferItems: true
    bufferTNT: true
    useSpawnLimits: true
    useChunkUnloadDelay: true
    tntDetonationInterval: 1
    tntDetonationRate: 5
    explosionRate: 2
    maxItemsPerChunk: 20
    formItemStacks: true
    chunkUnloadDelay: 5000
    autoSaveInterval: 400
    updateInterval: 20
    stackRadius: 2.0
    stackThreshold: 5
    useAsyncSaving: true
    chunkUnloadAsyncSave: true
    spawnlimits:
      default:
        slime: 0
    asyncAutoSaving: true
    useAsyncChunkSaving: true
    
    Some, like asyncAutoSaving, are not in the plugin yet. Still testing those & preparing NoLaggChunks for it's first official 'stable' build. Spoiler: It reduces client lag a lot by properly queueing chunk and block change packets.
     
  18. If you do this, pls add an option to:
    • disable console output
    • print it to file and not console
    • or console
    I don't like my console being full of logs which are not important to me as they contain no ERRORS!
     
  19. Offline

    bergerkiller

    @Lathanael Ok good point, I'll make it write to a log file located in the NoLagg folder. I'll output data to the command sender instead of logging or System.out.println.

    EDIT

    Write to the log 24/7 or only if the command is invoked in the console? (and de-invoked)
     
  20. Whatever you think fits best, i'd say upon command invoked and stop it after given an abort command.
     
  21. Offline

    bergerkiller

    @Lathanael ok then it will log to that file when:
    is invoked into the console.

    Invoking the same command again will stop the logger. Output to the console or not? (does not go into server log)
     
  22. This should be optional imo. something like /nolagg monitorconsole or /nolagg mc or anything else, which puts the output to the console instead.
    But thats just my opinion.
     
  23. Offline

    bergerkiller

    @Lathanael in that case I'll add a separate command for it:
    Both activated in player chat and console. Consoles can use the monitor event like players can, but won't be logged.
     
    Lathanael likes this.
  24. Nice, i think this will satisfy all possible users, except the one who want it to be logged into file and to console.... but one can never please all ppl :D
     
  25. Offline

    bergerkiller

    @Lathanael also possible, you can write both to players, console and log.

    May need to improve the logged format for a bit. (tabs)

    Aah yep NoLaggChunks is going to make a whole lot of people very VERY happy :p

    Without it running:
    - Can't fly, get massive client lags, disconnections, socket errors, disconnect end of stream, freezes

    With it running:
    - Can fly at max speed into chunks, no disconnections unless you really mess things up, no lag at all!

    And that all...without a client mod. Aint that just amazing? All it does is:
    Code:
    chunkSendInterval: 4
    chunkSendRate: 1
    chunkViewDistance: 10
    chunkDownloadSize: 5
    Only thing left to fix is remembering the chunks, this will also fix those issues for Spout where chunks are missing. :)

    On a sidenote: decided to drop the whole compressed packet storing idea. It was not needed at all, all I had to do was tweak the timestamp to resolve sync issues.

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

    cybernetamd

    For fun I decided to spawn 1.2 million tnt with the wand, yeah my quad core xeon with 24gb of ram cant keep up lol. I had an extra world kicking around, had to put this plugin to the test :). Fun indeed.
    Cheers mate for making an excellent plugin haha
     
  27. Offline

    ledhead900

    Awesome but I noticed that Spout would not be storing any cache with ur last version is this fixed ?. If it is this will help a lot as Flying at FULL speed does not help when I was testing my modified world you know about from prev discussions :p.

    I can't wait to get my hands on this.

    Edit

    In a way this news makes me sad, you can realize so much to help severs and most of it simple stuff but NOTCH can't even fix blindly obvious bugs and even some of these are simple ideas are just too easy to solve and improve everything more then notch ever has.
     
  28. Offline

    bergerkiller

    @ledhead900 TBH, the entire Bukkit server can be optimized.
     
  29. Offline

    ledhead900

    You sir need to have a chat with dinnerbone or force a pull of bukkit and add all your ideas, PLEASE I will pay you to make me a custom bukkit will all your ideas like those. Hopefully it will alert the @Dinnerbone and will they will let u fix it with them. I much rather have bukkit run better out of box.

    Just FYI
    I may be a decent administrator with tons of computer experience but I am useless at code and programing in general. So I turn to people like you and others to get things in that are needed.
     
  30. Offline

    bergerkiller

    @ledhead900 Ow I lost all hope in the dev team a while ago. They are simply too busy with real-life issues, and that is obvious. It's not that they get paid to do this...

    Just look at the pull requests on Bukkit, it's ridiculously long. Lots can be improved, and lots is done, but never pulled. You made something which fixes chunk issues? Denied, it's too complicated. (...)
     
  31. Offline

    ledhead900

    Damn it so basically notchified, WHY, You would think haveing a huge list of followers would make you want to do it more, Except for notch but he was bad in first place.

    Well my offer stands if you can fix each reco build with your ides and others pull requests are good I will fund it. Hypothetically if dinnerbone lets you update it for them and join the team would you ?
     

Share This Page