EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   lag problems (https://www.eqemulator.org/forums/showthread.php?t=42311)

flbren 02-01-2019 09:08 AM

lag problems
 
What would cause lag on my server once 25ish toons enter a zone? The lag goes up steady to 15000+ms. With a couple toons in zone I have no issues.For example I can have 24 toons loaded in guild lobby and lag out from anywhere to 500ms to 15000ms but have 3 toons in pok at 60ms. Lag doesn't seem to affect other zones.

Nightrider84 02-01-2019 11:37 AM

Now to clarify is this 25 toons in 1 zone while 3 toons are in a seperate zone with no issues all at the same time? Or do you mean if you have more than X players at anytime the server lags everywhere?

flbren 02-01-2019 05:47 PM

The lag is contained in the zone with the 25 toons and other zones with 3 or 4 players run fine. When loading 25ish toons in the zone when I first log in my ms is fine. But after 20ish toons its starts rising to 200 300 1000 etc.

Nightrider84 02-03-2019 12:25 AM

Well that could be a few things, Could be router related. Sometimes older routers can't handle the required lanes of traffic from multiple locations. Quick test for this would be to have like 30 toons logged in. But put them in about 10 different zones and see if the problem shows up again. If the problem doesn't show up than it might be something on the server itself thats causing the issue. But that is a weird issue to have honestly. Also are these 25 seperate people or are they all bots ect?

Scorpious2k 02-03-2019 12:53 PM

You might also want to check CPU usage, RAM usage (and swap space), and especially bandwidth. Sometimes ISP's talk about xx bps but they are really talking about downlink (incoming) and uplink (outgoing) is much MUCH lower, which would limit packets going to clients.

flbren 02-03-2019 03:16 PM

25 separate accounts that I loaded. What I can tell everything looked ok from the host.

Nightrider84 02-03-2019 10:37 PM

well test the 25 accounts at once in difference zones and see if you get that same latency spike, if you dont then have them zone into the same zone and see if the problem arrises

ptarp 02-09-2019 03:38 PM

I'm having this same problem. Running the code on Windows 10, there is no problem.. running on any windows server version, the problem is exactly the same.

Running on Windows Server, if you distribute the toons in different zones, most times the lag will go away.. Put them all in the same zone, ping and packet loss increase until it's unplayable. EQ reports up to 5k m.s. pings on a server within my local network. Server CPU stays around 6%, memory around 3%, and network around 250kbs sent on a gigabit connection.
If you do have toons in other zones, they aren't affected until that zone is loaded up with toons also. 22 or so in lobby and 6 in WoS.. the 6 in WoS can keep playing, the ones in guild lobby all lag out.


Running on top of windows 10 on the same machine with a copy of the same code, and copy of the same database, the problem goes away. Log in same toons, put them all in the same zone, and it stays playable.

Akkadius 02-11-2019 03:13 PM

Just for visibility guys, this is a known issue that we have been working on as of late.

I'll keep you posted when we have an update, I've not had time for my emulator backlog in the past few weeks

Tom Cross 02-11-2019 09:08 PM

Does anyone know if this is happening on linux boxes too?

Akkadius 02-12-2019 09:14 PM

Happens on Linux too yes, slightly less prevalent because of net efficiency of the linux core but don't both making a switching decision on that alone

We have a solution, we've been carefully testing it over the past few weeks because its a complex problem

I'll update when we have it in, we need to run it on PEQ for a while now that we've had it running at smaller scale

Tom Cross 02-13-2019 03:45 PM

So we get the whole community to get on the PEQ and we all have a party in the Nexus for a good test run?

Akkadius 02-13-2019 10:38 PM

Haha, not quite necessary, we have between 500-1000 toons on in a given day we should be able to give it a good run

ptarp 02-15-2019 05:48 PM

Quote:

Originally Posted by Akkadius (Post 261693)
Just for visibility guys, this is a known issue that we have been working on as of late.

I'll keep you posted when we have an update, I've not had time for my emulator backlog in the past few weeks

I've tinkered with this a bit.. I've gotten ping times to drop down to 350 with 47 in zone by dropping some of the extra database calls that aren't needed in Client::Save(uint8 iCommitNow) function.

Binds are a big one especially now with 5 binds. They don't need saved every loop through client::save, because they are already saved every time they change.

Pets are another problem.. Every time it goes through the loop, pets shouldn't be saved for every toon. Even warriors were getting hit by database.SavePetInfo(this); call. I moved that up 4 lines just above the } else {.

I have also added a Boolean to mine to prevent saving tribute if it hasn't changed, though that call to database.SaveCharacterTribute(this->CharacterID(), &m_pp); could probably be moved right into Client::Handle_OP_TributeUpdate function.

Still weeding some of it out..

Akkadius 02-15-2019 06:18 PM

These are all separate from the issue reported in the thread

There is a network problem that occurs under the condition where enough clients are in a zone and one or many have not so great connections our server network code will resend very aggressively which results in a server with a lower CPU frequency such as a Xeon 2.3Ghz to essentially choke itself from the rapid burst of resend packets.

The resend packets are choked primarily by compressing packets and sending them over the line at a rapid rate and the CPU will max out for that thread and can take several minutes to recover from

Correcting the resend logic is a complex issue because we use dynamic algorithms for resend rate and packet recovery that has to take in a lot of different factors.

We have some ideal settings figured out and are looking to get them pushed to mainline as soon as we feel confident that they don't produce any more regressions

ptarp 02-16-2019 12:16 AM

Yes. This is different. Server is running on an i5. CPU stays low. Around 6%. The issue with me seems that entity_list.Process() is taking too long. By the time you get through the whole list of clients, the first one is starving for packets. Each client added increases the ms reading reported by EQ (F11 to show it in top left corner)

This same thing will affect all operating systems. Win 10 seems better than server, but is still not working well.

I enabled MySQL logging to disk. Logging was on a secondary SSD drive. MySQL data files on drive C:, server folder on D:. that's how I saw how many times per second the MySQL was being accessed.. Some of it may not take that much time, but all together, it's a DoS bomb for the hard drive even if it's SSD like mine. Turn it on and look at a zone with over 24 or 25 in it, and you'll see what I mean. Look at the times for the first client going through client::save and compare it to the last.
Since I'm logging on a separate hard drive, performance doesn't change when I turn logging on/off.

I recommend you think about dealing with this before you worry about re-send logic.
Correct the issues I'm talking about, and your re-send issues may go away.
Hope this helps.

Akkadius 02-16-2019 01:27 PM

Quote:

Originally Posted by ptarp (Post 261707)
Yes. This is different. Server is running on an i5. CPU stays low. Around 6%. The issue with me seems that entity_list.Process() is taking too long. By the time you get through the whole list of clients, the first one is starving for packets. Each client added increases the ms reading reported by EQ (F11 to show it in top left corner)

This same thing will affect all operating systems. Win 10 seems better than server, but is still not working well.

I enabled MySQL logging to disk. Logging was on a secondary SSD drive. MySQL data files on drive C:, server folder on D:. that's how I saw how many times per second the MySQL was being accessed.. Some of it may not take that much time, but all together, it's a DoS bomb for the hard drive even if it's SSD like mine. Turn it on and look at a zone with over 24 or 25 in it, and you'll see what I mean. Look at the times for the first client going through client::save and compare it to the last.
Since I'm logging on a separate hard drive, performance doesn't change when I turn logging on/off.

I recommend you think about dealing with this before you worry about re-send logic.
Correct the issues I'm talking about, and your re-send issues may go away.
Hope this helps.

Again, these are completely unrelated.

Just because you saw a bunch of disk activity and a bunch of queries in a file doesn't mean that its the reason for lag. If you have an improperly tuned MySQL server along with something enabled that is pegging your MySQL server that is another thing and I'm happy to help diagnose those with you

I want you to contrast all of what you observed with PEQ's disk activity:

http://peq.akkadius.com:19999/#menu_...late;help=true

PEQ has over 800 players right now at maybe stays around 1MB/s writes if at all and occasional bursts, IO operations stay down at a very very low amount even for 800 players

Client::Save is a very light operation, there's maybe a handful of INSERT's or REPLACE into's that occur which are all sub 10ms inserts. We could use less Client::Save's in general but it really isn't the problem here

You don't need to turn on the MySQL general log when you can see exactly what a zone process is doing by enabling MySQL logging at the process level. Even if you pipe that to another drive it still is overhead to the MySQL process

https://github.com/EQEmu/Server/wiki...-System#gm-say

In the `logsys_categories` table you can shut off any category you are piping to file

Back to the Network Issue

We know exactly what's going on with the network issue because we've taken CPU snapshot profiles during the problem. It's just not a quick "Fix" and we typically chose to go through a very careful staged approach before reintroducing this into mainline because of the complex factors involved

The reason we've seen this far less on PEQ is because PEQ has a OC'ed 5Ghz core processor, DDR4 memory and NVME Datacenter SSD's. When the zone processes goes into resend storm logic, it can keep up with the very aggressive resend logic just enough until the client either disconnects from their own terrible connection or the client itself recovers.

There is still a breaking point with our hardware however, it just takes a lot more to get there. If we had over 100 toons in a zone PEQ and we had something produce enough resend logic (Like raid combat spam burning) it would trip the same inflection point that most folks are seeing on their Windows nodes at 20-40 people in a zone with 2.6Ghz ish processors and whatever else they're using on their boxes. Even with over 100 toons it is still very rare to see it just because of the very tight hardware that is being utilized

Regardless, you shouldn't need the above specs to run a server, that is not the point at all. The point is why we've not run into this issue up until this point because most of our code QA goes through PEQ and our hardware has been masking the problem. Before we released the new netcode overhaul to mainline we went through several several iterations of issues and actually drastically improved our overall netcode utilization massively which I am still super stoked about to this day, we just have this one issue plaguing people and we will have it resolved soon, so just stay tuned for updates

Drakiyth 02-16-2019 09:30 PM

Quote:

Originally Posted by Akkadius (Post 261710)
Again, these are completely unrelated.

Just because you saw a bunch of disk activity and a bunch of queries in a file doesn't mean that its the reason for lag. If you have an improperly tuned MySQL server along with something enabled that is pegging your MySQL server that is another thing and I'm happy to help diagnose those with you

I want you to contrast all of what you observed with PEQ's disk activity:

http://peq.akkadius.com:19999/#menu_...late;help=true

PEQ has over 800 players right now at maybe stays around 1MB/s writes if at all and occasional bursts, IO operations stay down at a very very low amount even for 800 players

Client::Save is a very light operation, there's maybe a handful of INSERT's or REPLACE into's that occur which are all sub 10ms inserts. We could use less Client::Save's in general but it really isn't the problem here

You don't need to turn on the MySQL general log when you can see exactly what a zone process is doing by enabling MySQL logging at the process level. Even if you pipe that to another drive it still is overhead to the MySQL process

https://github.com/EQEmu/Server/wiki...-System#gm-say

In the `logsys_categories` table you can shut off any category you are piping to file

Back to the Network Issue

We know exactly what's going on with the network issue because we've taken CPU snapshot profiles during the problem. It's just not a quick "Fix" and we typically chose to go through a very careful staged approach before reintroducing this into mainline because of the complex factors involved

The reason we've seen this far less on PEQ is because PEQ has a OC'ed 5Ghz core processor, DDR4 memory and NVME Datacenter SSD's. When the zone processes goes into resend storm logic, it can keep up with the very aggressive resend logic just enough until the client either disconnects from their own terrible connection or the client itself recovers.

There is still a breaking point with our hardware however, it just takes a lot more to get there. If we had over 100 toons in a zone PEQ and we had something produce enough resend logic (Like raid combat spam burning) it would trip the same inflection point that most folks are seeing on their Windows nodes at 20-40 people in a zone with 2.6Ghz ish processors and whatever else they're using on their boxes. Even with over 100 toons it is still very rare to see it just because of the very tight hardware that is being utilized

Regardless, you shouldn't need the above specs to run a server, that is not the point at all. The point is why we've not run into this issue up until this point because most of our code QA goes through PEQ and our hardware has been masking the problem. Before we released the new netcode overhaul to mainline we went through several several iterations of issues and actually drastically improved our overall netcode utilization massively which I am still super stoked about to this day, we just have this one issue plaguing people and we will have it resolved soon, so just stay tuned for updates

Akkadius,

I just want to say that the Varlyndria players and myself really appreciate everything you and the main EQ Devs are doing to fix this lag issue. I could only imagine the frustration it could bring. One thing I have done for my hub zone is create public instances that players can travel to. This helps free up congestion if lag starts occurring in the non-instanced zone. I encourage any server owner to do the same while this issue remains.

Here is to a quick recovery so we can all once again enjoy a solid amount of players in the same zone with no issues.

eldarian 02-25-2019 07:53 PM

has there been any new progress on this issue? Very frustrating a commonly used processor for hosting is causing this much turmoil

Akkadius 02-25-2019 08:33 PM

Quote:

Originally Posted by eldarian (Post 261771)
has there been any new progress on this issue? Very frustrating a commonly used processor for hosting is causing this much turmoil

Update is we've had it on PEQ, we're making additional tweaks that go live tomorrow, this takes time to test until we feel its ready to go back into mainline

eldarian 02-25-2019 08:35 PM

i know AEQ would be very happy to be your test server for this fix community has communicated as much to me. feel free to reach out to me and we can do what we need too to test it in operation

Akkadius 03-02-2019 06:50 PM

We pushed changes last night that have been tested on PEQ for over a week with 800+ toons with no issues. Also tested on Legacy of Norrath before they shut down

https://ci.appveyor.com/api/projects...86-no-bots.zip

Give that a whirl

Drakiyth 03-02-2019 09:48 PM

Quote:

Originally Posted by Akkadius (Post 261826)
We pushed changes last night that have been tested on PEQ for over a week with 800+ toons with no issues. Also tested on Legacy of Norrath before they shut down

https://ci.appveyor.com/api/projects...86-no-bots.zip

Give that a whirl

I plan to add this tomorrow morning to Varlyndria. We all thank you for this fix.

eldarian 03-03-2019 11:16 AM

Quote:

Originally Posted by Drakiyth (Post 261827)
I plan to add this tomorrow morning to Varlyndria. We all thank you for this fix.

Let me know if this fix worked for you in any areas

Drakiyth 03-03-2019 05:08 PM

Quote:

Originally Posted by eldarian (Post 261831)
Let me know if this fix worked for you in any areas


I added the source code from Akkadius' link above to Varlyndria early this morning, and then did a stress test with the server that didn't go so well. I even tried the pull method of the latest unstable source in the folder. The stress test in Nexus started bugging out with 18+ players when the spike came back. It does appear to be better than it was before, but not what I was expecting. Varlyndria is currently on a AWS Large T3 windows system. It has held over 118 clients online + pets just fine as long as they are in different zones/instances of the high-traffic hubs and under 11 in total. (on average). Now it seems like 16-18 or so, but the lag does come back full force and spikes the zone out badly -- eventually crashing it, or forcing me to shut it down.

I've heard from a source on my discord that Linux using developers are having more luck with it. I've been running windows since I started with EQemu and I've never seen an issue like this before, aside from not having enough connection speed to handle the player population.

At this point, I am hesitant/undecided to see if a stronger connection than T3 Large would produce better results with the change.



Any professional advice that can be given on the situation would be helpful.

ptarp 03-04-2019 09:38 AM

There just appears to be something in the windows compile that's making it "hiccup".. I'm wondering if I have to switch to Linux.

Maze_EQ 03-04-2019 11:02 AM

Quote:

Originally Posted by Akkadius (Post 261826)
We pushed changes last night that have been tested on PEQ for over a week with 800+ toons with no issues. Also tested on Legacy of Norrath before they shut down

https://ci.appveyor.com/api/projects...86-no-bots.zip

Give that a whirl

It worked on our dev build with 80 clients in the same zone.

Our dev environment previously couldn't handle 20+.

ptarp 03-04-2019 12:36 PM

Quote:

Originally Posted by Maze_EQ (Post 261836)
It worked on our dev build with 80 clients in the same zone.

Our dev environment previously couldn't handle 20+.

You're running windows?

Akkadius 03-04-2019 02:44 PM

So - we could be dealing with a few factors here, while the resend issue was a very valid issue that we took care of, I have a hunch that something is of influence in the windows realm here

I have another question for you guys, where have you guys been getting your binaries?

Have you been compiling them yourselves? In the past few months we switched our main source of windows binary updates from our CI system and I just want to rule out a bad or imperformant library or compilation setting

At the end of the day, Windows or Linux you should be able to run on either, we'll get it figured out

Maze_EQ 03-04-2019 04:01 PM

Quote:

Originally Posted by Akkadius (Post 261840)
So - we could be dealing with a few factors here, while the resend issue was a very valid issue that we took care of, I have a hunch that something is of influence in the windows realm here

I have another question for you guys, where have you guys been getting your binaries?

Have you been compiling them yourselves? In the past few months we switched our main source of windows binary updates from our CI system and I just want to rule out a bad or imperformant library or compilation setting

At the end of the day, Windows or Linux you should be able to run on either, we'll get it figured out

I built these myself.

I'll see if i can repro with your installer.

Akkadius 03-04-2019 07:56 PM

For the sake of troubleshooting, can you guys try this build? No guarantees but it will tell us something if the symptoms go away

https://ci.appveyor.com/project/KimL...2988/artifacts

Drakiyth 03-04-2019 09:27 PM

Quote:

Originally Posted by Akkadius (Post 261840)
So - we could be dealing with a few factors here, while the resend issue was a very valid issue that we took care of, I have a hunch that something is of influence in the windows realm here

I have another question for you guys, where have you guys been getting your binaries?

Have you been compiling them yourselves? In the past few months we switched our main source of windows binary updates from our CI system and I just want to rule out a bad or imperformant library or compilation setting

At the end of the day, Windows or Linux you should be able to run on either, we'll get it figured out

Lately I've been getting the updated source and binaries from the installer prompt in the main server folder: eqemu_server.pl

When I tried it the first time I got the files you put on this thread and also tried the latest unstable I pulled from there.


I'll load up those new source files you posted in a few here, stress test, and than share our experiences on here.

Drakiyth 03-04-2019 11:59 PM

The experiment with the binaries you posted above failed at 18 players with a few pets out. We spiraled out of control with lag in the Nexus.

Akkadius 03-05-2019 03:05 PM

Sounds good, thanks for trying that

Good News

Our core configurations are easy to tweak

Bad News

We don't know what settings to tweak yet

Good News Again

We are working on integrating stats tooling into the server code so that you guys can give us dumps on what is occurring in the zones at the time of this so we can see exactly what is happening at the network layer so we can give a proper prognosis

We are also working on a way to connect hundreds of headless clients to a server to simulate a stress condition so we can also debug this same issue without being reliant on someone with a player base and players logging in to replicate this issue, we can then replicate it on our own

That being said

The resend issue discussed prior in this thread was a real issue and we addressed the aggressive resend issues in weeks worth of testing on a few different servers

It seems that this network issue is common to Windows environments on a 2-2.6ghz Xeon chip and anytime there are 20+ clients in the zone

We are committed to getting it resolved, you shouldn't need to switch your OS and hardware to get around this issue so please be patient and we will get it sorted

eldarian 03-05-2019 11:10 PM

I can confirm that I 100% agree with Akkadius. I attempted to upgrade our hardware and in my folly i was wrong. superior hardware is not going to fix this issue. I changed from a xeon 2.0 processor to a Intel I7-6700 32gb etc. and experienced the same issues. So at the very least we have eliminated the theory of hardware.

blooberry_eq99 03-05-2019 11:10 PM

We just tried running the installer on a fresh setup, and started getting lag once we passed 23 in zone.

ptarp 03-07-2019 10:51 PM

Quote:

Originally Posted by blooberry_eq99 (Post 261854)
We just tried running the installer on a fresh setup, and started getting lag once we passed 23 in zone.

As another test.. Use the same binaries, everything else.. but in the /Maps/nav directory, create a subdirectory. Something like /Maps/nav/removed

Move all of the files from the /nav directory into the new subdirectory. Then run the server again.. Lag goes away for me.

NOTE: I'm working with highly customized server code and don't have the latest update.

As a second test, I turned off .mmf file loading and left .nav files in the /nav directory. Either solution worked for me.

eldarian 03-07-2019 11:02 PM

I will trying this on Alternate Everquest and report back if this works for us

Uleat 03-07-2019 11:39 PM

MMF loading has been disabled for some time.

The new mapping system has not been applied to mmf loads and, tbh, I am unsure of the behavior of trying to use them.

Worst case scenarios, you would default to standard map loading or zone crashes.

The pre-built binaries do not include mmf loads as an enabled option.

Drakiyth 03-08-2019 12:51 AM

Waiting until Akkadius posts an official fix before I would touch the maps and navmesh files. That sounds like a bandaid fix which could lead to some zone crashes or NPCs screwing up, and not a full-on repair of the problem.


All times are GMT -4. The time now is 11:22 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.