В 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
Other than firefighters and medics, the first people that went to help are local citizens everywhere from the city bringing food and their own supplies. However, to the #HKGov took all the credits. They called the cops to drive those volunteers away and the “Care Team” from the government takes pictures in front of those supplies that belongs to the volunteers. This is awfully disgusting.
#HongKongFire#宏福苑大火
Bamboo becomes the Scapegoat this time!
Everyone #HongKongers expected the #HKGov would find a scapegoat way before the fire was put out. What surprising was that this time it wasn’t a person, but the bamboo.
The “Mandatory Inspection Scheme” in Hong Kong, initiated by the government is the very reason that caused this tragedy.
To put it short:
1 - Government requires home owners to remake the buildings wall.
2 - Pro-Beijing & construction agencies infiltrated Home Owners Corporation.
3 - Hire construction companies with extremely high price.
4 - all materials and workers not meeting safety standards are purchased from China.
5 - $$ goes to China.
#HongKongFire#宏福苑大火
#英文#港聞
Several #HongKongers returned to Hong Kong from UK got arrested for getting their MPF (Mandatory Provident Fund).
This is just an excuse for the #HKGov to punish #HongKongers for immigrating to the UK. The #UKGov must take action!
🍎保留一點真相、一些堅持:
https://t.me/appledailyhk26
🍎蘋果報料熱線: @Appledailyhk_bot
🍎蘋民不蘋則鳴!2.0
https://t.me/hkerappledaily2