I was looking into cgroup blkio subsystem bandwidth limits "read_bps_device" and "write_bps_device" but they seem to require the major and minor number of your block device that you want to throttle access to.

Is there any way to achieve a similar bandwidth limit to the in-memory tmpfs ramdisk?

UPDATE: I found a roundabout hacky way of accomplishing this. I first nfs export the ramdisk mount. Then nfs mount it over loopback on the same machine. I then use linux network traffic shaping to set bandwidth limits. This seems to provide what I need. I'm in the process of performing some measurements to see the penalty this hideous layering entails. I'll update info on that in a few days.

Thanks for the info on the major/minor number of the ramdisk. But cgroups blkio subsystem doesn't seem to allow throttling for unnamed devices. echo "0:32 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.write_bps_device gave me an "write error: Invalid argument". May be there is a another way that somebody knows of.
– weirdbluelightsNov 13 '14 at 14:57

Ah sorry, didn't know that. Out of curiosity, what's the goal in shaping tmpfs bandwidth? Just to make room for other work on the FSB or something?
– BratchleyNov 13 '14 at 18:38

This is for a simulation study for a course project. The goal is to plot an application's performance against a large range of different write/read bandwidths.
– weirdbluelightsNov 14 '14 at 16:17