Dhrystone
-
Unzip: tar -xzvf dhrystone-2.1.tar.gz
Compile: make
. Any errors?
Fix the compilation errors
Why do you think they put those function definition there if they are available in the system?
Run the benchmark: ./gcc_dry2
. Set the number of iterations to 100000000.
Compare the results with the colleague next to you. Are they different?
Run with register variables: ./gcc_dry2reg
. Set the number of iterations to 100000000.
Let's discuss about register variables.
Run the same benchmark in container
CoreMark
-
Unzip: tar -xzvf coremark_v1.0.tgz
Compile: make
Run benchmark: make run
Compare the results with the colleague next to you. Are they different?
Run the same benchmark in a container
lmbench
-
Unzip: tar -xzvf lmbench-3.0-a9.tgz
Compile: make
Run lat_mem_rd: ./bin/x86_64-linux-gnu/lat_mem_rd 250 16 32 64 128 256 512 1024
Guess the cache hierarchy and size.
Run the same in container
Evaluate context switch overhead
run benchmark ./bin/x86_64-linux-gnu/lat_ctx -s 80 2 4 6 8 10 12 14 16 18 20 24 32 48 96
Why do you think the results are so close at the beginning?
Run the same in container
Run lmbench default template
cd scripts
./config-run
with
MB: 100
./results
cd ./results
make
In order to run a benchmark inside a container
lxc-create -n foo -t busybox -f /share/doc/lxc/examples/lxc-no-netns.conf
By default, the container will start a process that will try to get an IP through DHCP. Since the specified config file does does not assign dedicated networking to the container, getting an IP will not work and it will block the container. You must prevent the container from starting this process by deleting the /bin/udhcpc line from /var/lib/lxc/foo/rootfs/etc/init.d/rcS.
* Start and console to the container:
lxc-start -n foo -d; lxc-console -n foo
Copy the benchmark binaries from the host into the container rootfs (/var/lib/lxc/foo/rootfs). This will make them accessible from the container shell (the one started with lxc-console).
Note: you may also need some system utilities in the container (e.g. make). In order to make them available as well, find out where they are on the host (e.g. whereis make) and copy the associated binary in the container (cp /usr/bin/make /var/lib/lxc/foo/rootfs/usr/bin/).
Stop the container
* Destroy the container