We can get two wins for the price of one.
First off make a new vblade
daph:/# cd /dev/shm/
daph:/dev/shm# qemu-img create -f raw var_tmp 2G
Formatting 'var_tmp', fmt=raw, size=2097152 kB
daph:/dev/shm# ls -l var_tmp
-rw-r--r-- 1 root root 2147483648 2010-04-12 18:55 var_tmp
daph:/dev/shm# du -h var_tmp
0 var_tmp
This gives us a maximum size of 2G but until we use it, it's size is actually 0
By using
# vblade 2 3 eth0 /dev/shm/var_tmp
pid 15913: e2.3, 4194304 sectors O_RDWR
run
# fdisk /dev/etherd/e2.3
and create 1 primary partition covering the disk (or however you want!) surely you know how
In my case
# mke2fs -T small /dev/etherd/e2.3p1
then mount it and importantly bind our memory based /tmp/var in place
mount /dev/etherd/e2.3p1 /mnt/boof
mkdir -p /mnt/boof/var/tmp
mount --bind /mnt/boof/var/tmp /var/tmp
emerge something
and emerge will use the vblade for tmp storage
of course Linux laughs in your face because binds are root level so once it's done, it's done, you can't pop to another window and keep looking in /var/tmp on your local disk, that's gone until you unbind it.
Of course you don't need to be using shm for the vblade you can use disk files or partitions. With a few machines donating RAM you're probably able to saturate your Gbit, with this new machine I'll finally be able to make some measurements.
% time dd if=/dev/zero of=/dev/null count=2000000 bs=512
1024000000 bytes (1.0 GB) copied, 1.22008 s, 839 MB/s
% time dd if=/dev/zero of=/mnt/boof/zeros count=2000000 bs=512
1024000000 bytes (1.0 GB) copied, 80.0547 s, 12.8 MB/s
% time dd if=/mnt/boof/zeros of=/dev/null count=2000000 bs=512
1024000000 bytes (1.0 GB) copied, 1.66719 s, 614 MB/s
This last one is pretty astonishing, I think it needs testing without zeros or something
No comments:
Post a Comment