В 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
🌍 Slovenia’s Škocjan Caves feature an underground canyon over 100 meters deep—the largest in Europe. This karst wonder drains rivers directly from the surface into vast hidden chambers. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In Croatia’s Dinaric Alps, karst landscapes hide more than 10,000 known caves and sinkholes. Some systems stretch for over 20 kilometers underground, hosting rare, blind aquatic animals. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The world’s largest cave chamber by volume, Sarawak Chamber in Borneo, is big enough to hold 40 jumbo jets. This massive cavern formed naturally in a karst limestone landscape. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Vietnam’s Phong Nha Cave features tunnels over 44 kilometers long, with underground rivers and rare cave pearls—smooth mineral balls formed by dripping water in the dark. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some karst caves hold unique stone towers called "speleothems," which form slowly from dripping water. These underground forests can grow over tens of thousands of years. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Caves in karst landscapes can grow huge underground chambers thanks to rainwater slowly dissolving limestone rock. Some contain rare crystals and underground rivers hidden from the surface. ✨
#caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Rainwater can carve entire underground labyrinths in karst landscapes, creating vast networks of caves, tunnels, and sinkholes—some so deep and complex that new passages are still being found today. ✨
#caves⚡#karst⚡#erosion⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some of the world’s longest underground rivers are hidden in karst landscapes. These rivers can travel for dozens of kilometers beneath the surface before emerging in springs or caves. ✨
#caves⚡#karst⚡#hydrology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The world’s largest karst region is in southern China, where vast limestone hills, towers, and deep caves house rare species found nowhere else on Earth, including blind fish and giant salamanders. ✨
#karst⚡#caves⚡#limestone⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In Croatia’s Velebit Mountains, karst landscapes feature underground streams that vanish into deep sinkholes, only to reappear as powerful springs many kilometers away. ✨
#karst⚡#caves⚡#springs⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some karst caves contain rare bacteria that feed on mineral rock, creating colorful biofilms and even helping form new cave crystals—making the underground world alive in ways few people expect. ✨
#caves⚡#karst⚡#microbiology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels