В Linux стандартными средствами можно использовать часть оперативной памяти как диск. Для этого требуется указать тип монтирования tmpfs в команде mount
mount -t tmpfs -o size=5G tmpfs /mnt/ram
Теперь путь /mnt/ram можно использовать как обычный каталог. Для чего это может быть нужно?
▫️ Скорость работы с таким каталогом выше чем многие SSD и тем более HDD.
▫️ Если у вас очень быстрый SSD на NVMe M.2 то такой способ особо не прибавит вам скорости, но поможет сохранить ресурс SSD когда требуется обрабатывать очень много мелких файлов и оперативка позволяет выделить нужный объем.
▫️ Оперативка это энергозависимая память, поэтому выключении питания все файлы безвозвратно теряются. Такой "non persistent" каталог гарантирует удаление временных файлов.
Я написал небольшой скрипт для условного теста и сравнения скорости копирования файлов между SSD и RAM.
Вот мои результаты:
Single File Size: 30.0Gb
ssd > ssd: 0:00:12.850 / 2.3Gb/s
sdd > ram: 0:00:06.453 / 4.6Gb/s
ram > ram: 0:00:06.995 / 4.3Gb/s
ram > sdd: 0:00:06.217 / 4.8Gb/s
Dir size: 32.7Gb, File count: 11127
ssd > ssd: 0:00:15.063 / 2.2Gb/s
sdd > ram: 0:00:08.486 / 3.9Gb/s
ram > ram: 0:00:08.032 / 4.1Gb/s
ram > sdd: 0:00:07.026 / 4.7Gb/s
Скрипт для теста ↗️
На моём железе прирост скорости ~2x. Плюс экономия ресурса SSD.
В Windows такой фишки по умолчанию нет, но обязательно найдутся аналогичные решения
#linux#triks
🌎 In the Mariana Trench, the deepest part of the ocean, researchers have found strange microbial life living over 10,900 meters below the surface. These microbes survive by breaking down chemicals from rocks, not sunlight, and help recycle nutrients in this harsh environment. ✨
#ocean⚡#trench⚡#microbes
👉subscribe Interesting Planet
👉more Channels
🌍 Some bacteria and fungi live deep in rocks of the lithosphere, far below where sunlight reaches. These life forms connect the biosphere to Earth's rocky layer in ways once thought impossible. ✨
#lithosphere⚡#biosphere⚡#microbes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth’s spheres aren’t fixed—they overlap at microbe level. Extremophiles, tiny life forms, live deep underground rocks, linking the biosphere to the lithosphere in some of Earth's harshest zones. ✨
#lithosphere⚡#biosphere⚡#microbes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌎 Vibrant hot springs in Yellowstone glow with brilliant colors thanks to heat-loving bacteria called thermophiles. These microbes produce pigments that create beautiful bands of green, yellow, and orange around the steaming pools. ✨
#Yellowstone⚡#microbes⚡#geology
👉subscribe Interesting Planet
🌎 The salt-loving halophiles of California’s pink Lake Hillier thrive where few others survive. These tiny microbes give the lake its vivid color by producing pigments that protect them from extreme salt and sunlight—turning the water a bubblegum pink! ✨
#microbes⚡#pigment⚡#lakes
👉subscribe Interesting Planet
After death, human microbes survive in soil and help break down the body. They work with soil microbes to speed up decomposition and recycle nitrogen, which plants need to grow. These microbes can live in the soil for months or years, turning dead bodies into nutrients that support new life. 🌱🦠💀
[Source]
@googlefactss#Decomposition#Microbes#Soil#NitrogenCycle#Ecosystem