Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kusanagi's avatar

Website is slowed by 40000ms every time

Hello, I have a problem : I have a website that is laravel based and out of the blue the website became extremely slow. I noticed that no matter which sub-url I open, it is always delayed by 40000ms. Does anyone have an idea what the problem could be ?

0 likes
32 replies
jlrdw's avatar

See if host had a ddos attack.

1 like
jlrdw's avatar

Contact the tech support, they would know. But besides that, it was running fine and suddenly got slow without any changes you made.

1 like
Kusanagi's avatar

@jlrdw I contacted them and they said that there was no ddos attack

jlrdw's avatar

Check your logs and things like that, are you being hit by a bunch of spam. If your site was working normally and without any changes slowed down you really need to investigate all of the logs.

1 like
Tray2's avatar

Other than the mentioned possibility of a ddos attack it might be that your site recently reached a threshold in your database and now your queries runs slow because the received bad execution plans.

I suggest you check your queries and make sure that your indexes are correct. If you are storing large chunks of data in clobs or blobs it might be a good idea to reorg those tables.

1 like
Kusanagi's avatar

@tray2 I checked my queries, it takes around 2.53ms so I doubt that that is the problem.

Kusanagi's avatar

What I find strange is that every request seems to take exactly 40000ms more than it should.

Tray2's avatar

Have you added any throttling?

Have you asked the provider to check the steal on the server? sar

1 like
Kusanagi's avatar

the only thing that loads normally is /telescope. I tried to make a path that only echos "test" but even that takes 40057ms

Kusanagi's avatar

@tray2 no I haven't, I asked my provider but they can't find anything on their side

automica's avatar

if you put a basic html file in your public directory eg test.html does that also take ages to respond?

have you also checked network tab on chrome as that may uncover any issues.

1 like
automica's avatar

ok. so how are you accessing your db server? are you connecting to it as

  • localhost
  • 127.0.0.1 or
  • some IP?
1 like
automica's avatar

you might want to check with your ISP if that is correct, as you might find you need to swap it for localhost.

1 like
Kusanagi's avatar

do you mean that in my .env I should change "DB_HOST=127.0.0.1" to "DB_HOST=localhost" ?

jlrdw's avatar

By host I meant hosting company, is it digital ocean, aws, etc.

automica's avatar

Actually, as you say this behaviour is 'out of the blue' - can you see any reason in developer tools? if you look on network, it could be that you are trying to load an external asset (eg font or js file) which is no longer available and its trying for 40s before timing out.

Are you able to share a link to your site so we can inspect?

I would hang off any DB changes now as you said its not always been this slow.

automica's avatar

seems you have a redirect which is taking its time (40s)

can you disable https and see if that speeds up the response?

Kusanagi's avatar

if you go to the url : readmanga.tw/blob, it just echoes "test", yet it still takes 40 seconds

automica's avatar

you have a redirect which switches from http to https and thats the first cause of slowness.

Your http://readmanga.tw will eventually redirect to https://readmanga.tw

You'll see this in your Chrome Network tab as 2nd request.

I notice you are also using Cloudflare, so it might be worth disabling that temporarily.

Kusanagi's avatar

do you have discord/skype or something like that so I can share my screen and show you everything in detail ?

automica's avatar

I’m not really in a position to do screen sharing as I’m working off my phone at the moment.

My best guess if your issue has only just started happening, would be a fault with cloudflare. If you can doable that service that would help check if that is the issue, especially if cloudflare is managing secure redirec.

Kusanagi's avatar

Nothing seemed to have worked, so I re uploaded an older version and now the website is blank.

automica's avatar

Check your logs to see if you are missing any files.

Did you manage to doable the redirect to https?

Kusanagi's avatar

how can the logs indicate if I am missing any files ? No, I am still trying to make my page show something. It is still blank

Please or to participate in this conversation.