Solved Strange Bursty Lag

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

RaidSoft

New Member
Jul 29, 2019
15
0
0
Edit: Problem solved for now, solution can be found in the thread but effectively I added these arguments to the startup .bat: -XX:UseSSE=4 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseParNewGC -XX:+DisableExplicitGC -XX:+AggressiveOpts and lastly nogui

Hello.

I'm having an issue with my server that I run myself on the same machine for me and 1 buddy, obviously running the server and client on the same computer is less then ideal but it's a pretty beastly machine so it should not be a problem.

Machine specs: Intel i7 3930k @ 4.2 Ghz (HT Disabled) with 16 GB Ram, GTX 560 Ti and a OCZ Vertex 3 SSD that the server and client both run from.

Software: Windows 7 Ultimate 64-Bit, FTB Ultimate 1.1.2, 3 GB set to client in launcher, server running with -Xms1G -Xmx4G. Java version 7 Update 21 (64-bit). Only mod added to the server is BechillTPS-universal-v0.4.1.1 for checking TPS (but lag was happening before I added that)

Problem: It looks like the server is only updating the client every 0.5 seconds or so and everything moves in "bursts" and I have checked to make sure that it's only visual lag and not tick lag. I tried wiping the client and getting a fresh download of it to exclude that is causing it and the video below is recorded with that fresh client. Obviously it's not network lag as the client and server is on the same computer and it's not fps lag nor tick lag so I'm at a loss at what could be the cause.

Other notes: I always make sure I manually assign the client to the first 4 cores and the server to the last 2 cores to make sure they do not interfere with eachother and there's always plenty of CPU power to spare (running client on 3 cores and server on the other 3 makes no difference)

I have recorded a video showing what I mean as it's hard to explain exactly what I mean with just words, here's the video:

Any help is greatly appreciated! If any more info is needed I'll be happy to add it, just ask!
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
Not assigning the cores makes it worse, the client and server starts competing for cpu causing increased server lag. I haven't tried setting the Xms and Xmx values to the same so I guess I'll try and do that but I doubt that's it, will be trying it quite soon though, thanks for the suggestions.
 

DZCreeper

New Member
Jul 29, 2019
1,469
0
1
Can you run the server and just have a client connect from outside, like a friend down the street maybe? You could also have them make a server, then you try and connect. We basically need to find out if its the server or client making that split second delay.
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
The friend I play with gets that lag too and he's connecting from the outside (plus some latency lag besides that but he sees the same effect) and yes even when I am not connected so that would indicate it's the server, but since the server is running at 20 TPS it makes it seem like it's the network traffic leaving the server that is the problem, even when it's running locally meaning it's actively being throttled by the server software itself or something like that..

I have yet to try the Xms and Xmx value change though and can't test it tonight (just about to head to sleep) but I will post an update once I try it when I wake up. Thanks again btw!
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
Changed the values and saw no difference, I seriously can't figure out the cause, it's so strange and I'm out of ideas on what to try..
 

DZCreeper

New Member
Jul 29, 2019
1,469
0
1
So there is no lag like this at all playing singleplayer? My most likely suspect would be your antivirus, try turning it off then starting the server and client.
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
I do not have any anti-virus running (Well Microsoft Security Essentials is installed but that has been disabled, only use it to run scans now and then and then I run them manually)

I also run everything as admin, I also take good care of my computer from filling it up with rubbish so it's a decently clean installation (self-built computer)

I tried putting the same world into my singleplayer save folder and loaded that up and there was no such lag so the lag is created by the server software and not anything in the world itself.. Hmm maybe something is broken with my server installation and I should clear that out and put the world on a fresh server install? I'll probably try that now.

edit: after moving the world to a new server download I am still getting the same lag.. But I wasn't when running that same world in single-player... Ugh this is driving me insane..
 

DZCreeper

New Member
Jul 29, 2019
1,469
0
1
Its driving me partly insane as well, there is zero reason why it would be doing this that I can think off. Last bit of bug hunting: Does the server continue to have this behavior with a brand new map?
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
Yep it does, I just started a fresh world and put up a quarry and I can see the exact same bursty movement on the quarry arm... Argh...
 

cjm721

New Member
Jul 29, 2019
734
0
1
Are you connecting to your self via localhost or putting in your own IP? As for some of the mods you can tune how many times per second they will send a packet to the client to update their mod blocks (such as quarries or pipes) and if that value is set high it causes the burst you describe, but that is just for the mods blocks its self not everything else..
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
I have tried connecting through both, I see no difference, my friend is connecting from outside and he sees the same thing.

I have not modified any configs from the FTB Ultimate 1.1.2 pack either, it's all standard configs.
 

cjm721

New Member
Jul 29, 2019
734
0
1
Well then I would go into your services and disable anything that does not need to be on. Expecialy Windows Update and Windows Network Media Sharing Service.
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
Both of those are disabled already, I always shut stuff of that I don't need or can manually run, that's the weirdest part as well and why this doesn't make any sense since it's not any obvious lag.

Would have been very easy if it was fps lag or tps lag but it's neither, it's kind of like it's buffering a small amount of network traffic and sending it in bursts (I actually checked network drivers to see if something seemed off there, I have a Gigabyte X79-UD3 motherboard which has a Intel based integrated network card and there's plenty of settings for that, all which was set to default)

I also checked if my windows firewall was causing it but disabling that (predictably) didn't change anything.
 

cjm721

New Member
Jul 29, 2019
734
0
1
odd. It cant be something with your network settings if you use localhost as that runs threw a diffrent path. If I was you I would rebuild the entire server and make sure your using Java 7 when it runs (double check as my sever loves to revert down to jre6 so I specify in start script which java)
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
I have manually changed the startup file to read like this: "C:\Program Files\Java\jre7\bin\java.exe" -Xms2G -Xmx4G -jar ftbserver.jar

Which will mean I directed it manually to the java7 64-bit installation (and I checked in task manager to make sure that's the one running)

Thing is when I run singleplayer I don't get the lag, I assume it doesn't go through network then which was why I was suspecting that. I'm probably doing a full java reinstallation though in case something has just decided to mess up that for whatever reason.
 

cjm721

New Member
Jul 29, 2019
734
0
1
single player connects to localhost. So that proves a few things. Change your start script to have nogui at the end. Also I look up extra java parameters.

Code:
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -server -Xmx8G -XX:UseSSE=4 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseParNewGC -XX:+DisableExplicitGC -XX:+AggressiveOpts -jar minecraft_server.jar nogui
 

cjm721

New Member
Jul 29, 2019
734
0
1
It can be used on windows too just change the file path to yours.


*edited out say.... on console way to much.
 

RaidSoft

New Member
Jul 29, 2019
15
0
0
Well I added those arguments (startup line now looks like this: "C:\Program Files\Java\jre7\bin\java.exe" -Xms2G -Xmx4G -XX:UseSSE=4 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseParNewGC -XX:+DisableExplicitGC -XX:+AggressiveOpts -jar ftbserver.jar nogui

And that lag is gone.... What the hell?