Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: Analyze network activity for potential network savings #3875

Closed
eordano opened this issue Jan 2, 2023 · 1 comment
Closed

Spike: Analyze network activity for potential network savings #3875

eordano opened this issue Jan 2, 2023 · 1 comment
Assignees

Comments

@eordano
Copy link
Member

eordano commented Jan 2, 2023

Analyzing the network requests the explorer makes is a very useful way to debug and understand the lifecycle of the world renderer. Some work has already started with Enter the world - with wallet, signed in, no cache. We need to:

  • Dump a har file for the minimum user flow to render the world with wallet and as guest, having entered before and also without having entered, and with/without caching resources by entering the world before.
  • Explore the differences with/without cached assets to figure out if there are assets that lack proper cache
  • Explore the differences with and without wallet to figure out if there are extra requests related to the user's profile that could be parallelized
  • Extract network insights from looking to the frequency, duration, transfer size, paths, and domains the requests point to.

Results from this spike should be posted here, with the relevant insights to continue planning how to improve network performance

@2fd
Copy link
Contributor

2fd commented Jan 9, 2023

My analysis didn't reveal any low-hanging fruit that can be tackled. Instead, these are the improvements that can be made in order to reduce the network load:

Reduce unity build size below 42Mb

Chromium-based browsers don't cache file bigger than 42Mb

Screenshot 2023-01-09 at 02 20 07

Related issues:

Prevent teaching data from events before entering the world:

The site fetches data from events before the user enters the world.

Screenshot 2023-01-09 at 02 07 57

Related issues:

map.png response time can be affected by high traffic

By itself, the map's images from https://api.decentraland.org/v1/map.png are not taking long, but if user traffics start to bamp, also the response time from the server seems to be affected.

Screenshot 2023-01-09 at 02 35 43

There is an issue that prevents these images from being loaded, but if this is not implemented, I recommend moving these images to a static server that updates them on demand and using the must-revalidate directive and the etag header to reduce the load even more. This will eliminate the time that the server takes to generate the image.

Relate issues:

Network is Idel before connection with the catalyst network

There is a 5sec timeframe (on my computer) between the load of map.png and the connection with the catalyst network.

Screenshot 2023-01-09 at 02 48 07

Recommendation: check if this idle time can be reduced

Connection with catalyst network

The catalyst selection algorithm consumes time to resolve that many domains.

Screenshot 2023-01-09 at 02 56 05

Screenshot 2023-01-09 at 03 00 23

Recommendations:

option 1: Implement a lambda on the catalysts that checks the stats for all the network

If the catalysts expose a lambda that checks the /stats/parcel and the /about of the entire networks (like they already do for hot-scenes), the selection of a catalyst for a user can be resolved just with a single request to a randomly selected catalyst, and if this lambda had a TTL the load to the network cloud be also reduced in high traffic scenarios.

option 2: Use <link rel="preload"> for all catalysts in the network

The resolution time can also be pre-resolved by setting up a link tag on the HTML. See: Link types: preconnect

preconenct with api.thegraph.com

api.thegraph.com is taking more to be resolved than fetching data

Screenshot 2023-01-09 at 03 15 58

Screenshot 2023-01-09 at 03 20 26

Recommendation: Set up a link tag on the HTML. See: Link types: preconnect

Catalyst content:

The cache on the catalyst doesn't seem to be a problem.

Screenshot 2023-01-09 at 03 23 20

On the other side, for first loading, the time waiting for content could be 10-13sec, which could represent 90 - 99% of the total time (depending on the file)

Screenshot 2023-01-09 at 03 24 57

Screenshot 2023-01-09 at 03 25 15

On decentraland catalyst, the waiting time is not a problem, but it is taking too long to complete the request taking almost the same total time that other catalysts

Screenshot 2023-01-09 at 09 54 22

Screenshot 2023-01-09 at 09 54 43

Recommendation: check catalyst performance

Unoptimized scene content

Some content, mainly images, are not correctly optimized and can reduce a few Mb of the total size of the content

Screenshot 2023-01-09 at 10 10 41

before (1.7Mb) after (233Kb)
image image

Recomendation: Add an optimization pipeline on the cli before uploading content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants