Is there any tool (not from system ^1) that I could put in RAM disk and on normal disk. Run both and see the outrageous speed?
Some kind of tool, which will print me Read/Write in MBs?

^1 - Not from system, because I want to see how independant programs are running. That know almost nothing about their environment.

Dani AI

Generated

Short, practical answer that follows up on and : put the same tiny benchmark binary in both places and have it do a large sequential write and a large sequential read — that will show the raw user-space throughput you care about. Be aware of two things up front: tmpfs (the usual RAM-disk) lives in the kernel pagecache (not a block device), and it does not support O_DIRECT, so tests that rely on direct I/O behave differently on tmpfs vs block devices. (docs.kernel.org)

Quick recipes (safe, repeatable):

Mount a tmpfs:

sudo mount -t tmpfs -o size=2G tmpfs /mnt/ramdisk

Write test with dd (ramdisk):

dd if=/dev/zero of=/mnt/ramdisk/testfile bs=1M count=1024 status=progress

Write test with dd (SSD — bypass pagecache where possible):

sudo dd if=/dev/zero of=/mnt/ssd/testfile bs=1M count=1024 oflag=direct conv=fdatasync status=progress

Notes and troubleshooting:

  • oflag=direct / O_DIRECT avoids the pagecache but may fail or require alignment on some filesystems; see dd docs for flags/limits. (gnu.org)
  • For read tests drop caches after a sync: sync && sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'. Use this only for testing — it’s non-destructive but can hurt performance while caches repopulate. (docs.kernel.org)
  • For robust, repeatable measurements use fio: run the same job with direct=1 on the block device and direct=0 on tmpfs (fio reports MB/s and latencies). Example joblines below. (manpages.debian.org)
fio --name=dev-write --filename=/mnt/ssd/testfile --size=1G --bs=1M --rw=write --direct=1 --ioengine=libaio --iodepth=16
fio --name=ram-write --filename=/mnt/ramdisk/testfile --size=1G --bs=1M --rw=write --direct=0 --ioengine=sync

Final cautions: don’t run heavy tests on production mounts, avoid overwriting real devices, and remember tmpfs vs a block ramdisk (/dev/ram*) behave differently — use brd if you need a block-device backed RAM disk. The above gives an independent binary/benchmark approach that demonstrates whether your RAM disk is behaving “outrageously” faster.

Recommended Answers

All 2 Replies

Hello,

No matter what you do you are going to have to interact with the system in order to observe the activity. For Linux there is a great tool called sysstat which takes snapshots of the system activity peroiditacally and then lets you compile the reports later using sar.

http://www.thegeekstuff.com/2011/03/sar-examples/

I don't think you understood what I meant. I meant to check whether RAM Disk is working with such speed as it is supposed to be (faster than SSD). I did not meant to check system statistics.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.