rychlovka – jednorazovy swap
Vcera som instaloval OraDB a check na konci mi vypisal nedostatocnu swap – o 6MB (!!!). Uz som sa videl v mrakotach, ako to cele ukoncim a prostrednictvom parted budem presuvat oddiely na disku, ale je aj ina cesta, ako instalator osalit a dodatocne mu podsunut nejaku “fakeswap” naviac.
1. prazdny subor
dd if=/dev/zero of=/fakeswap bs 512 count 100
2. subor bude pridany do swapu
mkswap /fakeswap
swapon /fakeswap
dd if=/dev/zero of=/fakeswap bs=512 count=100
syntax error
20 Jan 18 at 9:37
#!/bin/bash
free_mem=”$(free | grep ‘Mem:’ | awk ‘{print $7}’)”
used_swap=”$(free | grep ‘Swap:’ | awk ‘{print $3}’)”
echo -e “Free memory:\t$free_mem kB ($((free_mem / 1024)) MiB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MiB)”
if [[ $used_swap -eq 0 ]]; then
echo “Congratulations! No swap is in use.”
elif [[ $used_swap -lt $free_mem ]]; then
echo “Freeing swap…”
sudo swapoff -a
sudo swapon -a
else
echo “Not enough free memory. Exiting.”
exit 1
fi
Eliah Kagan
15 Mar 18 at 13:40
https://leizhilong.github.io/blog/2018-11-12-case-study-swapoff-cannot-allocate-memory/
dobo
30 Oct 19 at 3:38
Co je to swappiness masinky a jak sa to meni
https://www.howtoforge.com/tutorial/linux-swappiness/
dobo
28 Nov 19 at 8:45
pidof memcached —> da PID procesu, ktory swapuje
awk ‘/VmSwap/{print $2 ” ” $3}’ /proc/PID/status —> info o pameti toho procesu
dobo
4 Sep 20 at 10:33
for file in /proc/*/status ; do awk ‘/VmSwap|Name/{printf $2 ” ” $3}END{ print “”}’ $file; done | sort -k 2 -n -r | less
sorting all processes according swap use
Nikki Sixx
4 Sep 20 at 10:36
Hm. Zaujímavou a prekvapivou fičúrou Elasticsearchu je to, že sa defaultne vypína swap na nodoch. Je totižto z hľadiska stability a výkonu výhodnejšie, keď padne celý node distribuovaného elasticu, než aby pameť spadla do swapu…
https://www.elastic.co/guide/en/elasticsearch/reference/7.8/setup-configuration-memory.html
dobo
18 Nov 20 at 18:43