Tmpfs Tools Log2ram: Difference between revisions

From WikiMLT
m (Стадий: 4 [Фаза:Авторизиране, Статус:Разработен]; Категория:Linux Server)
m (Стадий: 5 [Фаза:Утвърждаване, Статус:Авторизиран]; Категория:Linux Server)
Line 44: Line 44:
  | Прндл  = Linux Server
  | Прндл  = Linux Server
  | Прндл1 = Linux Desktop
  | Прндл1 = Linux Desktop
  | Стадий = 4
  | Стадий = 5
  | Фаза  = Авторизиране
  | Фаза  = Утвърждаване
  | Статус = Разработен
  | Статус = Авторизиран
  | ИдтПт  = Spas
  | ИдтПт  = Spas
  | РзбПт  = Spas
  | РзбПт  = Spas
  | АвтПт  = {{REVISIONUSER}}
  | АвтПт = Spas
| УтвПт = {{REVISIONUSER}}
  | ИдтДт  = 31.08.2022
  | ИдтДт  = 31.08.2022
  | РзбДт  = 31.08.2022
  | РзбДт  = 31.08.2022
  | АвтДт  = {{Today}}
  | АвтДт = 31.08.2022
| УтвДт = {{Today}}
  | ИдтРв  = [[Special:Permalink/30859|30859]]
  | ИдтРв  = [[Special:Permalink/30859|30859]]
  | РзбРв  = [[Special:Permalink/30867|30867]]
  | РзбРв  = [[Special:Permalink/30867|30867]]
  | АвтРв  = {{REVISIONID}}
  | АвтРв = [[Special:Permalink/30868|30868]]
| УтвРв = {{REVISIONID}}
}}
}}
</div>
</div>
</noinclude>
</noinclude>

Revision as of 12:51, 31 August 2022

Prepa­ra­tion

Iden­ti­fy which di­rec­to­ries has high I/O rate by the fol­low­ing com­mand.

sudo watch -d -n 1 "find /var -type f -size +80k -mmin -10 -printf '%-30s \t %t %p\n'"

Check the cur­rent size of the iden­ti­fied di­rec­to­ries.

du -hs /var/log

Take a sta­tis­tic for the av­er­age disk write per minute be­fore the set­up.

iostat -h /dev/nvme0n1 -d 60

In­stall log2ram

echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ bullseye main" | sudo tee /etc/apt/sources.list.d/azlux.list
sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg  https://azlux.fr/repo.gpg
sudo apt update
sudo apt install log2ram

Set­up log2ram

sudo nano /etc/log2ram.conf
SIZE=2G
MAIL=true
PATH_DISK="/var/log"
ZL2R=false
COMP_ALG=lz4
LOG_DISK_SIZE=100M

Mod­i­fy the de­fault sys­temd timer unit, if you want to log more or less fre­quent­ly than one time per day.

sudo systemctl edit log2ram-daily.timer

Re­boot the sys­tem. Af­ter the re­boot check does it work­ing and use the io­stat com­mand to take a new sta­tis­tic.

Ref­er­ences