В 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
🌎 Glowing deep-sea animals like the comb jellyfish and dragonfish create their own light using bioluminescence. This adaptation helps them hunt, attract mates, or avoid predators in pitch-black ocean depths. Some dragonfish possess "invisible" red bioluminescence, seen only by their own kind, for stealthy communication. ✨
#ocean⚡#animals⚡#bioluminescence
👉subscribe Interesting Planet
👉more Channels
🌍 The Waitomo Glowworm Caves in New Zealand are famous for thousands of tiny insects that light up the darkness, creating a galaxy-like effect in this unique karst underground world. ✨
#caves⚡#karst⚡#bioluminescence⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 Shrouded in darkness, the “midnight zone” of the ocean lies below 1,000 meters, where sunlight can’t reach and pressure crushes like a dozen elephants. Creatures here glow with bioluminescence and withstand freezing cold, revealing how life adapts to our planet’s most mysterious depths. ✨
#ocean⚡#bioluminescence⚡#deepsea
👉subscribe Interesting Planet
🌎 Lightning bugs, or fireflies, create their glow through a special enzyme called luciferase. This reaction produces cold light, wasting almost no energy as heat—a marvel of natural engineering for nighttime signaling. ✨
#bioluminescence⚡#insects⚡#nature
👉subscribe Interesting Planet
🌎 Glowing tides known as bioluminescent bays light up in places like Puerto Rico. Microorganisms called dinoflagellates produce blue-green light when stirred by waves or movement. The brightest, Mosquito Bay, can host up to 700,000 glowing organisms in just one liter of water. ✨
#bioluminescence⚡#ocean⚡#phenomenon
👉subscribe Interesting Planet
👉more Channels
🌍 Some coasts shine with glowing “blue waves” at night, caused by tiny plankton called dinoflagellates emitting light when disturbed—a dazzling phenomenon known as marine bioluminescence. ✨
#seas⚡#coastline⚡#bioluminescence⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 Glowing waves known as “sea sparkle” can light up coastlines at night. This effect is caused by bioluminescent plankton emitting blue light when disturbed. Some blooms stretch for kilometers and are most often seen in warm coastal waters. ✨
#bioluminescence⚡#ocean⚡#plankton
👉subscribe Interesting Planet
👉more Channels
🌎 Glowing waves sometimes light up the ocean at night thanks to bioluminescent plankton. These tiny marine organisms emit blue light when disturbed, turning shorelines into breathtaking, natural light shows. ✨
#ocean⚡#bioluminescence⚡#plankton
👉subscribe Interesting Planet
🌎 The vampire squid thrives in the ocean’s dark depths by using bioluminescent light organs to confuse predators. Its name comes from its cloak-like webbed arms, not from blood-drinking. ✨
#ocean⚡#cephalopod⚡#bioluminescence
👉subscribe Interesting Planet
🌎 In the Mediterranean Sea, the bearded fireworm boasts bristly, glowing spines that can cause a painful sting. This marine worm’s bioluminescence warns predators while its venomous bristles deter unwelcome touches—a perfect example of nature’s flashy, double-edged defense system. ✨
#fireworm⚡#bioluminescence⚡#ocean
👉subscribe Interesting Planet
🌎 Somewhere in the world’s oceans, the “milky sea” phenomenon can make water glow bright blue for up to several days. Caused by massive colonies of bioluminescent bacteria, these rare glowing patches can cover areas larger than 15,000 square kilometers—visible even from space. ✨
#ocean⚡#mysteries⚡#bioluminescence⚡#bacteria
👉subscribe Interesting Planet