• Hello
    I recently installed the Query Monitor plugin because it was recommended to me due to the server’s high CPU usage. I have found a lot of duplicate queries, and I don’t understand why this is happening. Here is an image of a post report:

    Why does WP_Post::get_instance have so many instances?

    I have already optimized my database with WP-Optimize, I have CDN, Cache, light template (Generatepress), webp images, etc. What can I do to solve this problem?

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • In the Troublemakers column you can see the functions used to make the calls. generate_navigation_position is not a WordPress function, I assume it comes from your theme. The 2nd entry is WordPress, but indicates the use of classic widgets. Overall, your theme doesn’t necessarily seem to be using modern methods.

    One piece of advice would be to change the theme as a test, e.g. to a standard theme like TwentyTwentyFour.

    Incidentally, you could prevent such duplicate calls with a server-side APCu cache. There is also a plugin for this: https://www.ads-software.com/plugins/apcu-manager/ – but: this only works if your hosting has also activated the APCu component in PHP. If not, you could contact your hoster’s support team.

    Regarding your actual problem: I doubt that the point you have highlighted is responsible for a high server load. These are basically 25 tiny little statements that should be completed in milliseconds. I would rather guess that a high load is caused by other things, possibly a combination of different things.

    Thread Starter juanwp22

    (@juanwp22)

    Hello,
    I will investigate more about my theme, I use Generatepress Premium. On the other hand I think I can’t use APCu cache because I am with Ezoic and they control the cache. My hosting is Digitalocean on Cloudways which may have that feature but I can’t use their varnish cache either because Ezoic forces you to use their cache system.

    It is true that you should not use 2 cache plugins at the same time. However, there are also different cache methods. I haven’t seen what APCu does with any other plugin, which is why I have used it in combination with other cache plugins. However, I don’t know Ezoic – you may want to contact their support to clarify this question.

    One way to investigate your actual concern would probably be to do without all plugins. Deactivate them as a test and see how the load on the hosting changes (if you are able to see this live).

    Thread Starter juanwp22

    (@juanwp22)

    Thank you for the reply, I will run some tests.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.