Skip to content
Diamond Sierra

PB-2104: Request used a lot of processor time

Paul Bunyan code PB-2104 (Warning): Request used a lot of processor time. What it means and what to do.

Updated · By Diamond Sierra

On this page

What it means

The request kept a processor busy for half a second or more. Unlike wall-clock time, this excludes waiting on the database, other servers or the mail system: it is work done by PHP itself, and it is what a host's CPU limit counts.

What to do

Open the request and look for slow functions whose "Inside" line is mostly "other PHP". Image handling, large loops, and loading WordPress many times at once are the usual causes. Several of these at the same moment are what trip a CPU limit.

Common causes

  • Image work in PHP: making thumbnails, resizing or converting uploads during a page view.
  • Large loops: building a long list, export or report in one request.
  • Page builders rendering many modules, or heavy shortcodes (PB-2603).
  • Code that loads WordPress again for each call (PB-2103), so the start-up cost is paid over and over.
  • PHP running without OPcache (PB-3008), which recompiles every file on every request.
  • Several of these at the same moment: that is what trips a host's CPU limit and makes every other visitor wait.

How to find and fix it

  1. Open the request and sort its slow functions by time. Look for ones whose "Inside" line is mostly "other PHP": that is processor work, not waiting.
  2. Note the plugin, file and line. If it's a plugin setting (image sizes, regenerate on view, live previews), switch that off or move the work to a background job.
  3. If it is your own code, time the suspect part with paul_bunyan_scope() to find the loop.
  4. Check Overview → Requests running at the same time. If CPU-heavy requests pile up together, spread scheduled work out or ask the host about the plan's CPU limit.

Details

CodeSeverityGroup
PB-2104WarningRequest