Hi, we are having trouble with the website performance operating on a large database.
Our structure is on AWS and we have separate services: for the WordPress a 2 core, 4GB RAM EC2 operating with Nginx and PHP7.4. And for the database, initially a 8 core, 32GB RAM RDS.
We have around ~310.000 posts and we use tagDiv builder on most pages for the loops.
Taking a closer look to how the builder works and call the posts, we manage to remove the “SELECT SQL_CALC_FOUND_ROWS” WordPress does on all queries by adding the “no_found_rows” parameter everywhere there is no needed for pagination.
Since that, we manage to reduce the database to a 4 core 16 GB RAM, but it is still bigger than we expected.
All is fine with the EC2, but the RDS is suffering.
Are there more optimizations we can do?
The website in question is: http://jornaldebeltrao.com.br/
Hello,
There are a few elements that consume CPU, from the theme. Normally that would not be a problem, but for a larger website with high traffic, and depending on the elements used from the composer, that will affect the performance. To name one such element, that is the ajax pagination, I see you are using quite a lot of it, for all the blocks I believe – https://i.imgur.com/JfcYH6C.jpg
Ajax pagination, like the next/prev, load more button etc and also the infinite loading, will consume CPU. They are supposed to consume CPU, or they would not work otherwise.
I would suggest trying to reduce the usage of ajax pagination, clear the cache, and that should have a positive impact on the performance.
I wanted to suggest to try cleaning the database – https://www.wpbeginner.com/plugins/how-to-clean-up-your-wordpress-database-for-improved-performance/ Or look for a plugin that does this regularly automatically, there should be some that can do this.
I can say that I have seen high traffic websites using database cleaning/optimization plugins, whether they are used in an automatic way or manual, with great results. But that doesn’t quite mean that this will have the same result across all the websites. Each website is different. Maybe try the plugin you mention for a while, to see if it helps.
Thank you!
Hi Calin, thank you for your answer.
We are using a plugin to regularly clean and optimize the database, was one of the first items we implemented.
I just didn’t understand about the ajax pagination. We are using it just in one place: one block on the archive pages so people can see older posts. Everywhere else there is no pagination (and we actually remove it from the query, like I said on the first topic, to have lesser calls to the database).
Is there anything else you guys can recommend us doing?
Hi,
Unfortunately large database are not quite easy to handle, because the request most of the time need to check all the data from the database.
Related to the blocks and settings from the theme, I see on the website that you achieve right settings (even on the live search element).
Maybe you can use a cache on database, this can help a little.
Thank you!
