Lag problem
Nex4rius opened this issue ยท 35 comments
I'm playing on a server with around 10 active people and I am the only one using logisticspipe and everyone else uses AE2 but AE2 is not in opis at all (= no lag from it) but the logistics pipes stuff is at the top (almost 6ms).
Any idea what causes it and how to fix it?
This is what I have in my base.
http://imgur.com/a/td0Im#5
logisticspipes-0.9.2.33
Strange that AE2 doesnt appear at all...Normally its especially big AE2 networks wich are SUPER laggy.
Yet, ive not experienced the Logistics Crafting tables being a source of Lag by now.
As I see, you allready minimised the Networking by Creating Central lines with Branches, best seen in Pic#2.
Ill now ask you a few Questions to narow down the causes of the lag:
First:
Whats the actual TPS of your server and how many MS does it need to Update(Best seen with the /cofh tps Command) If Overall TPS is 20 and Timing MS is below 50 youre fine.
Second:
Is the lag prevalent, does it occur constantly or in cartain intervalls?
Or even more interesting, does it come up if you Perform a certain Action, e.g. Issue a Crafting Request.
Third: Do you have Requests being made automatically, e.g. Stockkeeping of certain crafted Items or Farms consuming Fertiliser?
Fourth: Do you make use of Tesseract Connections, Subnetworks or similar?
Fifth: Do you use any Thermal Dynamics Itemducts on your System?
If we cant narrow it down by these, you might have to perform a Visual VM sampling on your Server. @davboecki will instruct you on that.
Don't have access to /cofh tps so im using /tps which gives me tps 20 and 36ms (opis shows 32ms)
The 6ms showed by opis is always there but we also have a lagspike every 50sec (don't know if its caused by lp).
I have not noticed any extra lag when making requests, modifying the network or similar stuff.
I have a Diamond Chests with 6 Active Supplier Module keeping 1 stack of many different items in it.
I have no tesseracts or subnetworks but I have a "Logistics Inventory System Connector" to reduce waiting time on long distances (but I also have a pipe going all the way for eu transport).
I've put 3 new screenshots in here http://imgur.com/a/td0Im
The chassis pipe has an Extractor MK3 inside with a bc gate so it turns on for 5 sec when the chests is full because I already had it multiple times that the chests filled up and then everything got stuck.
I'm using the Infitech2 modpack and it is without Thermal Dynamics.
Well, if you have Stable 20 TPS and below 50 MS update time, you actually dont have any Lag... Because the Mean Value is so low the Tables arent really a problem.
Well when I checked the /tps I was alone on the server so thats why its at 20tps but we don't have stable 20 tps with more players online (3 or more) which is why we want to reduce it and lp is at the top of opis.
Thats an even more defenite sign of LP not being the Problem for your Server.
I rather blame massive EnderIO Conduit Stuffs and AE. Those are the ones who really create big Lag machines.
LP is extremely Smooth
But the enderio conduits are only at 2,2 ms and ae2 isnt in it at all.
(Does it mean opis isn't showing everything?)
It's likely that the big amount of LP pipes is a factor which causes tps decrease. The problem is, that we already optimised everything we know of. Without any sampling done by VisualVM or another profiler there is nothing we can do. And the other thing you need to consider, is that Logistics pipes do more than just AE2 or any other kind of duct. Every pipe does something where in AE2 you have your centralised system. When you have conduits you only move items around and don't have to deal with the networking stuff LP does. And if you say that it's not caused by an action [placing pipes/requesting items] we can't tell you what is causing it. I'm sorry to say that there is little to nothing we can do.
Here is a link to a Forum thread that documents the lag spikes that @DarknessShadow mentioned. Please let me know if there is any additional information you need.
I noted @davboecki 's comment about "the big amount of LP pipes is a factor which causes tps decrease" and "already optimised everything we know of". It wouldn't surprise me if he is correct because 1300 of any block that needs to periodically update routing tables and forces the rest of the Java threads to "wait" is going to cause lag. But hopefully I have captured something that helps improve things even more.
EDIT: Fixed my forum post linked above to correct my links to .nps files
@davboecki This is mostly a question because I do not know too well the history of the mod: why you not constructed routing logic based on a single central block, like the LP Power Junction stuff? I really not want to start arguing about this decision, I'm just curious.
@DarknessShadow about the 50sec lagspike: are you sure you did not configured any backup mod to fire up this often? If not, then I think it's just world save. If I were you I would check the disk operations when the lag spike appears...
Disk operations are fine, we run on SSD's as well which would help reduce anything like this lag spike. As for the configuration DarknessShadow has set, I cannot say. Not a physical server problem that's for sure, we're seeing the exact same spike on an exact replica of the server but on seperate phyical hardware.
Atleast we've hopefully got to the bottom of the issue. If you need anything further do let me know and we'll try our best to get it to you :)
@groveham with same or a different world?
With the same world. A complete duplicate of the server, running on a different physical machine had the exact same issues. We've tried three different machines so far all more than capable of running this servers setup.
One compelling arguement (see forum post above) is that we've been able to narrow the lag source down (most likely) to this mod. If we don't load the chunks with a big LP network in, the server runs fine. As soon as the chunks are loaded, the world lags and tps drops. We get lag spikes around 50 seconds apart and the odd timeout.
@DarknessShadow about the 50sec lagspike: are you sure you did not configured any backup mod to fire up this often?
I'm playing on grovehams server so I didn't configure any backups.
As for the configuration DarknessShadow has set, I cannot say.
What exactly do you mean?
I'm guessing he means like did you use any mods in conjunction with LP, to turn any power systems on incase your primary power runs out? Anything like that?
I'm guessing he means like did you use any mods in conjunction with LP, to turn any power systems on incase your primary power runs out? Anything like that?
No I'm not doing that kind of stuff with logisticspipes.
Ever concidered Garbage Collection as your 50sec re-iterating lagspikes? Because Minecraft lag that comes in Intervalls that stay the same over a long period of time and get worse with more Players mostly relates to GC.
And since there are alot of machines working in your World, and the Hardware change didn't do anything for you, I suspect GC behind it
We have, and it just doesn't add up to be honest. I'm on the server now monitoring it, we had 8 people on before and the server ran fine. No issues what so ever with a solid 20tps and decent ping. As soon as I went to DarknessShadows base with the LP network the lag hit, tps dropped to around 6tps and the ping rocketed to around the 118ms mark. Everyone on the server had block lag, mobs slowing down/freezing, everything you'd normally expect when lagging.
We captured some snapshots with VisualVM and I left the area, the chunks stayed loaded so we restarted the server, after the base chunks were unloaded then the tps was again a solid 20 with good ping.
(http://infitech.enjin.com/forum/m/26910956/viewthread/24015183-severe-server-lagspikes-logistics-pipes)
I didn't checked the pics before now, and the forum post is not available for me since I'm not registered on your forums. This is a really huge base with very intensive LP usage.
I can say from my experience since I'm not developing this mod nor any MC mods. LP causes lag if and only if it have to periodically handle a relative large amount (half-two stacks) of passing items on long distances. I experienced lag problem when I used LP to transfer wood from my treefarm to my Coke Ovens and the result to the RC boilers. Reducing the distance and limiting the amount of the items pass periodically drastically removed the biggest part of the lags. As you do not have EnderStorage mod, I can only recommend to transfer items with EIO item conduits on long distances and use buffer chests to convert from-to LP network. Yes, it breaks some requester/supplier systems, but this can be workarounded.
Second, revise supplier pipes/modules whether they autocraft things to supply inventories and consider making a big buffer with these stuffs and craft if and only if the buffer is almost empty.
Summarize this: try reduce the load of LP pipes. The idle pipes - as far as I know - makes a very little resource usage on servers, they just stay there like a dandelion in the plain. LP pipes are not really good in periodical tasks that happen too often. They need some (lot) of rest time.
I've edited the forum so everyone can now view it. You do need to register to reply however.
A tip: check with the new G1 GC too, Java arg: -XX:+UseG1GC. I do not say it would be solve all problems, but... as I read this GC is a bit less obtrusive.
@Bitterholz also check this too: http://www.infoq.com/articles/G1-One-Garbage-Collector-To-Rule-Them-All
@groveham Thanks for those snapshots. And there is one thing in there that's probably causing your trouble, Pipe Amount Signs. Looks like they check the amount inside the LP system far too often causing performance problems. Still need to check this in detail but there probably is something we can do about that.
As a reference: https://github.com/RS485/LogisticsPipes/blob/dev/common/logisticspipes/pipes/signs/ItemAmountPipeSign.java#L73 is probably to low and it should proably take the pipe offset into acount [use the pipe function isNthTick()]
@groveham You have my best wishes. Also, I considering trying out Infitech modpack and your server... of course, just for make a loooong test to make sure the lag is gone ๐
@hron84 Feel free to! DarknessShadow just came online so the lag is now back because his base is loaded but when he's offline the server runs 20tps, like a dream!
@groveham and what if you remove the mentioned signs?
I'm not sure where they are, I've never used this mod before :/ I'll have a look see what I can find
@hron84 @DarknessShadow removed them and now the tps is much more stable again ๐
@groveham The problem should be fixed with 0.9.2.36. Could you please check if it fixes the problem?
I ran 0.9.2.36 on the client and server and both crashed on startup with the below pastebin crash report:
http://pastebin.com/PmQFkaTY
Started the server and client using logisticspipes-0.9.2.45.jar and worked fine, confirmed the lag is gone with this build. Fully loaded @DarknessShadow base and the server ran steady at 20tps.
Just to make sure, I rolled back to logisticspipes-0.9.2.33.jar and the lag returned, struggling to get past 8tps when fully loaded the surrounding chunks.