Как читать PSI в Linux: проверить давление на CPU, память и диск
Что показывают файлы /proc/pressure, как отличить занятость от ожидания ресурсов и использовать avg10, avg60, avg300 и total без ложных порогов.

В этой статье
Высокая загрузка CPU не всегда означает, что серверу плохо, а почти занятая память не всегда требует увеличения VPS. Полезнее знать, сколько времени задачи не могли продвигаться из-за нехватки процессора, памяти или ввода-вывода. Для этого ядро Linux предоставляет Pressure Stall Information — PSI.
Инструкция относится к Linux с включённым PSI и интерфейсом procfs. Команды сверены с документацией ядра 26 сентября 2026 года и только читают данные. В использованном изолированном окружении файлы PSI не были смонтированы, поэтому выполнение подтвердило ожидаемую ошибку отсутствия интерфейса, но не дало числового примера с реального сервера.
Проверьте наличие интерфейса
ls -l /proc/pressure
Если каталог существует, в нём обычно доступны файлы для процессора, памяти и ввода-вывода. Отсутствие каталога означает, что ядро, его конфигурация или контейнерное окружение не предоставляют PSI. Не создавайте эти файлы вручную: это виртуальный интерфейс ядра.
Прочитайте три источника
cat /proc/pressure/cpu
cat /proc/pressure/memory
cat /proc/pressure/io
Чтение почти не создаёт нагрузки. Оно показывает текущие скользящие средние и накопленное время ожидания с момента загрузки или создания соответствующей группы. Значения нужно сопоставлять с интервалом, мониторингом и пользовательскими задержками.
Разберите строки some и full
Строка some означает, что хотя бы часть задач задерживалась из-за ресурса. Строка full означает более тяжёлое состояние: одновременно не могла выполнять полезную работу вся группа нетривиальных задач. Для CPU обычно доступна только some, потому что при наличии исполняемой задачи процессор всё равно занят полезной работой.
Поле | Смысл | Как не ошибиться |
|---|---|---|
avg10 | Средняя доля времени ожидания примерно за 10 секунд | Чувствительна к короткому пику |
avg60 | Средняя примерно за минуту | Сглаживает краткие всплески |
avg300 | Средняя примерно за пять минут | Может скрыть недавно начавшуюся проблему |
total | Накопленное время ожидания в микросекундах | Само число растёт; важна разница за интервал |
some | Ожидала часть задач | Не означает полную остановку системы |
full | Все нетривиальные задачи одновременно были заблокированы | Особенно важна связь с задержками сервиса |
Значение 5,00 в среднем не означает пять секунд ожидания и не равно загрузке CPU. Это доля времени в процентах за окно. Для оценки накопленного поля берут две точки и делят прирост total на длительность интервала в микросекундах.
Сопоставьте ресурс с симптомом
Рост cpu some вместе с очередью выполнения говорит, что задачам не хватает процессорного времени.
Рост memory some показывает задержки при возврате памяти; его сопоставляют с swap, reclaim и поведением приложения.
Рост memory full означает периоды, когда все задачи группы были остановлены из-за памяти, и требует быстрой диагностики.
Рост io some бывает при ожидании диска отдельными задачами; io full показывает общую остановку группы на вводе-выводе.
Низкий PSI при медленном сайте направляет поиск к приложению, блокировкам базы, сети или внешним API.
Снимите две точки для total
Для ручной проверки сохраните вывод, подождите согласованный короткий интервал под наблюдением и снимите его снова. Не создавайте искусственную нагрузку на рабочем сервере. Сравните прирост total с графиками ответа сайта и другими метриками.
cat /proc/pressure/memory
Если мониторинг собирает PSI регулярно, ручной расчёт не нужен. Важно сохранить сырые поля, интервал и область измерения. В контейнере показатели могут относиться к cgroup, хосту или быть скрыты — это зависит от конфигурации; границу нужно проверить до выводов.
Почему универсального порога нет
Короткое давление во время резервного копирования и постоянное давление во время оформления заказов имеют разный риск. Порог выбирают из базовой линии и допустимой задержки конкретного сервиса. Сначала отмечают корреляцию с временем ответа, ошибками и очередями, затем задают предупреждение и критический уровень.
PSI не заменяет обычные метрики. Для CPU нужны использование и очередь, для памяти — доступный объём, swap и владельцы, для диска — задержка и пропускная способность. PSI добавляет ответ на вопрос, мешал ли дефицит ресурса задачам выполнять работу.
Когда передавать диагностику специалисту
Показатель full растёт вместе с ошибками магазина или тайм-аутами базы.
Давление сохраняется после окончания известных фоновых задач.
Контейнер и хост показывают противоречивые данные.
Для исправления нужно менять лимиты, swap, планировщик, хранилище или конфигурацию базы.
Нет базовой линии, а увеличение тарифа предлагается только по одному мгновенному значению.
Сначала сохраните интервал и контекст, затем меняйте одну причину за раз. PSI особенно полезен не как красный индикатор, а как способ отделить занятость ресурса от реального ожидания и проверить, помогло ли изменение системе выполнять работу.
High CPU usage does not always mean the server is in trouble, and nearly full memory does not always require increasing VPS resources. It is more useful to know how long tasks could not progress due to lack of CPU, memory, or I/O. For this, the Linux kernel provides Pressure Stall Information, or PSI.
This guide applies to Linux with PSI enabled and the procfs interface. Commands are verified against kernel documentation dated September 26, 2026, and only read data. In the isolated environment used, PSI files were not mounted, so execution confirmed the expected error of a missing interface but did not provide a numerical example from a real server.
Check for the interface
ls -l /proc/pressure
If the directory exists, files for CPU, memory, and I/O are usually available. The absence of the directory means the kernel, its configuration, or the container environment does not provide PSI. Do not create these files manually: this is a virtual kernel interface.
Read the three sources
cat /proc/pressure/cpu
cat /proc/pressure/memory
cat /proc/pressure/io
Reading imposes almost no load. It displays current moving averages and accumulated wait time since loading or the creation of the corresponding group. These values must be correlated with the interval, monitoring data, and user latency.
Examine the some and full lines
The some line indicates that at least part of the tasks were delayed due to resource pressure. The full line indicates a more severe state: the entire group of non-trivial tasks was unable to perform useful work simultaneously. For CPU, only the some line is typically available because if an executable task exists, the processor remains busy with useful work.
Field | Meaning | How to Avoid Mistakes |
|---|---|---|
avg10 | Average wait time of approximately 10 seconds | Sensitive to short spikes |
avg60 | Average of approximately one minute | Smooths out brief bursts |
avg300 | Average of approximately five minutes | May hide a recently started issue |
total | Accumulated wait time in microseconds | The absolute value increases; the difference over an interval is what matters |
some | Some tasks were waiting | Does not mean a complete system halt |
full | All non-trivial tasks were simultaneously blocked | The correlation with service delays is especially important |
An average value of 5.00 does not mean five seconds of wait time, nor does it equal CPU utilization. It represents the percentage of time within the window. To evaluate the accumulated field, take two data points and divide the increase in total by the interval duration in microseconds.
Correlate the resource with the symptom
An increase in cpu some alongside the execution queue indicates that tasks lack CPU time.
An increase in memory some indicates delays when returning memory; it correlates with swap, reclaim, and application behavior.
An increase in memory full indicates periods when all tasks in the group were stopped due to memory, requiring rapid diagnosis.
An increase in io some occurs when individual tasks wait for the disk; io full indicates a complete group stoppage on input/output.
Low PSI on a slow site directs the investigation toward the application, database locks, network, or external APIs.
Capture two data points for total
For manual verification, save the output, wait for a consistent short interval under observation, and capture it again. Do not create artificial load on a production server. Compare the increase in total with the website response graphs and other metrics.
cat /proc/pressure/memory
If monitoring collects PSI data regularly, manual calculation is unnecessary. It is important to preserve the raw fields, interval, and measurement scope. In containers, metrics may relate to cgroups, the host, or be hidden; this depends on the configuration, so the boundary must be verified before drawing conclusions.
Why There Is No Universal Threshold
Brief pressure during backup and sustained pressure during order placement carry different risks. The threshold is selected based on the baseline and the acceptable latency of the specific service. First, correlate with response time, errors, and queues, then set warning and critical levels.
PSI does not replace standard metrics. For CPU, you need utilization and the run queue; for memory, available volume, swap, and owners; for disk, latency and throughput. PSI adds the answer to whether resource scarcity prevented tasks from doing work.
When to Hand Diagnostics Over to a Specialist
The full metric rises alongside store errors or database timeouts.
Pressure persists after known background tasks have finished.
The container and host report contradictory data.
To fix this, adjust limits, swap, the scheduler, storage, or the database configuration.
There is no baseline, yet an upgrade is proposed based on a single instantaneous value.
First, save the interval and context, then change one cause at a time. PSI is especially useful not as a red alert, but as a way to distinguish resource saturation from actual waiting and to verify whether a change helped the system perform work.





Обсуждение 0
Делись опытом и задавай вопросы. Комментарии без ссылок появляются после проверки редактором.
Пока никто не написал. Начни обсуждение.