Why is my server response time way too high?

[ad_1]

This is my first full WordPress website, I’m a junior full-stack developer, and I -kinda- have an idea of what web development is, but I’m a newbie with WP specifically.

The website consists of a shop page and some introductory pages. PageSpeed is giving me a score of 92 Mobile – 94 Desktop, but these numbers make no sense to me as the website seems unreasonably slow.

**Link**: [http://almoroj.com/])

**Hosting:** Hostinger VPS – 3 Core CPU – 3 GB RAM – SSD Storage. The server is located in Lithuania and My service is expected to mainly serve in Egypt/Middle East (This is the closest server to me).

**Current Traffic**: non, only me with occasional few visits from the client to check it out. I can also confirm that from Google Analytics and my Hostinger panel.

**Software**: Debian 11 – MySQL DB – Apache2 Web Server – Memcached enabled – PHP 8 (upgraded from 7.2 which has the same issues) – Webmin with VirtualMin for server management.

# Issue

Initial Server response time takes **2-4 seconds** which is crazy considering it has no load. Once the server starts to respond, the pages load in a matter of a few milliseconds. This issue is present in almost all the pages regardless of how much content the page holds. I have tried multiple browsers and multiple devices but the response is the same.

**Steps Taken to Mitigate the Issue:**

I have cache enabled (browser, memory, and database caching besides Apache’s static content caching), images are not that crazy in size and are in the range of 200-600 KB, served in WEBP and Lazy Loading enabled.

I have enabled Minification for HTML but disabled it for CSS and JS as it breaks some pages. I have also Enabled CDN ([QUIC.CLOUD](https://QUIC.CLOUD)). I’m also using LiteSpeed Cache with the default preset enabled.

**Side Note:** I have a Laravel project on the same server on a subdomain and the server response time there is much more reasonable (300-500 ms) considering it is a data-intensive project and WP is nothing in size compared to it – it also has no traffic yet.

**Plugins and Themes**

This is where I suspect the issue might be. I’m trying to cut costs so I used 100% free resources. Please let me know if they are the issue and I don’t mind paying for them if it means faster response.

Theme: Astra (with Spectra Blocks)

Plugins: WooCommerce – Contact Form 7 – MailPoet – Spectra – The SEO Framework – TranslatePress – Duplicator – UpdraftPlus – Wordfence – WP Mail SMTP

​

Appreciate any insights. Thank You!

[ad_2]
2 Comments
  1. 600kb is crazy huge actually. I have a general rule of never going over 250kb.

    What testing tools have you used? What is your TTFB?

    Have you checked the servers resources? Maybe the cpu is getting hammered or memory is low.

  2. High TTFB is generally caused by PHP or SQL. Images and other assets will impact performance scores but shouldn’t impact TTFB.

    To audit PHP, the best thing to do is to profile your page loads via Xdebug or a similar tool. This will give you a break down of every PHP function called and see exactly how long it took. This will allow you to figure out what exactly is taking so long.

    Profiling SQL calls is even easier. The WordPress plugin Query Monitor will show you every database call and tell you how long it took. You can then look for anything taking exceptionally long and fix that specific issue.

    Without knowing the exact issue, it’s hard to provide meaningful advice. As for general advice, make sure PHP opcache is installed, enabled, and tuned. Last time I installed Virtualmin, opcache was still disabled by default. A proper opcache setup will dramatically reduce PHP compile time. Similarly, a persistent object cache like Redis can have substantial impact.

    Edit: its worth noting that PHP is generally single threaded so a multicore processor will help with concurrent requests but doesn’t generally help TTFB. So when you see a cpu load of 25% on a quad core cpu (just an example), that’s a single core being maxed and would indicate a bottleneck. Going for a compute-optimized VPS will boost single threaded performance and reduce TTFB.

    Edit2: just reread the OP and it’s a 3 core. So 33% load is a single maxed core. Percentages like that can be misleading. More detailed monitoring like htop via cli can show exactly how that load is distributed in real-time. If a single request pegs a single core to 100%, it’s a single threaded bottle neck which would need profiling as mentioned above.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer