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

FxMaster overloading chrome with requests #209

Closed
KevinTheKittyCat opened this issue Feb 20, 2022 · 4 comments · Fixed by #210
Closed

FxMaster overloading chrome with requests #209

KevinTheKittyCat opened this issue Feb 20, 2022 · 4 comments · Fixed by #210
Labels
bug Something isn't working confirmed

Comments

@KevinTheKittyCat
Copy link

Expected Behavior

When using the animations, they should play "instantaneously", and should show up for both the GM and Player as such.

Current Behavior

When using JB2A, the animations should play "instantaneously", but at the moment they take too long to load before any animation is played, see https://gyazo.com/1942fa004dd99b21eb0566c57a452c47 .

We believe it is due to the number of effects it is trying to load in beforehand. We are using jb2a to test, as it has a lot of effects.
What we encountered is flooded requests, and chrome will freeze up the domain, see:
image
even from the cache, it will take around 3-5 seconds before they load properly.

While this is happening, you are not allowed to reload the site and have issues till it is all closed down properly.
We would suggest lazy loading the animations.

Steps to Reproduce

  1. Have a lot of effects / Use JB2A's premium module
  2. Open the effects manager
  3. Try to play non-cached effects.

Context

No response

Version

v2.2.4

Foundry VTT Version

v9.249

Operating System

Windows

Browser / App

Chrome

Game System

dnd5e (1.5.7)

Relevant Modules

JB2A - Patreon Complete Collection (0.3.6)

@KevinTheKittyCat KevinTheKittyCat added bug Something isn't working to be confirmed labels Feb 20, 2022
@ghost91-
Copy link
Contributor

I agree that the situation is less than ideal. Most likely, it’s due to the effects all being loaded to be displayed in the effect manager.

I will take a look if there is an easy way to improve this. That said, I won’t invest too much time as I consider the special effects related part of FXMaster to be legacy. The sequencer module fills that niche quite a bit better by now. I am even considering removing that functionality from FXMaster altogether in the future. No concrete plans yet, as it’s still used by quite a few people, but it will probably happen at some point.

so unless I find an easy solution for this, my suggestion would be to just try if you can also achieve what you want with sequencer instead of FXMaster. The experience there might be quite a bit better.

@ghost91-
Copy link
Contributor

The situation might also be improved if you can use HTTP/2 for serving the assets, instead of HTTP/1.1, as HTTP/2 allows for a lot more requests in parallel.

ghost91- added a commit that referenced this issue Feb 20, 2022
With this change, speacial effect files are only loaded when the preview box is hovered or when the
effect is actually played. Nothing is loaded automatically, not even the metadata. This should help
to improve the experience when using lot's of special effects such as when using the effects from
JB2A.

Closes #209
ghost91- added a commit that referenced this issue Feb 20, 2022
With this change, special effect files are only loaded when the preview box is hovered or when the
effect is actually played. Nothing is loaded automatically, not even the metadata. This should help
to improve the experience when using lot's of special effects such as when using the effects from
JB2A.

Closes #209
ghost91- added a commit that referenced this issue Feb 20, 2022
With this change, special effect files are only loaded when the preview box is hovered or when the
effect is actually played. Nothing is loaded automatically, not even the metadata. This should help
to improve the experience when using lot's of special effects such as when using the effects from
JB2A.

Closes #209
@kakaroto
Copy link

kakaroto commented Feb 21, 2022

The situation might also be improved if you can use HTTP/2 for serving the assets, instead of HTTP/1.1, as HTTP/2 allows for a lot more requests in parallel.

Even with http2, the issue is still there, we've encountered this on the Forge, trying to debug why a user was having minute long requests to assets, but the issue is that http2 can only do 100 concurrent requests at a time, and when it's overloaded like this with 500+ requests, it seems to freeze up chrome because it has trouble handling the queue. It will start to download at an incredibly slow speed everything, with everything else being stuck on 'pending' state, and as Kevin said, even loading from disk cache would take 2 to 3 seconds per request (it's generally 2ms when there isn't 500+ queued requests). Eventually, it can cause the request handler in chrome to lock up for the entire domain (happened to me a couple of times while debugging this).

A lazy load would be great, but if this is legacy, then I'd recommend a simple fix like this instead :

// Don't load the preview of effects if there are too many as it can cause issues with the browser queuing too many requests at once
if (effects.length > 100) return; 

EDIT: Oh, I see you added the lazy load yesterday! Cool, thanks :)

@ghost91-
Copy link
Contributor

Yeah, I hope this improves things. I will push a release out pretty soon. I'm just finishing up improving the readme first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants