@AKLZephyr

Почему растет iowait?

Есть сервер на digitalocean на котором стоит приложение под докером. Nginx, postgres, php

Каждый день ровно в 5 утра начинаются сильные проблемы с iowait продолжительностью примерно 30 минут. Доходит до 40% из-за чего лагает все приложение.
Проверил уже несколько раз все приложение никаких задач в это время нет и каких-то предположений кто может напрягать в это время диск не нашел.
При том такая же проблема есть и на 2м сервере ровно в это же время и столько же по продолжительности, но там iowait растет до 20%, на остальных серверах все хорошо.
Грузит вроде как бд, но никакой кучи запросов в это время нет и никакие команды не выполняются.

До лагов:
604b0ed479b37435026210.png
604b0ee1025b6304115703.png

Во время:
604b0f33a2c53192667192.png
604b0f4663e71024019740.png
604b0f919ece2843245994.png
  • Вопрос задан
  • 1354 просмотра
Пригласить эксперта
Ответы на вопрос 5
@alexeymoskalenko
Проблемы с iowait связаны с занятостью дисковой подсистемы. Скорее всего в 5 утра запускаются задания на бэкап данных
Ответ написан
Вот что я нагуглил насчет
postgres: writer process

https://www.cybertec-postgresql.com/en/postgresql-...
The writer a.k.a. background writer process

Note that we assume that the high level concept of “checkpoints” together with the checkpointer process and its parameters are already familiar to you (as it’s way more impactful compared to the writers). When not, I’d recommend digging into Postgres documentation here.

So to the writer. Introductory sentence in the documentation tells us:

There is a separate server process called the background writer, whose function is to issue writes of “dirty” (new or modified) shared buffers. It writes shared buffers so server processes handling user queries seldom or never need to wait for a write to occur. However, the background writer does cause a net overall increase in I/O load, because while a repeatedly-dirtied page might otherwise be written only once per checkpoint interval, the background writer might write it several times as it is dirtied in the same interval. …

In short – the writer moves some of the changed data (dirty buffers) already to the disk in the background, so that checkpoint process, happening at regular intervals, would have less work to do. All of this with the point that in the end user/application queries wouldn’t need to suffer too much when checkpointer kicks in with its heavy IO requirements, when there are lots of buffers to be processed or checkpoint_completion_target is set too small. All this is relevant of course only when we’re running a relatively busy database – for idling databases it wouldn’t be a problem at all.
Ответ написан
@unseriously
- смотреть в логи: /var/log или где там они у вас
- сервера физически находятся в одном ДЦ? может там maintenance какой-то, хотя вряд ли
- написать в поддержку
Ответ написан
@Zzzz9
У вас есть что-то типа locate, slocate,mlocate. Если есть то это они индексируют.
Ответ написан
opium
@opium
Просто люблю качественно работать
Посмотреть в этот момент iotop чтобы точно понять что именно грузит
Если нет каких то запросов в бд поверьте вакуум скорее всего он
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы