В 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
Habits we need to Avoid which drain our energy... 🙅🏼♂️❌
× Gossiping.
× Overthinking.
× Over stressed.
× Sleeping in late.
× Having a poor diet.
× Holding on to the past.
× Complaining all the time.
× Taking things personally.
× Fueling drama in the mind.
× Always checking social media.
#lifeLesson
━━━━━━━━━━━━━━━
Join us @OreosSpace🥀
THINGS THAT CAN CHANGE YOUR LIFE FOR THE BETTER
• Stop complaining and appreciate how lucky you are everyday.
• Embrace loneliness and renew yourself in the process.
• Say goodbye to the people that don't bring positive energy in your life.
• Set limit to the time you spend on the internet.
• Pick one skill and put all your effort into developing it.
• Commit to the goals you set and never look back.
• Exercise everyday to boost your mood.
• Learn from every mistake you make.
#lifelesson
@OreosSpace
🌿Suffering and Desire🦋
Buddha taught that there is suffering in this world, it is inevitable, and the root cause of suffering is mainly the desires we feel.
We want something, always, and feel miserable when we don't get it.
Stoicism teaches us to live in accordance with nature and to accept that suffering will manifest in different ways in our lives.
#Tuesday#Day-2
#Biographies#Inspiration
#lifelesson#Thought
🤔 Did something bad happen to you when you weren’t expecting it? You’re not going to put yourself in that situation again, are you? 😄 Learn this useful English expression that summarises this life lesson. Give this post a like, and ✍️ put your answer in the comments! Do you have a similar expression in your language?
🤩 Click on the link in our bio to learn some modern idioms!
Images: Getty
#learnenglish#advice#idioms#esl#efl#vocabulary#englishclass#phrases#expressions#oncebitten#britishenglish#lifelesson#inspiration#slang