1

I found my df command says the following:

$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
udev            31428656        0  31428656   0% /dev
tmpfs            6288016     9136   6278880   1% /run
/dev/xvda1      60923900 21887760  39019756  36% /
tmpfs           31440072        0  31440072   0% /dev/shm
tmpfs               5120        0      5120   0% /run/lock
tmpfs           31440072        0  31440072   0% /sys/fs/cgroup
tmpfs            6288016        0   6288016   0% /run/user/1000

Is any of tmpfs a ramdrive? Can I just use /dev/shm for my program temp-file storage? Is this ramdrive (very fast)?

0

You could test the speed of the /dev/shm path by dd'ing some data into it:

[ec2-user@ip-x-x-x-x ~]$ dd if=/dev/random of=/dev/shm/test bs=1 count=1M
22+1048554 records in
22+1048554 records out
7514873 bytes (7.5 MB) copied, 89.3415 s, 84.1 kB/s
  • I wasn't able to see the end of this command. – Dims Aug 2 '17 at 14:48
  • Do you mean the end of the dd command? or the result in your instance? – hoss Aug 2 '17 at 15:12
  • I ran command and it ran forever. – Dims Aug 2 '17 at 15:29
  • exactly this command dd if=/dev/random of=/dev/shm/test bs=1M count=1024on my instance runs for 0.4 seconds creating a /dev/shm/test that is 37k in size – hoss Aug 2 '17 at 15:34
  • Doesn't bs=1M count=1024 imply 1GB in total? – Dims Aug 2 '17 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.