Hey @ahmadabdolsaheb The 241ms timing showed in the logs is definitely not the best performance, but should not be causing huge degradation in TTFB all of the sudden. One reason why it might be problematic is when a similar query is executed repeatedly during a single page load (for example in a loop).
Don’t see anything out of ordinary with the query itself. Think we’d need a little more debugging to narrow down the root of the issue. What were the timings in the Nginx logs for the long TTFB requests? Did you notice any spikes in the hosting server’s CPU, memory or disk i/o? Can you pinpoint the slowdown to any specific change on your side, e.g.: Ghost version update, configuration change in Nginx?
Thank you for your response @naz. Although we checked all of the above scenarios and could not find any irregularity, we were able to resolve this issue by changing our architecture. I will update this post with more details once our postmortem is finalized.
any findings you can share? Interested to know what your arch changes were.
I am seeing similar on a ghost blog running in the official docker image with sqlite in K8s behind Nginx Ingress.
Here’s one I captured from a Statuscake check on the site. seems to all be on http traffic, no https…maybe the redirect I set up, or because i started the blog http and switched to https…
I am a total n00b with ghost and nginx tuning, so could totally be settings and such, so any hints on where to go bang my head, i’ll take!
Have you considered going the HeadlessCMS route? At the end, you get a fully optimized static website while keeping the editor experience of writing in Ghost.
We can say it’s possible to have your cake and eat it too.
TIL that the logs inside the docker image provide more verbosity vs the stdout/stderr I posted above. will google more. Still wondering if the arch change above was a move from sqllite to mysql, or something different…
The TTFB issue was associated with some config on our hosting service.
I am still experiencing the slow get helper issue, but I believe as @pascalandy mentioned going HeadlessCMS would help with optimizing your get requests in general.
Thanks for the update. As best as I’ve been able to determine, reducing the number of get helpers on a single template has been the most effective way to resolve the slow get helper warnings.
Use a Content Delivery Network.
Optimize the application code.
Optimize the database queries.
Reduce HTTP requests.
Ensure a faster server response time.
Use Respond First, Process Later (RFPL) cache...
You almost answered yourself, Ghost position himself as a headless CMS, so as a backend. Everything related to the frontend would be relay to something like Gatsby.
To reduce the TTFB, at least with Ghost, it is mostly related to where you host it
Does the provider have a fast and reactive internet, does the server have a fast and reactive hardware (CPU, MEM, HD)…
After that, the nodejs code have to exploit async function and the theme also.