High CPU usage

#803676
  • Resolved Anonymous
    Rank Math free

    These queries are very CPU intensive.

    SELECT post_type, MAX( GREATEST( p.post_modified_gmt, p.post_date_gmt ) ) AS date
    FROM wp_posts as p
    LEFT JOIN wp_postmeta AS pm ON ( p.ID = pm.post_id AND pm.meta_key = 'rank_math_robots')
    WHERE (
    ( pm.meta_key = 'rank_math_robots' AND pm.meta_value NOT LIKE '%noindex%' ) OR
    pm.post_id IS NULL
    )
    AND p.post_status IN ( 'publish','inherit' )
    AND p.post_type IN ('post','page','attachment','guest-author','anew','article','yellow','archive')
    GROUP BY p.post_type
    ORDER BY p.post_modified_gmt DESC"

    SELECT l.ID, post_title, post_name, post_parent, post_date, post_type, l.post_modified
    FROM (
    SELECT DISTINCT p.ID, p.post_modified FROM wp_posts as p
    LEFT JOIN wp_postmeta AS pm ON ( p.ID = pm.post_id AND pm.meta_key = 'rank_math_robots' )
    WHERE (
    ( pm.meta_key = 'rank_math_robots' AND pm.meta_value NOT LIKE '%noindex%' ) OR
    pm.post_id IS NULL
    )
    AND p.post_type IN AND p.post_type IN ('post','page','attachment','guest-author','anew','article','yellow','archive') AND p.post_status IN ( "publish" )
    ORDER BY p.post_modified DESC
    )

    Wordpress 6.5.2
    Rank Math SEO with AI Best SEO Tools 1.0.218
    mariadb Ver 15.1 Distrib 10.6.17-MariaDB, for Linux (x86_64) using readline 5.1

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I apologize for the high CPU usage you are experiencing due to these intensive queries. To address this issue, we recommend optimizing the queries to make them more efficient and reduce the strain on your server resources.

    Here are a few suggestions to optimize the queries:

    1. Indexing: Ensure that the columns involved in the WHERE clause are properly indexed to speed up the query execution.

    2. Query Optimization: Review the query structure and consider optimizing it for better performance. You can consult with a database administrator or developer to fine-tune the queries.

    3. Caching: Implement query caching mechanisms to store the results of frequent queries and reduce the need for repeated executions.

    4. Server Resources: Consider upgrading your server resources if the high CPU usage persists after optimizing the queries.

    If you need further assistance with optimizing these queries or any other support, please feel free to provide more details or reply to this ticket. Our team is here to help you.

    Thank you for bringing this concern to our attention.

    Best regards.

    Sources:
    SEO Reports Delivered Straight to You (And Your Clients) via Email With Rank Math » Rank Math
    The #1 WordPress SEO Plugin in 2024 – Rank Math
    Making the Most of the Analytics in Rank Math
    Resolving Rank Math Schema Markup Related Issues
    Analyzing Your Site’s SEO with Rank Math’s SEO Analysis Tool

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Please check the PHP values of your site by heading over to your WordPress dashboard > Tools > Site Health > Info tab > Server. If they are set too low on your site, please ask your hosting provider to upgrade the values according to the following and see if that works for you:

    PHP Memory Limit: 1024M
    Max input time: 150
    PHP time limit: 120
    PHP max input variables: 1000
    

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘High CPU usage’ is closed to new replies.