В 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
🪐 Discovered in 2013, asteroid 2013 TX68 drew attention due to its unpredictable orbit, which allowed it to pass within a few million kilometers of Earth—close enough that its next flyby in 2046 will be closely watched. This space rock is roughly 30 meters wide, similar in size to the Chelyabinsk meteor, and while it's not currently on a collision course, its uncertain path highlights the challenges of tracking smaller, potentially hazardous asteroids. ✨
#asteroids⚡#nearearth⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Asteroid (4660) Nereus is a near-Earth object about 330 meters wide, famous for its frequent close approaches to our planet due to its elongated orbit around the Sun. While it poses no immediate danger, Nereus occasionally comes within just a few million kilometers of Earth, making it one of the more closely watched space rocks for future planetary defense planning. ✨
#asteroids⚡#nearearth⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Asteroid (29075) 1950 DA is one of the most closely monitored potentially hazardous asteroids, as it has a slim chance of impacting Earth in the year 2880. This kilometer-sized space rock spins so fast—completing a rotation every 2.1 hours—that its own gravity barely holds it together, making it a real cosmic oddity among dangerous near-Earth objects. ✨
#asteroids⚡#planetarydefense⚡#spacehazards⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The asteroid (410777) 2009 FD is a near-Earth object roughly 472 meters wide, with an orbit that brings it uncomfortably close to our planet every few decades. Although calculations show it poses no immediate threat, its path is closely watched because even moderate-sized objects like 2009 FD can cause widespread devastation if they ever collide with Earth. ✨
#asteroids⚡#planetarydefense⚡#nearearthobjects⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 In 2013, astronomers tracked asteroid (367943) Duende, a 30-meter-wide space rock that passed just 27,700 kilometers above Earth's surface—closer than many weather satellites. Duende’s near miss was remarkable not only for its proximity, but because it approached from the Sun’s direction, making it hard to spot in advance and highlighting the ongoing challenge of detecting small but potentially hazardous asteroids before they pass close to our planet. ✨
#asteroids⚡#duende⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The asteroid (2011) AG5, classified as a near-Earth object, made headlines because it once had the highest estimated probability of impacting Earth in the 21st century. Thanks to ongoing observations, scientists have refined its path, showing it will safely pass by our planet in 2040, but its close approach—just 1.1 million kilometers away—demonstrates how carefully even modest-sized asteroids must be tracked to protect Earth from unexpected cosmic threats. ✨
#asteroids⚡#nearearthspace⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries