AttorneyOnline / tsuserver3

An Attorney Online server.
GNU Affero General Public License v3.0
25 stars 51 forks source link

Unreasonable amount of lag during handshake #166

Open in1tiate opened 3 years ago

in1tiate commented 3 years ago

tsuserver3 has about 1-2 seconds of lag between the user clicking the server entry and the handshake completion, even on local servers. Contrast this with akashi, which completes the handshake near-instantly on a local connection, and it's clear something is severely hampering performance here.

caleb-mabry commented 3 years ago

@in1tiate Is the video I have attached the lag that you're talking about? I don't think that it's any huge problem. Seems pretty on-par with how long things usually take to load on the internet?

https://user-images.githubusercontent.com/36182383/115163091-2bb78f80-a075-11eb-8099-999242ac7927.mp4

        tic = time.perf_counter()
        c = self.client_manager.new_client(transport)
        c.server = self
        c.area = self.area_manager.default_area()
        c.area.new_client(c)
        toc = time.perf_counter()
        print(f"Time to response was {toc - tic:0.4f} seconds")

I've timed the above code to see what it was looking like for creating a new client when the user clicks on the server and got: image

Which is well within the range of the general UI/UX response time.

Thoughts??

in1tiate commented 3 years ago

The amount of lag is negligible when network latency is not a factor, however when it is a factor tsuserver can take upwards of 2 seconds to properly finish the handshake

caleb-mabry commented 3 years ago

The way you're explaining this makes it seem like it's a network latency problem and nothing with TSU? If the handshake with no latency is ~0.0011 seconds and with network latency is more, that's not an issue with TSU, right?

oldmud0 commented 3 years ago

I don't remember which part of the handshake tends to take the longest, other than the initial TCP connection. Maybe look into the HDID/ban check.