Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
VGSOURCES
Get listed

CPU troubleshootingPATCH 2026.10.15

How to Fix High mysqld CPU Usage on a Linux Server

By VGSources Team 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

High mysqld CPU is a symptom, not a diagnosis. The safest fix is to identify the statement or workload consuming the processor, capture its evidence, and then make one reversible query, index, or application change. Do not begin by changing global buffers or restarting the server.

Start with the live process list, use the slow query log to find recurring work, inspect the exact statement with EXPLAIN, and use Performance Schema when the expensive activity is intermittent. Validate CPU, latency, execution rate, rows examined, lock waits, and the execution plan after each change.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What high mysqld CPU usually means

The mysqld process can consume a core or several cores while it scans rows, joins tables, sorts results, evaluates expressions, processes a large report, repeatedly executes a moderately expensive query, or spends CPU on an unexpected application workload. The percentage shown by Linux depends on the number of logical CPUs and the monitoring tool, so there is no universal “bad” percentage or duration. Hardware, MySQL version, schema, indexes, and traffic pattern determine what is abnormal for your server.

CPU usage alone does not identify the cause. A full table scan may be correct when a table is small or a query returns most of its rows. Conversely, a query that takes only a fraction of a second can create a sustained incident if an application executes it thousands of times per second. Treat the CPU graph as an alarm that starts an attribution process.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

First response: capture the incident without restarting MySQL

Collect evidence while the problem is occurring. A restart destroys the active statement, connection context, and useful timing information, and it does not correct the query or workload that caused the spike.

1. Confirm which process and threads are busy

At the Linux layer, record the start time, whether the load is sustained or periodic, and which mysqld process or threads are using CPU. Capture a short sample rather than relying on one instantaneous reading. If your operating-system tooling can display per-thread CPU, note the thread IDs and correlate them with MySQL connections when possible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Also record concurrent symptoms: application latency, database connection counts, disk activity, memory pressure, lock waits, and whether a deployment, report, backup, schema change, or traffic event began at the same time. These details distinguish a single runaway statement from a broad workload increase.

2. Capture the MySQL process list

Run the full process list from an administrative session:

SHOW FULL PROCESSLIST;

FULL is important because it shows the complete statement text rather than a truncated version. The list exposes each server thread’s connection ID, user, host, database, command, elapsed time, state, and current statement. Seeing other users’ threads requires the MySQL PROCESS privilege.

MySQL’s own debugging guidance recommends the equivalent administrative command when a server “starts to eat up CPU or memory” or appears to hang:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
mysqladmin processlist status

For a queryable view, use the Performance Schema process-list table when it is available and populated:

SELECT *
FROM performance_schema.processlist
ORDER BY TIME DESC;

Save the output with a timestamp and repeat it after a short interval. A statement that remains active, accumulates elapsed time, or appears in many connections is a stronger lead than an old connection that is idle.

3. Interpret states before taking action

Look for statements in active execution states, repeated scans, long-running joins or sorts, and clients that are issuing the same work over and over. A thread in Sleep is idle; its age alone is not evidence that it is consuming CPU. A thread waiting for a lock may have a long elapsed time but little CPU, while the transaction holding the lock may be doing the expensive work.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Do not kill sessions merely because they are old or have a large elapsed time. First identify the statement, its owner, whether it is part of a report or maintenance task, and whether it is blocking more important work. If one connection is clearly harmful—such as an accidental unbounded report—record its connection ID, notify the owner when practical, and terminate only that session:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
KILL <connection_id>;

Keep the captured process-list row and the reason for termination for post-incident review. Killing a query is an emergency containment step, not a performance fix.

Find recurring expensive statements with the slow query log

The process list shows what is running now. The slow query log shows statements that repeatedly cross a chosen execution-time threshold, including work that finished before you inspected the server. Set a threshold appropriate to your normal workload; a value useful for an interactive application may be too noisy for a data warehouse.

Enable targeted logging

Check the current settings first:

SHOW VARIABLES LIKE 'slow_query%';
SHOW VARIABLES LIKE 'long_query_time';
SHOW VARIABLES LIKE 'log_queries_not_using_indexes';

On servers where dynamic changes are permitted, enable the log and choose a measured threshold:

SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;

The value 1 is an example of one second, not a universal recommendation. Choose a threshold that captures problematic work without filling the disk. Configuration methods and persistence differ by MySQL edition and deployment, so verify the active configuration after a restart or configuration-management run.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

MySQL also provides log_queries_not_using_indexes. When enabled, it includes statements that do not use indexes for row lookups:

SET GLOBAL log_queries_not_using_indexes = 'ON';

Use this option temporarily or with a retention plan. It can produce a large volume of entries on workloads where scans are legitimate. “No index” is a lead for investigation, not proof of a defect.

Summarize the log with mysqldumpslow

Raw slow-log files contain many individual executions. mysqldumpslow groups similar statements so you can rank recurring patterns:

mysqldumpslow -s t -t 20 /path/to/slow-query.log

The -s t sort focuses on query time and -t 20 limits the output to the top 20 groups. Other useful views include total time, average time, lock time, and rows examined; select the sort that matches the symptom. Compare each candidate’s execution time, rows examined, call frequency, and business necessity. A frequently called query with modest latency can consume more CPU in aggregate than a single dramatic report.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Use EXPLAIN to connect a statement to its access path

Take the exact normalized statement from the process list or slow log, substitute representative parameter values, and inspect its plan:

EXPLAIN SELECT ...;

Read the plan as a sequence of access decisions rather than as a single “good” or “bad” label.

  • Access type: Identify whether the table is reached through a selective index lookup, a range, an index scan, or a full table scan.
  • Possible and chosen keys: Check which indexes the optimizer considered and which one it selected. An index being listed as possible does not mean it was used.
  • Estimated rows: Compare the estimated row count with the number of rows the query logically needs. Large estimates can explain CPU-heavy joins and filters.
  • Join order: Confirm that selective tables are not being joined after a much larger intermediate result has been created.
  • Filtering: Look for predicates that eliminate most rows only after they have already been read.
  • Temporary tables and filesorts: These can add CPU and memory work for grouping, ordering, or joining.

If the server supports an execution-analysis form of EXPLAIN, use it only when its runtime behavior and overhead are acceptable for your version and environment. Otherwise, compare the estimated plan with slow-log timings and row counts.

Common query and schema fixes

Build a composite index around the predicate

For a query with selective equality predicates followed by a range or ordering condition, a composite index often works best when its column order matches that access pattern. For example, a workload filtering by tenant_id and status, then limiting by a time range, may benefit from an index beginning with those equality columns and continuing with the time column. Confirm the design with the actual query and data distribution rather than copying a generic index recipe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before adding an index, check existing definitions and duplicate prefixes:

SHOW INDEX FROM your_table;

An index consumes storage, increases write and update work, and can make optimizer choices more complex. Test that it improves the target statement and does not impose unacceptable write amplification.

Keep indexed columns searchable

Functions, expressions, and implicit type conversions applied to an indexed column can prevent an efficient lookup. Prefer comparing a column to a value in the column’s native type. Move transformations to the parameter side where semantics allow, and verify the resulting plan with EXPLAIN.

Reduce rows before joins and sorts

Apply selective filters as early as the query’s semantics permit. Return only required columns, limit result sets for interactive screens, and avoid sorting or grouping a large intermediate result when the application needs only a small page. These changes reduce the rows that later joins, aggregations, and sorts must process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove N+1 request patterns

An application that fetches one parent row and then issues a separate query for every child can create high CPU even when each query looks harmless. Replace the loop with a set-based query, a carefully bounded batch, or a prefetch strategy. Verify that the replacement does not return an unexpectedly large result.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Use Performance Schema for intermittent CPU spikes

When the expensive statement finishes before a process-list snapshot or does not consistently exceed the slow-log threshold, Performance Schema can attribute work during a spike. Its statement and thread instrumentation records low-level execution activity without changing query execution plans, and it is separate from binary logging.

Use it to compare a busy interval with a quiet interval. The exact enabled instruments and consumers vary by MySQL version and configuration, so inspect what is active before interpreting an empty result:

SELECT *
FROM performance_schema.setup_instruments
WHERE NAME LIKE 'statement/%';

SELECT *
FROM performance_schema.setup_consumers
WHERE NAME LIKE '%events%';

Current thread activity can be viewed through the process-list table:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
SELECT THREAD_ID, PROCESSLIST_ID, PROCESSLIST_USER,
       PROCESSLIST_TIME, PROCESSLIST_STATE,
       PROCESSLIST_INFO
FROM performance_schema.processlist
ORDER BY PROCESSLIST_TIME DESC;

For historical attribution, query the statement event summaries available in your version and rank by total timer time, count, or rows examined. If instrumentation is disabled or incomplete, state that limitation explicitly and combine the slow log, application metrics, and operating-system sampling. Do not enable every high-volume instrument permanently without estimating CPU overhead, retention, and disk growth.

Choose between a query rewrite and an index change

Both approaches can reduce CPU, but they carry different risks. Make the choice against the measured statement and its plan.

Criterion Query rewrite Index change
Read latency Can reduce rows, joins, or repeated calls without adding storage. Can make selective lookups much faster when the access path is the bottleneck.
Write amplification Usually unchanged, unless the rewrite changes write behavior. Every insert, update, and delete may maintain the new index.
Storage footprint Usually unchanged. Requires additional index pages and buffer-pool space.
Plan stability Depends on the new SQL shape and data distribution. Can introduce another optimizer choice and may change as statistics change.
Deployment risk Requires application or migration testing and coordinated rollout. Requires an index operation and validation of write impact.
Rollback ease Revert the application or query definition. Drop the added index after confirming no other workload depends on it.

Do not apply both changes at once unless an incident demands it. A single change preserves causal evidence and makes rollback straightforward.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Remediate without a restart

Most attribution and query fixes can be performed while the server remains online. A practical sequence is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Contain an accidental source: Stop or throttle the report, job, polling loop, or client that is demonstrably generating the load.
  2. Preserve evidence: Save the process-list output, original SQL, slow-log sample, EXPLAIN output, relevant configuration values, and existing index definitions.
  3. Make one change: Rewrite the worst statement, add one justified index, correct a connection pattern, or adjust a narrowly scoped logging setting.
  4. Observe representative traffic: Allow enough normal workload to exercise the statement instead of judging from a single test execution.
  5. Record the result: Note CPU utilization, query latency, executions per second, rows examined, lock waits, slow-log volume, and the before/after plan.
  6. Roll back if needed: Restore the original query or configuration, or remove the new index, if latency, write load, storage use, or plan stability worsens.

Dynamic settings such as slow-log controls do not necessarily persist across restarts. If a setting is part of the long-term fix, update the managed configuration only after validating it and documenting the intended scope.

Validation checklist

  • CPU is lower under comparable traffic, not merely during a quiet period.
  • The target statement’s latency and execution rate have improved.
  • Rows examined and temporary work have fallen where the fix was intended to help.
  • Lock waits, queueing, and application response time have not regressed.
  • The new EXPLAIN plan uses the intended access path and remains sensible for representative parameter values.
  • Write latency, storage consumption, and maintenance cost are acceptable after an index change.
  • Logging and instrumentation are bounded so they do not create a second incident.

Pitfalls that make CPU incidents worse

Changing global settings before finding the workload

Increasing buffers or changing thread-related settings may move the bottleneck without reducing the work. Configuration changes also make it harder to tell which action helped. Attribution should come first.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Assuming every scan is a missing index

A scan can be the cheapest plan for a small table or a query that returns most rows. Judge it with execution time, rows examined, selectivity, and call frequency.

Using only one process-list snapshot

Short queries can disappear between snapshots. Combine repeated snapshots with slow-log history, Performance Schema summaries, and application metrics.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leaving broad logging enabled indefinitely

Logging every non-indexed query or every instrumented event can consume CPU and disk. Set a retention period, estimate growth, and turn off diagnostic options that are no longer needed.

Killing idle sessions indiscriminately

Sleeping connections are not automatically harmful. Connection-pool sizing, transaction state, and application behavior matter more than age alone.

When the evidence remains inconclusive

If CPU is still high after the first change, do not stack unrelated indexes and configuration edits. Return to attribution: capture another process-list sample, compare active and quiet Performance Schema intervals, inspect slow-log frequency, and correlate the database timeline with application deployments or scheduled jobs.

If no single statement dominates, the workload may be many small calls, parallel reporting, inefficient connection behavior, or CPU spent outside statement execution. In that case, compare executions per second and aggregate statement time rather than searching only for one long query. Keep the incident record so recurring patterns can be recognized during the next spike.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently asked questions

Is there a fixed CPU percentage at which mysqld is unhealthy?

No. The consulted MySQL guidance does not publish a universal CPU threshold or benchmark for this situation. Interpret utilization alongside latency, throughput, lock waits, and the server’s normal baseline.

Can I fix high mysqld CPU without restarting the server?

Often yes. Capturing process lists, enabling diagnostic logging where supported, terminating one clearly harmful session, rewriting a query, and adding a tested index can all be performed online. Persistence and locking behavior must still be checked for your MySQL version and workload.

Which tool should I use first: the slow log or Performance Schema?

Use the process list first for an active incident. The slow log is better for recurring statements and historical review; Performance Schema is useful for intermittent activity and aggregate attribution. They answer different time-window questions and are most effective together.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CPU troubleshootingdatabase performanceEXPLAINLinuxMySQL

Leave a reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.