В 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
🪐 Near the center of the Small Magellanic Cloud, scientists have discovered a magnetar called SXP 1062 with a magnetic field so strong it can reshape atoms and trigger intense X-ray outbursts. Magnetars are a rare kind of neutron star—ultra-dense remnants of exploded massive stars—whose magnetic fields are trillions of times stronger than Earth's and can even change the properties of empty space around them, making these cosmic magnets among the universe's most extreme phenomena. ✨
#magnetars⚡#neutronstars⚡#spacefacts⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The star VY Canis Majoris, located about 3,900 light-years from Earth, is one of the largest known stars in the universe—so huge that if placed at the center of our solar system, its surface would reach beyond the orbit of Jupiter. This red hypergiant loses mass at an incredible rate, creating vast clouds of dust and gas that make it appear as a dim, shifting patch in telescopes rather than a sharp point of light. ✨
#unusualstars⚡#hypergiants⚡#spacefacts⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In the spiral galaxy Messier 81, astronomers use precise observations of variable stars called Cepheids to confirm that light travels at a constant speed—299,792 kilometers per second—across millions of light-years. By timing the changes in these stars' brightness, scientists can measure vast intergalactic distances, showing that the universal speed limit of light holds true even when crossing the immense gulf between galaxies. ✨
#speedoflight⚡#Messier81⚡#spacefacts⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
The Moon takes about 29.5 Earth days to go from one sunrise to the next. Daylight lasts around 14.75 days, and night also lasts about 14.75 days. This long day and night happen because the Moon spins slowly and moves around Earth at the same time. We always see the same side of the Moon because of this. 🌕🌑
[Read more]
@googlefactss#Moon#LunarDay#SpaceFacts#Astronomy
The 1967 Outer Space Treaty says no country can own the Moon, but rules about mining are still unclear. Working on the Moon could also be dangerous for human health.
The Moon has water ice and rare metals that could help future space missions. But mining the Moon will damage its surface and spread potentially harmful dust. 🌕🚀
[Read more]
#MoonMining#SpaceLaw#OuterSpaceTreaty#SpaceFacts@googlefactss
During Apollo 10, a piece of poop floated inside the spaceship. The astronauts al denied it was theirs. In zero gravity, everything floats. 🚀💩
@googlefactss
#Apollo10#SpaceFacts#ZeroGravity#Astronauts#SpaceHistory
Pluto is slightly bigger than Russia.
Pluto has a surface area of about 17.65 million km².
Russia has an area of about 17.1 million km².
Some sources say otherwise because of old measurements or rounding.
Those sources are wrong.
🪐🌍📏
[Source 1]
[Source 2]
@googlefactss
#Pluto#Russia#SpaceFacts#Geography#NASA#Science#planet#dwarfplanet