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

    bergerkiller

    @FlynnTaggert same answer then, go back to 1533 (as vicente said) or wait for me to upload 1.50.1. (waiting for an update of the Bleeding Mobs plugin to upload it)
     
    kahlilnc likes this.
  3. Offline

    spunkiie

    @bergerkiller

    Will the 'reload' option be present in 1.50.1 ? ty
     
  4. Offline

    bergerkiller

  5. Offline

    rtcabooservb

    Any ETA on the fix for CB 1537 and Spout 567? :p
     
  6. Offline

    bergerkiller

    @rtcabooservb well tonight...but still need to verify that the blood thing works correctly. :)
     
    BioRage likes this.
  7. Offline

    rtcabooservb

    Ah, darn. Okay, thanks for notifying me. I'll just start the server back up without NoLaggs then, have anxious people waiting to play. :p
     
  8. Offline

    bergerkiller

    Ow well updated it anyway, got to sleep... it's 3AM :/
    Note that BleedingMobs is still undergoing some small fixes, but 1.51 already expects the new parts to be present.

    Short changelog:
    NoLaggChunks
    - 'download mode' improvement
    - no longer sends entity/vehicle spawn packets of dead entities
    - sign/trigger 'post' packets are sent 2x with interval

    NoLagg
    - Added support for BleedingMobs
    - DummyWorld improvement for the changed CB 1535+ (still compatible below)
    - Added item type ignore exceptions used internally

    probably some other things too, can't remember at this time.. xd
     
  9. Offline

    spunkiie

    @bergerkiller

    You are tha fuckin' man! Reload works like a charm and now our 600+ players will finally have some mobs to play with. Thank you very much.
     
  10. Offline

    rtcabooservb

    @bergerkiller

    Still noticing invisible signs with the latest update 1.50.1. CB 1537, Spout 567.

    Edit: This is with NoLagg Chunks.

    Edit2: Tried everything in the config, from slowing down to speeding up the chunk rate, increasing how make chunks are to pre-buffer, and how many chunks load per interval. Still gives invisible signs. Going to have to remove the NoLagg chunks plugin until it is fixed.
     
  11. Offline

    fffizzz

    Hey @bergerkiller
    CB 1538
    NoLagg 1.51 and NoLaggChunks

    Im having a strange issue (multiverse) where when you connect, all chunks load super fast which is awesome. Upon world change/portal to another world, again all chunks load super fast EXCEPT those few chunks that immediately surround you, making it so you cant go anywhere because your floating. If you disocnnect and reconnect, it loads perfect again till world change. You can see first hand at s.myminecraft.com:25565

    NoLagg Config
    Code:
    chunkUnloadDelay: 10000
    maxItemsPerChunk: 40
    tntDetonationInterval: 1
    tntDetonationRate: 10
    explosionRate: 10
    updateInterval: 20
    autoSaveInterval: 400
    formItemStacks: true
    stackRadius: 1.0
    stackThreshold: 2
    bufferTNT: true
    bufferItems: true
    useSpawnLimits: true
    useChunkUnloadDelay: true
    monitorInterval: 40
    autoFixLighting: false
    
    
    NoLagg Chunks Config
    Code:
    chunkSendInterval: 4
    chunkSendRate: 1
    chunkViewDistance: 10
    chunkDownloadSize: 5
    clearRawData: true
    
     
  12. Offline

    Flatliner

    Strange you're getting invisible signs, I've yet to have any invisible signs since the last update although I haven't updated to the latest build of bukkit yet (I'm on 1533). Only change I've made to my chunks config is to drop the interval to 2 instead of 4. One person was kicked for some strange compression error but it's only happened once so I'm not worried about it.
     
  13. Offline

    Jadedwolf

    I had this issue also, it seems to be an issue with only nolagchunks.jar. So if you remove that it fixes it.
    Though a fix would be far better.
     
  14. Offline

    chiisana

    Thanks for the latest NoLagg update that made it work with 1537 and later!

    I noticed in the latest build (not sure if it came in earlier), NoLagg seems to eat Exp Orbs, and Exp Points. As a result of that, our exp farm doesn't provide nearly as much exp anymore. Here is a video demonstrating what I mean.

     
  15. Offline

    bergerkiller

    @fffizzz @Jadedwolf What if you set the sending interval to 2 or 1? It then sends chunks faster.
    The reason nearby chunks load quickly is because of the 'download size', it's the view distance that is instantly compressed and send to the client when he connects or enters a new world.
     
  16. Offline

    Sepulzera

    Show Spoiler
    Code:
    2011-12-01 16:46:55 [SEVERE] Error occurred while enabling NoLagg v1.49.3 (Is it up to date?): null
    java.lang.AbstractMethodError
        at net.minecraft.server.WorldMapCollection.b(SourceFile:107)
        at net.minecraft.server.WorldMapCollection.<init>(SourceFile:29)
        at net.minecraft.server.World.<init>(World.java:154)
        at net.minecraft.server.WorldServer.<init>(WorldServer.java:27)
        at com.bergerkiller.bukkit.nolagg.ChunkSaving.init(ChunkSaving.java:69)
        at com.bergerkiller.bukkit.nolagg.NoLagg.onEnable(NoLagg.java:193)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)

    Most recent uploadet NoLagg version, CB#1538

    -> Did you upload the wrong file? oO

    Edit: Strange, now I've tried it again, and its working (same file that I downloadet before). Seems I'm a noob and failed in replacing the file.
     
  17. Offline

    bergerkiller

    @Sepulzera I think you downloaded the wrong file xd
    Latest is 1.50.1, checked that here.
     
  18. Offline

    llehctim4

    I don't know if anyone else has had this issue, however I am unwilling to read through 50 pages of posts, but it seems when I use no-lagg it makes my server more laggy. No-lagg chuncks reduces lag a bit, but Ive had to disable no-lagg for now. BTW I am running a small home-hosted server.
     
  19. Offline

    bergerkiller

    @llehctim4 See main post :)
    There are 3 different types of lag I distinguish:
    - Network lag or 'latency'
    - Tick lag 'tick rate too low'
    - Client lag or 'fps lag'
    This plugin focuses on network lag using NoLaggChunks to send the visible and useful chunks in batches, instead of pushing lots of chunks to the player all the time, this way increasing the amount of players a server can handle.

    It also focuses on client lag by fixing lighting issues, removing 'way too many items' through stacking and buffering. It also uses entity limits to reduce client lag. (for example, arrows) TNT issues are both client sided and tick lag sided, since it also reduces the amount of explosion packets.

    It also focuses on tick lag by using async chunk saving, unload delays, mob spawn limits, etc.

    This all obviously takes a little more CPU to perform. To fix entity counts, it requires the plugin to loop through all entities on all worlds, which has to be done synced. This is as optimized as can be, but still taking 10-30 ms in total to perform. (thus there is an update interval value you can increase in case it takes too long)

    So, when someone complains of 'lag' this is completely irrelevant: I need to know WHAT lag it is. Did the tick rate drop? Do clients freeze? Do chat messages and blocks changes take seconds to be received?
     
  20. Offline

    formaldehyd

    Is it possible to add an option for disabling the stacking of exp-orbs?
    My players say with NoLagg they get less exp if they kill more than one mob. (for example at mob-traps)
    Is this be possible? Without NoLagg its working fine they say...
     
  21. Offline

    bergerkiller

    @formaldehyd interesting, it should simply addition the XP when stacking:
    Code:
        public static void updateOrbs(List<Entity> near, List<ExperienceOrb> orbs) {
            if (!ItemHandler.formStacks) return;
            for (ExperienceOrb orb : orbs) {
                if (orb.isDead()) continue;
                if (addSameOrbsNear(near, orbs, orb)) {
                    if (near.size() > stackThreshold - 2) {
                        for (Entity e : near) {
                            if (e.isDead()) continue;
                            //add the experience
                            ExperienceOrb to = (ExperienceOrb) e;
                            for (Entity ee : near) {
                                if (ee.isDead()) continue;
                                ExperienceOrb from = (ExperienceOrb) ee;
                                to.setExperience(to.getExperience() + from.getExperience());
                                ee.remove();
                            }
                        }
                    }
                    near.clear();
                }
            }
        }
    I can't really spot the issue... xd
    *edit* nvm I'm blind...Im looping through the near collection twice? wut...

    EDIT

    Ok updated it. Could someone check if the sign text is properly displayed now and/or experience orb XP is correctly stacked?
     
  22. Offline

    rtcabooservb

    Yeah, I'll check for you. :p

    Edit: Signs seem to be working again.

    Edit2: New bug? When flying around, you know how minecraft has invisible chunks that you have to get close to for it to refresh, or change your fog/relog? Well, they aren't refreshing lol.
     
  23. Offline

    llehctim4

  24. Offline

    bergerkiller

    @rtcabooservb ok then the post-update triggering DID have effect in the end. I'll bring that system back :)

    @llehctim4 Try performing:
    Code:
    /nolagg fix
    While in-game. It will then fix all nearby chunks from lighting issues lagging the client.
     
  25. Offline

    formaldehyd

    Now i've tested it for myself: Same Amout of Mobs with and without NoLagg.
    Result: Nearly same exp with the newest version of NoLagg

    It seems to be working. Thanks!
     
  26. Offline

    Jadedwolf

    Same issue. The issue is it does not load the spawn chunk. Which should stay in memory and not be unloaded in the first place. However your code seems to keep it unloaded. Again I'm making assumptions here.
     
  27. Offline

    Borch

    @bergerkiller @Jadedwolf It's the same bug again I reported one or two pages ago and that got fixed - traveling to another world by portals leaves the chunks at and around the portal unloaded. I can confirm that bug exists in the current version, while it was fixed after I reported. Must have slipped in again somehow
    Doing /nolagg fix helps, but then you're stuck in the ground.
    :(
     
  28. Offline

    bergerkiller

    @Jadedwolf actually, chunk loading and sending are two different things. The fact that you are stuck in the ground proves that the chunk is loaded, just not sent to the player somehow.

    *edit*

    Ok fixed it, had to handle onPlayerPortal as well. (must be a new event?)
    Updating... Updated to v1.50.3

    - Portal teleportation now correctly re-sets the world for NoLaggChunks (fix)
    - Trigger is now sent 2x, to ensure the chunk is made visible to the client (no transparent chunks)
     
  29. Offline

    Jadedwolf

    When teleporting the chunk where you teleport to still does not load.
    Requires a relog to fix it.
     
  30. Offline

    fffizzz

    Was just coming to report the same thing. Just updated..

    2011-12-01_19.53.59.png
    Everything except the spawn chunk loads fine.
     
  31. Offline

    bergerkiller

    @Jadedwolf @fffizzz and this only happens when teleporting cross-world, and not when teleporting towards a far-away location on the same world? To be honest, I had the above situation once but never saw it again after adding that portal teleport event handler.

    Also, what teleport plugin do you use to teleport to that chunk? I need to know if it fires an event at all, and a way to check it. Also, are you running a local server (same computer as your client runs on) or on a server you hired?

    The screenshot matches exactly what happens: it notices a world change too late, which causes it to handle the chunk download session too late.
     

Share This Page