В 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
🌍 Time zones are not always set by longitude—some countries, like China, use one time zone nationwide despite spanning five natural zones, affecting daily life from sunrise to sunset across vast distances. ✨
#timezones⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some time zones offset by just 15 or 30 minutes exist, like India’s UTC+5:30 and Newfoundland’s UTC−3:30. These unusual divisions reflect local choices instead of sticking to whole hours. ✨
#timezones⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some countries adjust their time zones by just a single minute. Venezuela, for example, once set its clocks to UTC−4:30, then shifted to UTC−4:00 for efficiency, creating rare minute-level changes. ✨
#timezone⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Spain's Canary Islands, though just west of Africa, use the same time zone as mainland Spain. Their clocks are always one hour behind the rest of the country, bridging continents by time. ✨
#timezone⚡#islands⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some Antarctic research stations use New Zealand’s time zone, while others choose the time of their home country. This means clocks at the South Pole can show different times—sometimes up to 12 hours apart. ✨
#timezones⚡#antarctica⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Nepal is one of the few countries that advances its clocks by 45 minutes from standard time, using a unique offset of UTC+5:45 to better match local solar time. ✨
#timezones⚡#Nepal⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels