В 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
Fashion doesn’t have to cost the earth! This International Day of Zero Waste puts the spotlight on fashion and textiles. Here’s how we can do our part to reduce textile waste:
✅ 𝗥𝗘𝗨𝗦𝗘 worn-out clothes for other purposes e.g. pillow covers, cleaning rags
✅ 𝗥𝗘𝗗𝗨𝗖𝗘 impulse purchases by checking if you already have something similar
✅ 𝗗𝗢𝗡𝗔𝗧𝗘 outgrown clothing
#TowardsZeroWaste
It’s the International Day of Zero Waste! If you’ve yet to embark on the journey #TowardsZeroWaste, here’s your sign to get started: go.gov.sg/towards-zero-waste
It’s World Tuna Day! If you have leftover canned tuna (or any other canned fish), be sure to store it properly in a sealed container. This extends the lifespan of your leftovers and minimises food waste!
#TowardsZeroWaste
It’s the first International Day of Zero Waste, and a good opportunity to take stock of how far we’ve come in our journey #TowardsZeroWaste.
If you’ve yet to get started on this journey, now’s the time! Tips at www.nea.gov.sg/our-services/towards-zero-waste
Spring cleaning and getting rid of unwanted items, such as clothes or household items? If they are still in good condition, consider donating them!
Discover what you can do with items that you no longer need here: go.gov.sg/nea-donate
#TowardsZeroWaste
Have you recycled your used PMD yet? From now until June 2021, you’ll be able to do so at collection points in residential areas. Check out where and when at https://www.kgs.com.sg/pmd-collection-program
Aside from retrieving precious materials from its li-ion batteries, the metal parts can also be used in the manufacturing of other products. #TowardsZeroWaste
Not sure what to do with your used Personal Mobility Device (PMD)? Recycle it! Aside from retrieving precious materials from its li-ion batteries, the metal parts can also be used in the manufacturing of other products.
To make recycling PMDs more convenient, we are collaborating with KGS Pte Ltd to set up collection points at residential areas until June 2021. Check out where and when at https://www.kgs.com.sg/pmd-collection-program#TowardsZeroWaste
Our actions today impact our world tomorrow, and it is up to us to make it a better one. Together, let’s work #TowardsZeroWaste and build a #SustainableSG.
If you’re still not sure how to start, check out the activities and challenges at www.gogreen.gov.sg/programmes/
By reducing waste and recycling right, we help protect our environment and extend landfill capacity.
Let’s safeguard, nurture, and cherish our environment for future generations. 🌱
#SayYESToWasteLess#TowardsZeroWaste
As the festive clock ticks, let's not forget the ticking dates in our pantry!
Place items nearing their expiry dates at the front of your shelves. This helps you remember to use them soon and reduce food wastage.
#SayYEStoWasteLess#TowardsZeroWaste
This holiday season, let's embrace moderation over mountains of food!
Avoid waste! Choose portions that are just right and delight in every bite. 😋
#SayYEStoWasteLess#TowardsZeroWaste
Have leftover items from your Lunar New Year festivities?
Be sure to place food that is near expiry within view, and practise the “First to Expire, First Out” approach when organising your home pantry!
#SayYEStoWasteLess#TowardsZeroWaste