0

I want to read and write to a ramdisk on OpenSolaris for performance testing purposes. The tests would be aimed at network transmission and I want to rule out disk performance. I set up the ramdisk on the NFS server, machine A, with

mkfile -nv 1000m  `pwd`/ramdisk

on a directory that was mounted via NFS onto machine B. Reading the ramdisk went fine, but writing to it, just overwrote the file. I then setup a ramdisk with

ramdiskadm -a ramdisk1 1000m

which I can write to fine but I can't access over NFS. The ramdisk is put on /dev/ramdisk which is a link to /devices/pseudo I added /devices/pseudo to /etc/dfs/sharetab and mounted it on machine B without error, but the contents of the directory on machine B are emtpy.

Kyle Hailey
  • 275
  • 3
  • 11
  • I see you added a ramdisk block device with `ramdiskadm`, but did you format it with a file system, then export the file system? You can't export block devices over NFS (NFS is the Network *File System*, as in not for block devices, that's what protocols like iSCSI, ATAoE, or FCoE are for). – Chris S Jul 01 '11 at 01:58

2 Answers2

1

Here is the high-level recipe for what you want to do:

  1. Create ramdisk device (ramdiskadm)
  2. Format ramdisk device with a filesystem (newfs or zpool create)
  3. Mount ramdisk device on a mount point (mount, or automatically for ZFS)
  4. Export that mount point through NFS (man export fs, or zfs set sharenfs=on)
  5. Profit!

mkfile doesn't create ramdisks, only files on some storage area. Since you want to test performance I don't see how it would help.

gtirloni
  • 5,746
  • 3
  • 25
  • 52
  • awesome thanks. With the steps outlined above I was able to google more precisely and I turned up this link http://learnbyblogging.com/?p=269 which gave more detail – Kyle Hailey Jul 05 '11 at 21:06
  • 1
    PS steps I took, on OpenSolaris NFS server: `ramdiskadm -a ramdisk1 1000m` `newfs /dev/rramdisk/ramdisk1` `mkdir /ramdisk` `mount /dev/ramdisk/ramdisk1 /ramdisk` `share -F nfs -o rw /ramdisk` `chmod 777 /ramdisk` On client (LINUX in this case) : `mkdir /ramdisk` `mount -t nfs -o 'rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,timeo=600' server_machine:/ramdisk /ramdisk ` Now, on the client I can read and write to the ramdisk and avoid the disk speed issues: `time dd if=/ramdisk/toto of=/dev/null bs=1024k count=800 838860800 bytes (839 MB) copied, 7.74495 seconds, 108 MB/s` – Kyle Hailey Jul 06 '11 at 17:14
0

A much simpler solution: (thanks to Adam Leventhal for this tidbit)

On Server

 share -F nfs -o rw /tmp

On client:

   mkdir /tmpnfs
   mount -o vers=4,rsize=32768,wsize=32768 server:/tmp  /tmpnfs

works like an in memory file system.

Kyle Hailey
  • 275
  • 3
  • 11