[wp-trac] [WordPress Trac] #57764: MYSQL operations excessive CPU consumption issue.
WordPress Trac
noreply at wordpress.org
Mon Feb 20 02:11:17 UTC 2023
#57764: MYSQL operations excessive CPU consumption issue.
-------------------------------+------------------------------
Reporter: Blogizma | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upload | Version: 6.1.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses: performance
-------------------------------+------------------------------
Changes (by dd32):
* keywords: => reporter-feedback
* type: feature request => defect (bug)
* component: General => Upload
Old description:
> Hello,
> There is very excessive CPU consumption in MYSQL process on our site.
> When we check this via Show MYSQL proccess
>
> {{{
> SELECT post_mime_type, COUNT( * ) AS num_posts FROM wp_posts WHERE
> post_type = 'attachment' AND post
> }}}
>
> we encounter this query.
>
> I am waiting for your help to solve the problem.
New description:
Hello,
There is very excessive CPU consumption in MYSQL process on our site. When
we check this via Show MYSQL proccess we encounter this query.
{{{
SELECT post_mime_type, COUNT( * ) AS num_posts FROM wp_posts WHERE
post_type = 'attachment' AND post
}}}
I am waiting for your help to solve the problem.
--
Comment:
Welcome to Trac @Blogizma,
Although you haven't posted the full SQL, the SQL you've posed is
generated by `wp_count_attachments()`, which did have some caching added
in 6.1 via #55227. The part of the SQL query which hasn't been included is
possibly the most relevant part, as it determines what about the query is
expensive.
You can view the full SQL query by using `SHOW FULL PROCESSLIST;` as a
query or using the process manager and ensuring it has the "full query"
option checked.
Some more details are needed to know what the problem is here though, does
the site have a lot of posts? or uploads? How many are we talking?
(10,000? 100,000?)
At first, it sounds like this might be caused by a plugin, and may be
better resolved through the [https://wordpress.org/support/forums/
WordPress support forums] unless a bug can be determined.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57764#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list