Make WordPress Core

Opened 16 months ago

Last modified 16 months ago

#57764 new defect (bug)

MYSQL operations excessive CPU consumption issue.

Reported by: blogizma's profile Blogizma Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.1.1
Component: Upload Keywords: reporter-feedback
Focuses: performance Cc:

Description (last modified by dd32)

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.

Change History (1)

#1 @dd32
16 months ago

  • Component changed from General to Upload
  • Description modified (diff)
  • Keywords reporter-feedback added
  • Type changed from feature request to defect (bug)

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 WordPress support forums unless a bug can be determined.

Note: See TracTickets for help on using tickets.