• I have a WordPress/Elementor site that is extremely slow. (20-30s for first-time page load if the server has been idle for > 20s or so) and 6-9s page load after that.

    We have installed caching etc.

    Our website has shared hosting and tons of plugins (for ecommerce, shopping carts, user registration and page permissions, etc).

    So I’ve been doing a lot of troubleshooting to see where the problem lies, as apparently one of our biggest issues is “server response time”

    So I made a copy of our website and ran it locally on my computer (Linux Mint 21) to take hosting and network out of the equation (and so I could play around with it without messing up our live site). I tried disabling plugins, changing themes, even blocking Javascript and images (because plugins create tons of excessive JS)

    Yesterday I installed a fresh copy of WP 6.0.2 with no content, clean install, and using the TwentyTwenty theme. I have PHP 8.1 & MySql 8.0.

    TTFB (load time) is still an issue! (obviously not as much as with a fully-loaded site, but still).

    Firefox shows a little turtle in the Network console and announces “slow server response time” for the document request. Load times are in excess of 1.4s with 1.2s being the server just apparently sitting there, with first-load-after-idle being particularly bad (2-3s).

    I have checked MySQL and the database queries are not the issue (I tested for any query lasting > 0.5s and none occurred).

    The fact that it occurs locally with a vanilla installation means that nothing on the optimize page will fix the issue, as far as I can tell.

    I swapped the TwentyTwenty theme for Astra and load times did improve somewhat, down to about 1s. This is much too high for a local installation with no network latency, no traffic, no content, no images, no plugins, etc.

    Issue does not occur with static HTML pages, either on our live hosted site or locally. I also tested a plain phpinfo() PHP page and it also loaded fast. The issue is with WordPress.

    So – how to fix?

Viewing 10 replies - 1 through 10 (of 10 total)
  • First of all, you should not use WordPress with PHP 8.1 as of today. It is not yet fully compatible with it; this will only be achieved with one of the next updates. One reason for slowdowns could therefore be the errors caused by PHP 8.1, which you might see with an active error login.

    Furthermore, I know from my own experience a considerable difference in the performance of locally hosted sites in relation to the resources of the computer. A virtual machine on a HD is usually slower than on an SSD. The fact that this is more noticeable with WordPress than with a simple PHP file is due to the fact that WordPress itself already uses considerably more PHP functions. These in turn require more resources, including hard disk accesses, which has a corresponding effect. I once had a work PC where, thanks to a slow HD hard drive, I had an extreme loading time with fresh WordPress installations. As soon as I moved it to an SSD, it was much faster.

    By the way, this can also make a difference in hosting. An SSD or Nvme provide much better performance. Have a look in this regard.

    Thread Starter station7

    (@station7)

    Thanks for the reply!

    Firstly, the WordPress installer (or site, if I recall correctly) did not say anything about my PHP 8.1 version and not to use it. In fact, everything I have read about performance issues always state to make sure you are using updated versions of all the things. Interesting to know that’s not always true.

    FWIW I installed our site locally when I was still using 7.x, so the version of PHP has not changed anything about the performance as far as I can tell.

    What is active error login?

    It’s interesting you mention HDD speed. Yes, this PC does in fact have a good old non-SSD HDD. Just now I tried loading the vanilla WordPress site and had 2096 ms response time. I noted HDD activity while the page was loading. Surely PHP (or WordPress’s use of it) isn’t that inefficient that it can’t run fast on a normal hard drive? ??

    I can’t upgrade my PC at this time to test if that’s the only culprit. Is there anything I can do to improve response time on a regular hard drive? First load time after idle is especially poor.

    And what about when adding plugins or something like Elementor? (At that point it becomes a real problem). We have already implemented caching, removed unused plugins (though we still have a lot) and reduced images but aren’t able to get much below 5s load time at best on our public site.

    The installer (currently) only checks for low PHP versions, not for future ones. The compatibility list can be viewed at any time here: https://make.www.ads-software.com/core/handbook/references/php-compatibility-and-wordpress-versions/

    Not “error login”, but “error log” – I made a mistake earlier. This is generated by your web server service and is usually found within the vhost. If you can’t find it, you can also activate debugging in WordPress as described here: https://www.ads-software.com/support/article/debugging-in-wordpress/

    PHP itself is not interested in hard disks. But WordPress as well as many other tools use individual functions of PHP or one of its modules that require read and write operations. For this, the hard disk is important.

    You should therefore not test this too much locally. The decisive factor is that the website is sluggish on the live system. You have to test there. To do this, I would recommend setting up a second vhost there in parallel with a 1:1 copy of the live system. Also make sure that the vhost settings are identical there. Then you can continue testing on the system in question without affecting the live system.

    I would advise against installing further plugins. I see no reason to install Elementor now – it would rather have the opposite effect. The fewer plug-ins that are actively in use, the better. In the test system described above, you can also install https://www.ads-software.com/plugins/query-monitor/ to see which plugin sends the most queries and which ones are slow. The fewer the better.

    Could it possibly also be related to the number of contents? Unfortunately you didn’t post a link so that one could get an impression. If there is a lot of content in the project, it could reach the limits of the database and/or other resources.

    Thread Starter station7

    (@station7)

    Thanks for the reply! I appreciate all your input.

    So here is the current situation, for clarity. We have one live website with our hosting provider. Our plan only allows for one website, so I can’t setup a second one for testing.

    But I am able to reproduce the slowness of the site locally.

    Our live website is already using Elementor (it was built with it before I came aboard) and has over 20 other plugins (for things like E-Commerce, online payment, caching, user authentication and permissions, form builder, among other things for engaging our customers).

    The point I was making is that even the base WordPress is slow – not to even mention all the other stuff we need and are using. (which yes, bogs it down even more).

    I was hoping to minimize the base slowness of WordPress, and by trying to make it more efficient and run better maybe it would improve all the other stuff we have to use. Because right now the speed of our live website is really unacceptable.

    As for content the entire site is probably 20 pages or less right now. There are a lot of images though, and about one zillion scripts thanks to all the plugins. The site’s uploads folder does have lots of uploaded images that aren’t being used – I wouldn’t think that affects it though? I will definitely check out query monitor. It may help with the plugin situation, though we can’t remove any more without losing functionality.

    I can’t fathom what people with larger sites do, but they must be doing something I’m missing to be able to have fast sites!

    Moderator t-p

    (@t-p)

    I swapped the TwentyTwenty theme for Astra and load times did improve somewhat, down to about 1s. This is much too high

    1s much too slow?
    1s Sounds pretty good?

    Anyhow, WordPress documentation has some general recommendations for you at https://www.ads-software.com/support/article/optimization/

    • This reply was modified 2 years, 2 months ago by t-p.
    Thread Starter station7

    (@station7)

    LOL, of course 1s very slow. It’s a blank website with nothing installed and running locally. Firefox even puts an icon of a turtle next to the request in the network console and announces “slow server response”

    For comparison, a simple PHP page with phpinfo() takes around 40 ms (or less). Meaning a WordPress page takes around 960ms longer before the server even responds.

    A fully loaded website should ideally load in under 2s for all visitors. If an empty website loads in 1s (of which most of that is just the server sitting there), what do you think will happen when we add network latency, database queries, images, heavy scripts, API calls, plugins, functionality?

    Thanks for the link. I did state in my original post “The fact that it occurs locally with a vanilla installation means that nothing on the optimize page will fix the issue, as far as I can tell.”

    However in looking again, possibly there are things to do to optimize MySql, PHP that could help. but I don’t know how to do this, particularly if I’ll have to do it on our live site (I don’t think we have access to most of it). Any suggestions or tutorials, anyone?

    Yes it’s slow.

    The v5 have 200ms ttfb but v6 is more than a second.

    and it’s fresh installed website.

    I confirm this – fully updated WP, super optimized on 7.4 works like a rocket, on 8.0(1) loads like 15-30 sek

    I installed the memcached object cache, And verifyed that DB query become zero after it’s cached.

    But well the db query time is not a thing. It already too fast!!!

    but TTFB is still 1s!!!!!

    I’m using newest WordPress 6.3.1 and it still slow.
    Well , the old fast days is gone, Not the WP is slow slow down!!!

    • This reply was modified 1 year, 2 months ago by kxmpgg.

    Nothing changed if the object cache is only caching the DB query.
    Saving 0.0x second against 1.2x second is not useful.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WordPress very slow (slow server response)’ is closed to new replies.