Archive for February, 2010

Creating a new linux bond device without restarting (anything)

Thursday, February 25th, 2010

Just in case you ever want to do this…

echo +[bondname] > /sys/class/net/bonding_masters

Thecus 8800 sequential I/O performance

Wednesday, February 24th, 2010

For those who are interested, I ran a handful of i/o tests over a Thecus 8800 over the last couple of days and have some graphs to prove it!

All tests were run using iSCSI over a single GigE link.

Sequential Read

#!/bin/bash
 
DISK=/dev/sda
BS="1 2 4 8 16 32 64 128 256 512 1024 2048 4096"
 
for I in $BS; do
	echo "--- BEGIN BS=$I ---"
	dd if=$DISK of=/dev/null bs=${I}k \
		count=$(echo "21474836480/$I/1024" | bc)
	echo "---  END BS=$I  ---"
done

Thecus 8800 Sequential Read Performance

Sequential Write

#!/bin/bash
 
DISK=/dev/sda
BS="1 2 4 8 16 32 64 128 256 512 1024 2048 4096"
 
for I in $BS; do
	echo "--- BEGIN BS=$I ---"
	dd if=/dev/zero of=$DISK bs=${I}k \
		count=$(echo "21474836480/$I/1024" | bc)
	echo "---  END BS=$I  ---"
done

Thecus 8800 Sequential Write Performance

Oddly the sequential read performance is worse than the sequential write. I have a ticket open with Thecus regarding this.

We have a Thecus 8800PRO coming at some point soon, which I am planning to play with using 10GigE. We’ll see how she does there.

A more efficient (and customizable) way to eat RAM

Tuesday, February 23rd, 2010

Tom White┬áhas kindly pointed out that this isn’t the most efficient way of eating RAM; mainly as the Linux kernel doesn’t actually allocate a physical page when you malloc a block of RAM, merely create a mapping in the virtual address table.

The physical page is only actually allocated when the block of RAM you have allocated is used. Below is the new and improved tool:

eatRam.c

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
#define ALLOC_SIZE 1024
 
int main(int argc, char **argv) {
 
        int i;
        void *ptr;
 
        if (argc == 1) return 1;
 
        i = 0;
 
        while ((atoi(argv[1]) == 0) || (i < atoi(argv[1]))) {
                ptr = malloc(ALLOC_SIZE);
                memset(ptr, 0, ALLOC_SIZE);
                i++;
        }
        printf("Allocated. Press ENTER to terminate...");
        fgetc(stdin);
        return 0;
}

Compile:

gcc -o eatRam eatRam.c

Usage:

./eatRam [ 0 | (amount to use in KB) ]

You can also specify 0 to make it use all available RAM.

Eating all available memory

Tuesday, February 23rd, 2010

I was asked today by a colleague for a simple way to eat all the ram on a server, here’s a quick and easy way to do it:

eatRam.c:

#include <stdlib.h>
 
int main() {
        for (;;) malloc(1024);
 
        return 0;
}

Compile with:

gcc -o eatRam eatRam.c

And run and you’re good to go. Be careful where you run this as it is rather good at what it does.

Happy Cat has run out of Happy!

Wednesday, February 10th, 2010

Happy Cat has run out of Happy

No Posts to Display…

Sunday, February 7th, 2010

No Posts to Display

Either you’re all boring and doing nothing or Facebook is broken!

Motivation: Death in Three Lights

Tuesday, February 2nd, 2010

Death in Three Lights