В 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
🪐 The exoplanet TRAPPIST-1c, located about 40 light-years away, is a rocky world baked by its star to temperatures hot enough to melt lead—around 230°C—despite being only slightly larger than Earth. With a tight orbit of just 2.4 days, TRAPPIST-1c endures constant stellar radiation, making its surface a realm of extreme heat and intense space weather unlike anything found on our planet. ✨
#exoplanets⚡#extremes⚡#TRAPPIST1⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 In 2017, astronomers discovered a group of odd, repeating radio signals coming from TRAPPIST-1, an ultracool dwarf star with seven Earth-sized exoplanets just 39 light-years away. While these signals turned out to be natural phenomena related to the star's magnetic activity, TRAPPIST-1 remains one of the most intriguing targets in the search for alien life because several of its planets orbit in the habitable zone, where liquid water could exist. ✨
#aliens⚡#exoplanets⚡#trappist1⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 The James Webb Space Telescope has discovered that the exoplanet TRAPPIST-1b, one of seven planets orbiting the star TRAPPIST-1 about 41 light-years away, has no detectable atmosphere. Webb’s sensitive instruments showed that the planet’s dayside is hotter than expected if it had an atmospheric blanket, suggesting its surface is bare rock—shaping new ideas about the harsh conditions on close-orbiting worlds around small stars. ✨
#exoplanets⚡#trappist1⚡#webb⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In the TRAPPIST-1 system, about 40 light-years away, seven Earth-sized exoplanets orbit a cool, dim star, and at least three of them lie in the star’s “habitable zone”—the region where temperatures might allow liquid water to exist on their surfaces. This cluster of small worlds makes TRAPPIST-1 one of the top real candidates in the search for places where life could exist beyond our solar system. ✨
#TRAPPIST1⚡#exoplanets⚡#habitable⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels