tmpfs vs. ext4 ramdisk
Solution 1
For many file operations, they probably have approximately the same speed. If you have journaling turned on for the ext4 filesystem though, that might slow things down.
However, the main benefit of tmpfs is that it only uses as much RAM (or swap) as is needed to store the files. In contrast, a 500MB ramdisk will use that much RAM whether it is 10% full or 100% full.
Solution 2
tmpfs of course. It also avoids having to preallocate a fixed size of ram. One common disk benchmark is bonnie++.
Related videos on Youtube
thwd
I make stuff that grows on sockets. Concurrency is my main field of interest. I prefer expressions over statements, breaking abstractions in favor of clarity.
Updated on September 18, 2022Comments
-
thwd over 1 year
I would like to know which of both is faster; a tmpfs or a ext4 ramdisk.
If someone knows a good way to benchmark disk perfomance on ubuntu, I will gladly do the test myself and post the results.
-
kumako almost 13 yearsAlso, ext4fs implies journaling is turned on, which would add overhead to whatever was written.
-
James Henstridge almost 13 yearsThat's not strictly true. It is possible to create
ext4
file systems without a journal. They added that feature to make it a possible upgrade path for bothext2
andext3
users.