Skip to content
Server & hosting

Fluctuating Response Time: When Your Server Shares CPU

Response time swings with no change to your shop? Shared CPU time may be the cause. How to measure steal time, run the counter-checks and choose a remedy.

20 min read Server-OptimierungTTFBHostingMessung

In short and in plain language

Sometimes a shop is slow in the evening. In the morning it is fast. Nothing in the shop has changed.

The server can be the reason. Many servers share one big computer. When another server needs the same computing time, your server has to wait. This wait is called steal time.

Linux can measure this wait. A small program writes it down every second. Next to it, we write down how fast the shop responds.

We also check other reasons. There may be too few processes for requests. The database may be slow. Or there is a fixed limit for computing time.

If the wait is the reason, talking to the provider can help. A plan with its own cores can help too. A cache saves computing time.

In the morning the shop responds quickly; in the evening the same category page suddenly takes several times as long, with no deployment, no changed plugin and no campaign that multiplies traffic. Searching your own code often turns up nothing, because the cause lies outside it: a virtual server shares the physical processors with other virtual machines. When its virtual CPU has to wait because the hypervisor is busy servicing another virtual processor, Linux books that time as steal time (man7.org). The field has been part of /proc/stat since Linux 2.6.11 (man7.org), top, vmstat and mpstat all display it, and yet it is rarely recorded alongside response time. This article shows how to recognize the pattern, how to log steal time second by second, how to run the counter-checks against worker saturation, the database and container throttling, and which remedies exist. Because it is published in the middle of Black Week, the focus is not on rebuilding anything but on a measurement that can quietly run alongside this week.

Key takeaways

  • Steal time is time in which a virtual CPU wanted to run but had to wait because the hypervisor was servicing another virtual processor. Linux has reported it as the eighth field in /proc/stat since version 2.6.11 (man7.org).
  • Averages hide the pattern: with a mean latency of 100 milliseconds, 1 percent of requests can easily take 5 seconds (Site Reliability Engineering). Record response time as a percentile per minute and steal time per second next to it.
  • Black Week is the measurement opportunity: a logger that reads /proc/stat every second changes nothing in the shop and runs alongside the peak. The analysis happens after the week, not during it.
  • Run the counter-checks before drawing conclusions: queue and max children reached on the PHP-FPM status page (php.net), the slow query log with a lower threshold than the default 10 seconds (MariaDB), throttling via nr_throttled in cpu.stat.
  • The man pages for top, vmstat and mpstat give no fixed percentage at which steal time becomes harmful (man7.org). What counts is timing: steal rises in the slow minutes and not in comparison minutes with the same load.
  • Remedies come in three steps: take the data series to your provider, move to a plan with dedicated cores or another host, and build headroom by spending less CPU per request. Shared hosting has no steal field of its own, so measure from outside.

The pattern: same page, different response time

Fluctuating response times have many causes, but one specific pattern points to shared CPU time: server response time jumps in individual time windows even though the number of requests in those minutes does not grow to the same extent. The spikes often appear at recurring times of day, affect every page type and disappear again without anyone intervening. Pages served from a reverse proxy or full-page cache often stay fast while everything that runs through PHP and the database slows down at the same moment. That simultaneity is the clue: when every request that needs computation suddenly takes longer, the whole machine is short of CPU time, not a single query.

The thresholds for server response time show how much of this reaches the visitor: 0.8 seconds or less is considered good, values above 1.8 seconds poor (web.dev). On phones, only 44 percent of the websites in the Chrome UX Report had a good server response time in 2025, on desktop 55 percent (Web Almanac 2025). Server response time comes before every other loading step. Any delay in the back end pushes First Contentful Paint and Largest Contentful Paint later, and in checkout it lengthens every step that cannot be served from cache.

The tricky part of this pattern is the statistics. In the daily average it barely shows, because a few minutes of spikes disappear among many quiet minutes. Google's book Site Reliability Engineering works through an example: with a mean latency of 100 milliseconds at 1,000 requests per second, 1 percent of requests might easily take 5 seconds (Site Reliability Engineering). For the customer who taps "Add to cart" in exactly that minute, the average is meaningless. That is why Core Web Vitals are assessed at the 75th percentile of page loads (web.dev), and for troubleshooting it pays to look even further into the tail of the distribution.

Before the server comes under suspicion, the spike should be clearly documented in the data: with time of day, page type and percentile. How server response time breaks down into DNS, connection, waiting and back-end time is covered in our article on server response time and its components. This article is about the case in which the back end gets slower although nothing about it has changed.

What steal time means on a Linux system

Linux keeps counters for every CPU that record how much time it has spent in each state: in user processes, in the kernel, idle, waiting for input and output, and in a few other categories. The values live in the pseudo-file /proc/stat and are counted in USER_HZ, which on most architectures means hundredths of a second (man7.org). The eighth field is called steal. The man page describes it as the time spent in other operating systems when running in a virtualized environment (man7.org).

/proc/stat (example from the man page)
$ head -1 /proc/stat
cpu  10132153 290696 3084719 46828483 16683 0 25195 0 175628 0
#    user     nice   system  idle     iowait irq softirq steal guest guest_nice

The mpstat man page is more specific: %steal is the share of time the virtual CPU spent in involuntary wait while the hypervisor was servicing another virtual processor (man7.org). The kernel documentation sums the field up briefly as involuntary wait (Linux Kernel Documentation). In top the value appears as st, described as time stolen from this virtual machine by the hypervisor (man7.org), and vmstat shows it in the st column (man7.org). The counters are cumulative; only the difference between two readings, divided by the total CPU time over the same interval, carries meaning.

An important limitation for interpretation comes from the interface between KVM and the guest. There, the steal field stands for the amount of time in which the virtual CPU did not run, measured in nanoseconds; time during which it was idle anyway is explicitly not reported as steal (Linux Kernel Documentation). Steal time therefore only arises when your server wants to compute. A server with little to do at night shows little steal, even if the host is under heavy load at that time. Conversely, the bottleneck surfaces exactly when your shop is under load, which during sale week means at the worst possible moment.

What the value does not tell you matters just as much. It says neither which other virtual processors had priority nor why. That cannot be determined from inside the guest, and speculation about it does not help in a conversation with your provider. For troubleshooting the information is still sufficient: the missing CPU time is lost outside your server, so tuning the shop alone cannot win it back.

Logging steal time second by second

For a first look, the existing tools are enough. vmstat 1 prints one line per second, with the st column in the CPU block after us, sy, id and wa; the first report, however, shows averages since the last reboot and is of no use for troubleshooting (man7.org). mpstat -P ALL 1 from the sysstat package shows %steal per CPU at the same rate (man7.org). In top the value appears in the summary area as st, provided the kernel supplies it (man7.org).

Analysis needs more than a glance: a time series that sits next to response time. A small script is all it takes: it reads /proc/stat once per second, computes the difference from the previous reading and writes the shares with a timestamp to a file. It needs no installation, no special privileges and hardly any CPU time. The only requirement is that it runs as a service of its own or in a terminal session that survives logging out.

cpu-steal-log.sh
#!/bin/bash
# Writes the CPU shares from /proc/stat to a file once per second.
# Columns: time, user+nice, system+irq+softirq, idle, iowait, steal (percent)
read -r _ u n s i w q sq st _ < /proc/stat
while sleep 1; do
  read -r _ u2 n2 s2 i2 w2 q2 sq2 st2 _ < /proc/stat
  du=$((u2+n2-u-n)); ds=$((s2+q2+sq2-s-q-sq))
  di=$((i2-i)); dw=$((w2-w)); dst=$((st2-st))
  tot=$((du+ds+di+dw+dst))
  if [ "$tot" -gt 0 ]; then
    printf '%s %d %d %d %d %d\n' "$(date +%FT%T)" \
      $((100*du/tot)) $((100*ds/tot)) $((100*di/tot)) $((100*dw/tot)) $((100*dst/tot))
  fi
  u=$u2; n=$n2; s=$s2; i=$i2; w=$w2; q=$q2; sq=$sq2; st=$st2
done >> "$HOME/cpu-steal.log"

Resolution is not a detail here. Looking at CPU load averaged over a minute will miss even fairly long-lived spikes that drive up the tail of the response time distribution (Site Reliability Engineering). So write per second and condense only during analysis. Logging /proc/pressure/cpu at the same rate adds one of the counter-checks right away.

The second time series is response time itself. The easiest source is the web server access log, provided it records the processing time of each request. From it you derive the median and a high percentile per minute. The book Site Reliability Engineering recommends counting requests in latency buckets rather than individually, that is, how many took between 0 and 10, 10 and 30, 30 and 100 or 100 and 300 milliseconds (Site Reliability Engineering). The boundaries grow roughly exponentially, in the example by a factor of about 3 each time (Site Reliability Engineering). That keeps the tail of the distribution visible without storing every request.

If the back end already sets Server-Timing headers, you can also capture time for database, cache and application separately; the header carries a name, an optional duration and an optional description for each metric (MDN). How to set this up is explained in the article on Server-Timing in the back end. If all entries rise evenly in the minutes with high steal time, that points to missing CPU time. If only the database entry rises, the trail leads elsewhere.

Black Week as a measurement opportunity

This article is published on the Monday of Black Week. It is too late for changes to server, plan or architecture, and switching hosts this week would be an unnecessary risk. For a measurement, on the other hand, the timing is right: load is high, campaigns start at known times, and if shared CPU time is dragging down your response time, it will show now. Black Friday falls on November 27 and Cyber Monday on November 30; together with the days before, that makes a week with several load peaks at different times of day.

The logger only reads a file and changes nothing in the shop. It can therefore be started even during a change freeze, provided your operating rules allow it. In addition, note the times at which newsletters go out, promotions go live or prices change. Without these markers it is impossible to tell later whether a spike came from your own traffic or from shared CPU time. How to prepare for the night of the sale launch itself is covered in the article on warming the cache before the sale launch.

The analysis happens after the week, not during it. During the peak, availability matters more than root-cause analysis; anyone who adjusts parameters in the middle of the promotion distorts the data series and puts revenue at risk. In early December, response time, CPU shares, steal time and your own markers sit on the same time axis. That gives you a solid basis for the conversation with your provider and for the next load test, as described in the article on load testing before peak season.

Plan for disk space

One line per second adds up to a file in the range of a few dozen megabytes over a week. Put it on a partition that will not fill up during the promotion and rotate it only after the analysis. A data series that breaks off on Black Friday because the disk is full is missing exactly where it is needed.

Counter-checks: workers, database and throttling

Steal time does not explain every fluctuating response time. Three other causes produce a very similar picture, and all three are your own responsibility, not the host's. Each of them should be ruled out before you talk to your provider. The following commands read the values you need; they can be hooked into the same interval as the steal logger.

counter-checks.sh
# PHP-FPM queue and process limit (the status page must be enabled)
curl -s http://127.0.0.1/fpm-status | grep -E 'listen queue|max children reached'

# Throttling of your own control group (cgroup v2)
grep -E 'nr_throttled|throttled_usec' /sys/fs/cgroup/cpu.stat

# CPU pressure on the system
cat /proc/pressure/cpu

Worker saturation in PHP-FPM

If more simultaneous requests arrive than PHP-FPM has processes available, new requests wait in a queue. The status page shows this directly: listen queue is the number of requests currently waiting for a free process, max listen queue the highest number of requests seen in it at any one time (php.net). The max children reached field shows 1 or more once the process limit has been reached, otherwise 0 (php.net). If the queue rises in the same minutes as response time while steal stays flat, the bottleneck is the number of workers. How to calculate the limit sensibly is covered in the article on PHP runtime tuning with OPcache, JIT and FPM workers.

Both can happen together. When CPU time is missing, workers take longer, the queue grows, and eventually the process limit is reached too. The order in the time series is therefore decisive: if steal rises first and the queue only afterwards, the queue is the consequence, not the cause. More workers help little in that case, because they compete for the same scarce CPU time.

Slow database queries

An expensive query, a lock conflict or an index missing after an import also slows down specific pages. The slow query log shows such queries, but by default it only records what takes longer than 10 seconds (MariaDB). For troubleshooting a shop, that threshold is far too high; it can be lowered at runtime. Besides very large selects, the MariaDB documentation explicitly names slow hardware and very high lock, CPU or I/O contention as reasons for entries in the log (MariaDB).

The distribution pattern is what tells the story. If many different queries that are normally fast suddenly appear in the minutes with high steal time, CPU time is missing. If the same query shows up at every time of day, that query is the problem, and the article on database query optimization for shops will help.

CPU limits in containers

If the shop runs in containers, a CPU limit on its own control group can produce a similar picture. Within each period the kernel allocates a quota of CPU time to the group; once it is used up, its threads are throttled until the next period (Linux Kernel Documentation). In cgroup v2 the limit lives in cpu.max. The default is "max 100000", meaning no limit with a period of 100,000 microseconds (Linux Kernel Documentation). Whether throttling happened is shown by nr_throttled and throttled_usec in cpu.stat (Linux Kernel Documentation). If nr_throttled grows in the minutes of the spikes, your own limit is too tight: a matter of configuration, not of the provider.

CPU pressure on your own system

A fourth check looks at the kernel's Pressure Stall Information. The some line in /proc/pressure/cpu shows the share of time in which at least some tasks were stalled waiting for the CPU, as moving averages over 10, 60 and 300 seconds (Linux Kernel Documentation). High CPU pressure with low steal time means your server has more work than its virtual CPUs can handle: too many workers, too many simultaneous cron jobs or simply too few cores booked. High pressure together with rising steal time means the booked cores might be enough if they actually received their CPU time.

SignalShared CPU timeWorker saturationDatabaseContainer throttling
steal in /proc/statrises in the minutes of the spikesflatflatflat
listen queue (PHP-FPM)rises after stealrises firstrises after the queriesrises after throttling
Slow query logmany normally fast queriesunremarkablethe same queries at all timesdepends on setup
nr_throttled (cpu.stat)unchangedunchangedunchangedgrows
responsibleprovider, planown configurationapplication, indexesown configuration

No threshold without correlation

The man pages for top, vmstat and mpstat name no percentage at which steal time becomes harmful (man7.org). Blanket values from forums are therefore of little help. What holds up is the timing in your own data: steal rises, response time follows, and the counter-checks stay quiet.

Proving the correlation instead of guessing

After the week you have several time series. The analysis follows a simple plan: first pick out the minutes with the highest response times, separately for cached and uncached pages. Then put steal share, FPM queue, nr_throttled and CPU pressure next to exactly those minutes. Minutes with a similar number of requests but normal response time serve as the comparison. If steal is clearly higher in the slow minutes than in the comparison minutes while the other signals stay the same, the correlation is established.

The comparison minutes are the decisive part. Without them you cannot rule out that steal rises every evening even when response time stays good. Only the comparison shows whether shared CPU time actually has an effect or merely occurs at the same time by chance. The book Site Reliability Engineering describes rising latency as often the earliest sign of saturation: the 99th percentile of response time over a small window, for example one minute, gives a very early signal (Site Reliability Engineering). That same window also works for matching against steal.

With latency, traffic, errors and saturation you cover the four golden signals the book Site Reliability Engineering recommends for user-facing systems (Site Reliability Engineering). Steal time adds an extra saturation signal that only matters in virtualized environments. For the conversation with your provider, the result belongs in a compact form: a chart with response time and steal on the same time axis, the list of affected time windows with time and time zone, confirmation that FPM queue and throttling stayed quiet, and the number of virtual CPUs you have booked. With this summary the discussion is about facts, not impressions.

Remedies: dedicated cores, another plan, headroom

Once the correlation is established, there are three paths that can be combined. The first is the conversation with your provider. With the data series in hand you can ask whether the server can be moved to another host, whether plans with dedicated cores exist and what the contract actually commits to in terms of computing power. If the service description lists only the number of virtual CPUs without stating whether they are exclusive, that is exactly the question to clarify.

The second path is a different plan or server type: dedicated cores or a dedicated server without virtualization, where no hypervisor distributes CPU time. Which option fits depends on load, budget and operating effort; the trade-offs between the models are covered in the article on hosting choice and load time. After the switch, run the same measurement again. Only the before-and-after comparison shows whether it worked.

The third path works regardless of the provider: less CPU time per request. Every page served from a full-page cache or reverse proxy needs hardly any CPU and is correspondingly little affected by shared CPU time. Which cache layers are suitable is shown on the page about caching strategies; in Shopware the HTTP cache is a major lever (Shopware performance). OPcache, a properly sized object cache and lean queries reduce the demand of the remaining requests.

That does not replace missing CPU time, but it increases headroom. A server with spare capacity copes with a steal spike far better than one that is already at its limit during the peak. How much spare capacity makes sense can be derived from the measurement rather than from a rule of thumb, and the Black Week data series is a solid basis for it. Headroom is not waste; it is the buffer for everything that cannot be planned.

Limits: shared hosting, containers and missing values

Steal time is a signal of virtual machines. On shared hosting many customers share one system without each having a virtual machine of their own; there is no steal value describing your share, and access to system tools is often restricted. The competition for CPU time is still there, it just does not show up as a metric. What remains is measuring from outside: server response time per minute, supplemented by Server-Timing from the application, and comparison with time windows in which your own traffic was just as high.

In containers, cpu.stat and cpu.pressure of your own control group are the relevant files; according to the kernel documentation, cpu.pressure accounts for all processes in the group (Linux Kernel Documentation). Steal time of the virtual machine underneath only shows at that level. If you run containers on a virtual server, measure in both places: throttling in the group, steal time on the machine.

Finally, the value may be missing. Depending on the kernel version, top may not show the st field (man7.org), and whether a hypervisor reports the time to the guest at all depends on the virtualization: with KVM, the guest has to register a dedicated memory area for it (Linux Kernel Documentation). If steal stays at zero although the server is virtualized, that does not prove a quiet host; it may simply be a missing measurement. The kernel itself takes the value seriously: it factors steal time into scheduler behavior. The no-steal-acc parameter switches that off; the value is still computed but no longer influences the scheduler (Linux Kernel Documentation).

Six steps to a data series

  1. Start the logger: read /proc/stat every second and write user, system, idle, iowait and steal as shares with a timestamp, plus /proc/pressure/cpu.
  2. Capture response time: write the processing time of each request to the access log and derive median and a high percentile per minute, separately for cached and uncached pages.
  3. Log the counter-checks: PHP-FPM status with listen queue and max children reached, cpu.stat with nr_throttled, slow query log with a lower threshold.
  4. Mark events: note newsletters, sale launches, price changes and deployments with their times so that your own traffic can be separated from shared CPU time.
  5. Analyze after the week: compare slow minutes with comparison minutes of equal load and check whether steal alone explains the difference.
  6. Draw conclusions: take the data series to your provider, change plan or host, build headroom through caching and measure again after every change.

If you would rather not run this analysis yourself, you can hand it over as part of a performance analysis. We combine the time series, run the counter-checks and draft the summary for the conversation with your provider. Which measures then apply to the server is described on the page about server optimization; the response time side is covered in more depth by TTFB optimization. Our services give an overview of every step from front end to hosting.

Sources and documentation

This article is based on data from: man7.org (man pages proc_stat(5), top(1), vmstat(8), mpstat(1)); Linux Kernel Documentation (The /proc Filesystem, PSI, steal time interface for guests, CFS Bandwidth Control, Control Group v2, kernel parameters); web.dev (Time to First Byte, Web Vitals); Web Almanac 2025 (Performance chapter); Site Reliability Engineering (Google, chapter Monitoring Distributed Systems); php.net (FPM status page); MariaDB (Slow Query Log Overview); MDN (Server-Timing).

Related Articles

Server & hosting

WordPress Slow Despite Caching: WP-Cron and admin-ajax

Page cache on, WordPress still sluggish? WP-Cron, Heartbeat and admin-ajax bypass the cache and tie up PHP workers. How to measure that load and take it off.

19 min read
Server & hosting

Server-Timing: Where the Backend Time Actually Goes

TTFB only gives you the sum. The Server-Timing header breaks server time down in the browser into database, cache, application logic and template work.

13 min read
Server & hosting

PHP Runtime Tuning: OPcache, JIT and FPM Workers

Between web server and database sits the PHP runtime. How OPcache, preloading, JIT and FPM workers shape your response time under load, and how to measure it.

12 min read