Getting server errors 508 while loading assets (Phaser 3)

Website URL

https://amiga.freecluster.eu/Redemption/RDE/index.html

Error Message

|GET||
|scheme|https|
|host|amiga.freecluster.eu|
|filename|/Redemption/RDE/assets/sounds/Menu%20Selection%20Click.wav|

|Adresse|185.27.134.153:443|

Status

508

Loop Detected

VersionHTTP/2

Übertragen738 B (426 B Größe)

Referrer Policystrict-origin-when-cross-origin

Other Information

Hello,
this happens quite often to several of my assets. Whenever I do a reload everything is working fine.
I already searched the forum and found a similar topic, but it was not resolved and no solution or similar was given. The assets are getting loaded by Phaser 3 framework in its loader plugin and all in all I currently have 43 assets that are being loaded during launch of my app, so shouldn’t be too much for a server IMO. How can I resolve this issue to get my app loading reliable everytime? Are there any restrictions or similar that lead to such a behaviour on server side?

Thank you in advance for your help and

Kind Regards

A 508 error means that a limit on your account was exceeded. This could be caused by the CPU or RAM limit, but most commonly it’s caused by your account having too many concurrent processes at the same time. And the concurrent processes is causing by having too many simultaneous downloads to your account.

This can happen if your site is busy or if there are too many requests. We often see this with some image galleries that load hundreds of images at the same time.

But I wasn’t able to reproduce the issue myself.

8 Likes

Yeah the very first initial load always seem to work. But subsequent once, especially then browser/window/tab got closed inbetween tend to fail.

Too many requests I hardly can imagine since during the preload function there are only 43 assets trying to be loaded. Even with all the .js and other files it should not be much above 100.
What are the current limitations in server side and is there any chance how I can determine whether it is ressource related and if so - which ressource?

That’s pretty intensive for a website on free hosting.

image

Your account will likely be suspended due to hit limits with around 500 page views

4 Likes

Are you referring to the number of 200 or the overall amount of requests and transferred data? (Since it is not a plain webpage but a web application purely in JS it has some more ressources.)
Where and how can I scan/trace these kind of information? Also are there any limitation descriptions/conditions for free accounts listed somewhere like hit limits etc. (could not yet find it, at least not within the description of the free hosting mentioned here?

Please read here

4 Likes

Thank you. Checked those entries. The only fix respectivly specific limit I could find was the max. of 50.000 hits/day which I certainly never reach (here it shows 98). So I am still not really aware of what might cause the issue between my app and the server. Biggest file for BG music is ~4MB hence the 5MB so should also be no issue IMO.
The 20 MB resources I cannot relate to anything. Is this heap usage on server or storage capacity on server? Also does not look like much to me.
Are there any stats, lists, etc. I can check at the hosting area to control my app’s access and ressource consumption? Or is there anything I can do to check an resolve this isssue?
Due to that problem usability of my app is really not very good.

Any hints what I can do here or need to change?

There is the Account Statistics section in the control panel that shows some graphs to tell how you are doing in terms of resource limits. But those graphs only show aggregates of usage per day, not really detailed information to debug specific issues. Premium hosting has more detailed information.

The graphs in general seem to be quite low, all I see is the Daily Entry Process Failure Graph having some bumps. Entry Processes are basically concurrent requests, so I really think the number of concurrent requests is what’s causing the 508 errors.

I do have a general idea on how the limits work but the exact thresholds are a closely guarded secret, which is also why the graphs are quite vague. So I cannot tell you the exact number of concurrent requests that are allowed.

6 Likes

Thank you. Then it seems there is not much I can do about since the requests are coordinated by the browser. I just tried to load the page again and it failed again. Seems the Account Statistics are not immediatelly updated since there is no bump shown in the Entry Process chart for today. So it is a secret what the limit of concurrent requests is?

The really strange thing is that always the same files create these errors, independent from the browser used… Weird.

If nothing else will help maybe I need to look for another hoster which is really unfortunate since I was quite glad when I found out about infinityfree.

It loaded fine for me, albeit taking almost 6 minutes

82 requests
7.1 MB transferred
16.9 MB resources
Finish: 5.9 min
DOMContentLoaded: 1.5 min
Load: 1.5 min

The only thing that failed is the audio file, but that is expected per browser settings


I would really recommend looking into paid hosting for this. Majority of free hosting providers use the same backend as InfinityFree (Meaning you would have the same issue), and those that have a different backend are probably not much better in terms of limits.

After all, free hosting is intended for website hosting, not game hosting, so the limits and such are quite restrictive when you are doing what you are trying to do.

6 Likes

Thank you! 6 min is really strange. If page loads fine it loads within a few seconds here on my laptop including the big sound file. As of now it is not (yet) a game but just a deck editor. Also thank you for testing and the background information regarding free hosting backends.

That’s because the files are already cached on your device. The first time it is loaded, the browser has to download all the assets, but then it saves them for later just in case you visit the site again.

4 Likes

No, here this is also with empty cache or when I use another browser where I never loaded the page before. Maybe depending on internet speed and bandwith.

Yes, the graph is not a live counter, it’s updated once per day with the data from the day before.

Correct.

5 Likes

That’s too bad.So there seems to be no chance for me to find out what the reason is behind my page/app regularly not loading.

If anybody has still some idea would be great!

When I had such problems (it’s been more than 1 year)
back then, like you, I had a dozen audio files for the game plus other resources

The main problem is that those files were loaded by javascript XHR (game loader - or some 3D engine)
and not ordinary HTML code
and then when they download so many files in a short period of time, the server revolts and throws out a 508

So… I simply had to sit down (15+ hours of work) and make an audio sprite from all those audio files
so that the script loads one audio file and not 10+ (aim for fewer REQs)
and then give instructions to the script to find a specific sound in that audio file when the game needs it
means at 0-3 sec = gun sound
from 3 sec to 5 sec play explosion etc.
of course, the times are in milliseconds…also 10 times of listening until I guessed the timing correctly
but after that, getting it all to work ? :roll_eyes: - that was the hardest part, and that’s where I lost the most time because I had to change hundreds of lines of code in various places and files
because the game was simply written to call/load a certain mp3 on a certain event and that audio player from the game then executed it, but it was just made for that and not to load an audio sprite and to load instructions from X file to find which separate sound is in that file… additional problems occurred when a sound needs to be played in a loop, etc… read the manual … commands, this and that…

To begin with, try to put all the resources you can into the sprite… images first (images sprite)
and the one in the symbols folder.

Later you can deal with the audio sprite


The goal would be that, if possible, the audio should also be short and of a small file size.
Or change the 3D engine that supports sprites and then start using such code.

It would also help if you had your own domain so then you can use Cloudflare
because then Cloudflare would take over some (or all) of the traffic.

Because your app has “a loader” that, if it doesn’t load all the files into the cache, doesn’t start what it should
and if the server does not give/serve it all the necessary files (one is enough for it to fail)
your loader throws an error in the console and stops because it encountered an exception - and you see it as not working.

10 Likes

An 508 error is this

Admin had told you about the limit.

Follow Oxy’s advice or upgrade to premium.

5 Likes

@Reth01

you have another option:

if that rendering engine and its loader support lazy load, then you can turn it on in “the config section”

or if you know javascript, write some “sleep” ( setTimeout) function and find the best place in the script where you will intercept the loading
and then say that, for example, after each requested file, wait 500ms or 1 sec

or after every 5 wait X time (harder to implement because you would have to count how many were loaded/requested)

of course, this will significantly increase the loading time of your app
but on the other hand, at least it shouldn’t be 508

8 Likes

Thank you @Oxy ! Will have a look into it. These are some good approaches.

@Frank419 Yes, admin told that limits are a secret so no chance to verify against them.

3 Likes

@Reth01

I noticed something else, which is that none of your JS is minified
especially phaser.js = 6.33MB which is huge

find here your version or the latest one that works correctly with your code

and then when you use a CDN
visitors will not load that “huge” file from the hosting but from the CDN (some other server) and thus will reduce the traffic on the hosting server

And definitely minify the other JS…


Besides, there is no need to call many JS files separately

instead, put everything in one JS file
and you have already reduced the number of REQs with it

just make sure you follow the order of the scripts you add so that it is the same as in your HTML
because sometimes the order is important.


It’s not just because of the 508
instead, when you optimize the code and reduce the number of requests you speed up your website and reduce unnecessary traffic for your visitors.
Because at that time (minus 10+ javascripts = minus 8MB) user can download 30+ cards (imgs)

8 Likes