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

    narrowtux

    Well if that is so, you could also leave it as it is. :p
     
  3. Offline

    strontkever

    is it possible to let the server only send the "can be seen" chunk-parts, instead of sending all chunks even if the player would never posibly see it?

    am i right chunks are divided in 16x16x16 pieces? and also send per piece?
    so i mean only sending the chunk-parts "visible" and not sending other chunk-parts at all.

    i run at view-distance=4
    and when a player on surface joins, its rendering chunks he is on, and also all stuff underground

    this way it takes some time to reach the view-distance, because it spends alot of time rendering underground. (caves show up etc)

    im looking for this becuase of my bandwidth problem,

    i dont care how much resources/cpu etc it uses, got plenty of that

    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  4. Offline

    bergerkiller

    strontkever
    It's possible yes, but it's not done. I could stop sending non-visible chunks at all, but it can cause the client to lag as well. (it then renders complete air; yup...)

    In that screenshot it looks like the semi-transparent chunk issue; it's not related to bandwidth. The chunks are there, but the client is too slow at rendering then. When you get near, it renders them.

    I still don't know what exactly causes it to happen, but it appears to happen whenever the server view distance is lower than 6. (someone reported that)
     
  5. Offline

    sagethor

    That's the purpose of OpenGL clientside. However, some graphics cards don't support it.
    For servers, they just send chunks, which are 16x16x128, NOT 16x16x16.
     
  6. Offline

    strontkever

    ok thanks both u guys for answering,

    are there any things u can add to your plugin towards bandwidth?
    im using the chunksend delay and i like that

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 2, 2019
  7. Offline

    Samzapp

    Could you move the download links to the top of the first post? I hate having to scroll down to the near-bottom of the post every time. Also, is the current version 1.63 or 1.64? It says 1.63 here, but the .zip file says 1.64.
     
  8. Offline

    bergerkiller

    Samzapp the latest is 1.64, the only difference is the library used. (fixes some issues, for NoLagg the only noticeable difference is that it now detects Bleeding Mobs / Showcase again)

    And it can go both ways; I tend to put it below the page so people first read the page itself before downloading :)
     
  9. Offline

    phanaticd

    is there any way i can get JUST the feature the groups the dropped items? thats the only thing I want, this plugin causes so much lag with logblock and worldedit and gives me tons of errors with mcbans and lockette
     
  10. Offline

    Borch

    phanaticd Set everything to false in the config except item stacking? Or just use CB++...

    bergerkiller Well I figured out how the built in profiling works, it gives something like this for NoLagg:
    (This is from about 5-10 players at the same time, server uptime 2-3 hours)

    Looks quite usable, if you can manage to hook into this.
    Also looks like NoLagg is really quite efficient :) No event takes longer than ~0,1ms except block place. (Well and world setup stuff, but I think you can ignore that)
     
  11. Offline

    bergerkiller

    phanaticd exactly what errors do you get from worldedit and lockette?
    I can somewhat filter some messages I guess.
     
  12. Offline

    bergerkiller

    strontkever to safe bandwidth you can reduce the maximum sending rate; this will make chunks sending to the clients a little slower.
     
  13. Offline

    phanaticd

    Borch :O thanks you so much
     
  14. Offline

    Pr07o7yp3

    Becouse this plugin the items of the players disappear when they drop it on the floor...
     
  15. Offline

    Borch

    Pr07o7yp3 Because you didn't configure the plugin properly...
     
  16. Offline

    Pr07o7yp3

    And what I have to configure?
    I thought that the default configuration is the best...
     
  17. Offline

    Averus

    v1,64 still sux, plugin useless with 50+ ppl, only tnt buf works well, all other options cause 3-4 tick rate drop, but maybee newbes with 10-20 ppl on serv like it.
    70+ serv runs better without Nolagg gg gg gg gg

    turn off chunkSending and tick rate is better
    item limit still cause drop too disapier

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  18. Offline

    Phibedy

    Hi, I canĀ“t find a command to define the chunks:
    Code:
    Keep chunks loaded
     
    Since 1.1 you can set a delay for chunks to stay loaded. You can use this to keep commonly-visited chunks in memory and prevent them from unloading and loading frequently.
    best regards Phib
     
  19. Offline

    Averus

    Berg, you need do updateInterval less agresive
    i set updateInterval: 800
    and have lags every 800 ticks
    updateInterval: 20,40,80, 160, 360 same lags
    and
    useEntitySpawnLimits dosnt use updateInterval
    set SpawnLimits = 10 mob updateInterval = 1000 and you dont see mob spawns
    i think you dont test you soft at all
     
  20. Offline

    Iyeru

    Need to update it to the latest craftbukkit recommended build (1.1-R4, or known as 1938 (As do a lot of other plugins like CraftBukkitUpToDate.)
     
  21. Offline

    vander_fr

    Cb-1846 (1.1-r3 )


    Config.yml

    Code:
    # Sets if and how many items are buffered per chunk
    bufferItems: true
    maxItemsPerChunk: 40
    bufferTNT: true
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 5
    useSpawnLimits: false
    spawnlimits:
      default:
        mob: 1000
    useChunkUnloadDelay: true
    chunkUnloadDelay: 10000
    formItemStacks: true
    stackRadius: 1.0
    stackThreshold: 2
    ignoredItemTypes:
    - DIAMOND_PICKAXE
    autoSaveInterval: 400
    updateInterval: 20
    monitorInterval: 40
    autoFixLighting: true
    useBufferedChunkLoading: true
    chunkSending:
      enabled: true
      minRate: 0.25
      maxRate: 2.0
      triggerRate: 0.5
      sendThreadCount: 4 (the only thinh I've changed because I use 4 java threads ).
     
  22. Offline

    Averus

    4 java threads??? how?
     
  23. Offline

    vander_fr

    My start command line is : ( on linux ) :

    Code:
    java -Xms4096M -Xmx4096M -XX:UseSSE=4 -XX:ParallelGCThreads=4 -jar craftbukkit-SERVER-1.jar nogui
    Admiting we need to allow java to have 4 threads to allow some multi-threading plugins to use them, but I could be wrong ;)
     
  24. Offline

    Averus

    you are wrong, -XX:parallelGCThreads=by default is = cpu cores
    bukkit connot use more then 1 cores, plugins use all cores by default
     
  25. Offline

    sagethor

    vander_fr
    Averus
    Well, the chunk send threads are threads dedicated to the compressing of packets. Threads are not cores; they are run on cores (or something like that). The parallel garbage collection thread sets a number of these to do some garbage collection related tasks.

    So I recommend testing and experimenting with different chunk send thread numbers; if they're pretty busy on the /Nolagg monitor command, add more and vice versa. 1-2 may be all you need. And threads don't need to be assigned.

    Sorry for the long post,heh.
     
  26. Offline

    strontkever

    i use this plugin for delaying chunksending,

    though im making a request for making the "chunk sending mechanics" optional,

    at some point its rendering forward too much while the player makes a turn and sees alot of missing world, i rather have them all loaded around even when the dont look at them, since most players (on my server) barely travel 1 way + chunks are rendering fast enough since they can only walk (walking isnt that fast ;))

    please consider
    strontkever
     
  27. Offline

    o0AzzA0o

    @bergerkiller
    on R4

    2012-02-15 19:03:06 [SEVERE] at org.bukkit.craftbukkit.inventory.CraftItemStack.getMaxStackSize(CraftItemStack.java:137)
    2012-02-15 19:03:06 [SEVERE] at com.bergerkiller.bukkit.nolagg.WorldStackFormer.updateItems(WorldStackFormer.java:80)
    2012-02-15 19:03:06 [SEVERE] at com.bergerkiller.bukkit.nolagg.WorldStackFormer.run(WorldStackFormer.java:176)
    2012-02-15 19:03:06 [SEVERE] at com.bergerkiller.bukkit.nolagg.meta.WorldMetaData.updateStackFormingAsync(WorldMetaData.java:101)
    2012-02-15 19:03:06 [SEVERE] at com.bergerkiller.bukkit.nolagg.StackFormer.run(StackFormer.java:26)
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
    2012-02-15 19:03:06 [SEVERE] java.lang.NullPointerException
     
  28. Offline

    kaasinees

    hey bergerkiller do chunks have timestamps? i had this idea that if minecraft implemetned this idea it would totally reduce chunk lag. let the client store all chunks locally. when a chunk changes the server updates the timestamp. the client sends a timestamp check to the server, if the server sees the client timestamp of the chunk is < the server timestamp it sends the new chunk to the client. a hash of the chunk is also an option, but it might lag calculating a new hash every time a block gets destroyed/added, so i thought a timestamp is fast. what do you think?

    Obviously we are not getting each other because none of the problems you mention will occur with proper coding.

    HDD space is trivial, a whole world file is what, 100mb? and the player only uses ~20mb? trivial. and caching could be optional in the client as well.

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

    bergerkiller

    kaasinees I believe the Spoutcraft launcher does this. There is one issue though:
    - You need to keep track of every block change for every player
    - There are block physics that force block changes (lava, water, redstone). This makes it impossible to store these chunks

    There is too much background noise to properly store these chunks and keep them updated; it would require infinite chunks to be active at the client. (and thus the client receives chunk updates from hundreds of chunks away)

    And props to the bukkit forums not alerting me...sigh :/

    And yes, you need to configure the plugin to what your server needs. The updating may or may not cause tick lag drop, so that is why you need to change the interval if it is too high.

    Averus can you monitor the server and post a screenshot of the result? I need to know what's lagging your server then. (is it chunk updating, spawn limiting, generating the entity lists..?)

    kaasinees Either of us don't understand something, that is for sure. You want to store chunks in a cache at clients - that is possible. What will ensure the chunk data at the client 'cache' is up-to-date? A timestamp. What should happen if the chunk at the client is not up-to-date? Send the chunk. What happens if the chunk is never up-to-date? (lots of chunk changes happen) It sends the chunks just like it does now, only difference being that the client stores a waste of outdated chunks.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 26, 2019
  30. Offline

    kaasinees

    - How is "keeping track of blocks an issue? the server needs to process that data anyway updating a timestamp everytime a player changes a block is trivial.
    - i still dont see any problems with that, the only problem ican see is that with redstone circuits it will update the timestamp on the server a lot and that adds extra CPU%.
    But that CPU% is regained by reducing much of the network traffic. With proper coding ofcourse.
     
  31. Offline

    bergerkiller

    kaasinees clients need the updated chunks as well if you want to store the chunks. You can send partial chunk data to 'update' at the client, but to do so requires keeping track of everything every player has in the cache.

    A timestamp won't do; then the server is sending all the same chunks anyway. (the chunks never stay 100% the same all the time) It only adds overhead.

    Averus you better keep it calm mister, it's not like I do this to receive a pay-check of 500 euros on the end of the month. (and even that is low considering the amount of code I have to process each day)
    Sorry it doesn't work out for you then. Now time for answers.
    Kinda obvious? A mob limit of 3 OBVIOUSLY limits the mobs to 3. The update interval has nothing to do with that; the update interval is a safety check for any mobs that got added another way.

    You clearly have no idea how a plugin works. First of all, a few considerations.

    Toggling animal and monster spawning on worlds - pros and cons

    Pros:
    - it is very lightweight
    - nothing has to be handled since nothing gets spawned

    Cons:
    - you can't set mob-type specific limits
    - plugins (like MyWorlds) which toggle this state as a feature will fail to work
    - no new mobs will ever get spawned; the server will end up with long-forgotten mobs (Nolagg recycles them to bring new mobs into the world)
    - chickens reach a limit? Cows won't spawn either. This is where the issue lies right now...

    Manual spawning

    I can't access native coding, so I end up writing something that is 50% less efficient and requires a lot of reflection calls to get the job done. I will have to copy and paste the entire mob spawning code. Other plugins are unable to disable mob spawning on worlds, because it is always disabled. Instead NoLagg is overriding this setting. People won't like mob-less worlds to end up spawning while this was disabled.

    I recommend you visit GitHub and look at the source code, let's see how much you know about NoLagg really. And for your information, I am writing a complete log reader GUI with graphic view. I already wrote a complete server logger which logs all plugins, events and tasks. But, of course, I can stop working on this plugin altogether if you like that better...

    tldr; inflammatory post much?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2019

Share This Page