Is My Website Script Causing High TTFB? Need Advice!

Pikerones

Regular Member
Joined
Jun 1, 2013
Messages
255
Reaction score
54
My website's TTFB (Time to First Byte) is 708 ms, with a Connect time of 175 ms and a Backend time of 533 ms.

I'm using Namecheap hosting, and their support claims that the 533 ms Backend time is caused by my website's script, not their hosting. They say their side's speed of 175 ms is acceptable.

Is it true that my website needs modifications? Also, I’ve noticed that the TTFB sometimes spikes to around 2000 ms without any changes made to the website. Any insights?



1741684068867.png
 
The TTFB probably is being caused by the server-side processing that is happening on each of your page load, before the server sends HTML. It could be:

1. Your database calls which are taking time to process.
2. Some kind of caching that is doing more harm than good.
3. Your server is weak, either it lacks processor cores, or the amount of RAM is not enough.

What I would do if I had this problem is trying to replicate the same website in a different server, preferably on a VPS, and watch how it goes. Then I would look into db caching, refactoring the backend and so on. In 99% cases, upgrading to a VPS would fix the problem by itself since the VPSes have more ram and dedicated CPU cores.
 
What I would do if I had this problem is trying to replicate the same website in a different server, preferably on a VPS, and watch how it goes. Then I would look into db caching, refactoring the backend and so on. In 99% cases, upgrading to a VPS would fix the problem by itself since the VPSes have more ram and dedicated CPU cores.
I wonder if GTMetrixes waterfall charts can see database-side processes do we know? Atleast it could show what's happening onsite, right?

Disregard my message until you read Gogol's message 7 times
 
I wonder if GTMetrixes waterfall charts can see database-side processes do we know? Atleast it could show what's happening onsite, right?

Disregard my message until you read Gogol's message 7 times
Umm no unfortunately (or fotunately) it cannot. It can just see that the server took some time to respond. What that time was for, only your backend knows.

If you are using a VPS, it is pretty simple.

Watch free RAM:
Code:
https://askubuntu.com/a/9655/1197717

For CPU usage, install something like htop.
Code:
https://askubuntu.com/a/1329822/1197717
For free disk space:
Code:
https://askubuntu.com/a/73162/1197717


and so on.
 
Hi,
It seems like that you are using shared hosting, and they are having so many clients on a single server, so whenever an account demands more of the resources, you see an impact on your website too, as you see these fluctuations without making any changes to your website or script, I would advise to resolve it either move to a VPS or a dedicated server, of you can ask them to shift your account on a shared hosting server that has more resources and less client accounts on it.
 
Back
Top