Tmpfs Tools Log2ram: Difference between revisions
From WikiMLT
m Text replacement - "I/O Monitoring and Analyze" to "Linux I/O Monitoring and Analyze" |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{ContentArticleHeader/Linux_Server|toc=off}}{{ContentArticleHeader/Linux_Desktop}}</noinclude> | <noinclude>{{ContentArticleHeader/Linux_Server|toc=off}}{{ContentArticleHeader/Linux_Desktop}}</noinclude> | ||
{{collapse/begin}} | |||
== | == Identify the Problem == | ||
Identify which directories has high [[I/O Monitoring and Analyze|I/O rate]] by the following command.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | {{collapse/div|#Preparation details}} | ||
Identify which directories has high [[Linux I/O Monitoring and Analyze|I/O rate]] by the following command.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | |||
sudo watch -d -n 1 "find /var -type f -size +80k -mmin -10 -printf '%-30s \t %t %p\n'" | sudo watch -d -n 1 "find /var -type f -size +80k -mmin -10 -printf '%-30s \t %t %p\n'" | ||
</syntaxhighlight>Check the current size of the identified directories.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | </syntaxhighlight>Check the current size of the identified directories.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | ||
du -hs /var/log | du -hs /var/log | ||
</syntaxhighlight>Take a statistic for the average disk write per minute before the setup.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | </syntaxhighlight>Take a statistic for the average disk write per minute before the setup.<syntaxhighlight lang="shell" line="1" class="force-prompt"> | ||
iostat -h /dev/nvme0n1 -d 60 | iostat -h /dev/nvme0n1 -d 60 -t | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{collapse/end}} | |||
== Install log2ram == | == Install log2ram == | ||
<syntaxhighlight lang="shell" line="1" class="force-prompt"> | <syntaxhighlight lang="shell" line="1" class="force-prompt"> | ||
Line 36: | Line 37: | ||
* GitHub: [https://github.com/azlux/log2ram log2ram] | * GitHub: [https://github.com/azlux/log2ram log2ram] | ||
* Linuxhowto.net: [https://www.linuxhowto.net/how-to-write-log-files-in-ram-using-log2ram-in-linux/ Write Log Files In RAM Using Log2ram In Linux]<br /> | * Linuxhowto.net: [https://www.linuxhowto.net/how-to-write-log-files-in-ram-using-log2ram-in-linux/ Write Log Files In RAM Using Log2ram In Linux]<br /> | ||
Line 44: | Line 44: | ||
| Прндл = Linux Server | | Прндл = Linux Server | ||
| Прндл1 = Linux Desktop | | Прндл1 = Linux Desktop | ||
| Стадий = | | Стадий = 6 | ||
| Фаза = | | Фаза = Утвърждаване | ||
| Статус = | | Статус = Утвърден | ||
| ИдтПт = Spas | | ИдтПт = Spas | ||
| РзбПт = {{REVISIONUSER}} | | РзбПт = Spas | ||
| АвтПт = Spas | |||
| УтвПт = {{REVISIONUSER}} | |||
| ИдтДт = 31.08.2022 | | ИдтДт = 31.08.2022 | ||
| РзбДт = {{Today}} | | РзбДт = 31.08.2022 | ||
| АвтДт = 31.08.2022 | |||
| УтвДт = {{Today}} | |||
| ИдтРв = [[Special:Permalink/30859|30859]] | | ИдтРв = [[Special:Permalink/30859|30859]] | ||
| РзбРв = {{REVISIONID}} | | РзбРв = [[Special:Permalink/30867|30867]] | ||
| АвтРв = [[Special:Permalink/30868|30868]] | |||
| УтвРв = {{REVISIONID}} | |||
}} | }} | ||
</div> | </div> | ||
</noinclude> | </noinclude> |
Latest revision as of 09:18, 3 September 2022
Identify the Problem
#Preparation details
sudo watch -d -n 1 "find /var -type f -size +80k -mmin -10 -printf '%-30s \t %t %p\n'"
du -hs /var/log
iostat -h /dev/nvme0n1 -d 60 -t
Install 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
Setup log2ram
sudo nano /etc/log2ram.conf
SIZE=2G
MAIL=true
PATH_DISK="/var/log"
ZL2R=false
COMP_ALG=lz4
LOG_DISK_SIZE=100M
Modify the default systemd timer unit, if you want to log more or less frequently than one time per day.
sudo systemctl edit log2ram-daily.timer
Reboot the system. After the reboot check does it working and use the iostat
command to take a new statistic.
References
- GitHub: log2ram
- Linuxhowto.net: Write Log Files In RAM Using Log2ram In Linux