Re: swap
Добавлено: 15 ноя 2021, 13:25
Дальше эта тема, не имеющая прямого отношения к swap, разрабатывается здесь: RAM: занятая, свободная, доступная
Форум по операционной системе GNU/Linux и свободному программному обеспечению
http://linux-ru.ru:80/
Дальше эта тема, не имеющая прямого отношения к swap, разрабатывается здесь: RAM: занятая, свободная, доступная
Это (своп в файл) становится популярным решением...
Код: Выделить всё
olej@R420:~$ which dphys-swapfile
Код: Выделить всё
olej@R420:~$ aptitude search dphys-swapfile
p dphys-swapfile - автоматическое создание и использование файла подкачки
Код: Выделить всё
root@raspberrypi:~# dphys-swapfile swapoff
Код: Выделить всё
CONF_SWAPSIZE=2048
Код: Выделить всё
root@raspberrypi:/etc# dphys-swapfile setup
Код: Выделить всё
root@raspberrypi:/etc# dphys-swapfile swapon
Пишут - Как настроить пространство подкачки?:
А это значит, что своп можно назначить на USB-флешку! ... когда эпизодически он становится нужен большой - например при больших компиляциях пакетов.Изменить: В Raspbian расположение по умолчанию / var / swap, которое (конечно) находится на SD-карте. Я думаю, что это плохая идея, поэтому я хотел бы отметить, что / etc / dphys-swapfile также может иметь следующую опцию: CONF_SWAPFILE = / media / btsync / swapfile
Код: Выделить всё
olej@raspberrypi:~ $ man dphys-swapfile
...
CONF_SWAPFILE
Set where the swap file should be placed. Defaults to /var/swap. It is unlikely that you will need to change
this, unless you have very strange partitioning, and then you will most likely be using an swap partition any‐
way.
CONF_SWAPSIZE
Set size to this absolute value, in MBytes. Leaving this empty (which is the Default) uses an computed value
as size instead. This is unlikely to ever be needed, unless in some strange diskspace situations. Note, that
swap enabled and size smaller than RAM may causes kernal-internal VM troubles on some kernels/systems.
CONF_SWAPFACTOR
Set size to computed value. Uses this value times RAM size. It so dynamically adapts to RAM size, guarantees
enough swap on large RAM, without going into excess diskspace on small RAM (and disk?) systems. Defaults to 2,
which gives swap size = 2 * RAM size.
CONF_MAXDISK_PCT
Sets the maximal percentage of the remaining disk space which may be used for the swap file. Takes potentially
existing dphys-swapfile swap files into account, i.e. adds their size to the available disk space before cal‐
culating the percentage. Defaults to 50. Set it to the empty string to disable this check.
CONF_MAXSWAP
Set size restriction of maximal computed and absolute(!) values, in MBytes. Defaults to 2048 which was a for‐
mer 32bit kernel limit for the swapfile size and is now a limit to prevent unusually and senselessly big swap
files on systems with a lot of RAM.
...