Monday, November 01, 2010

Measuring the scalibility of applications on CPU cores

Often we may be required to access the scalability of the application i.e. how well the application behaves with the increase in number of processors, memory, network bandwidth etc available to it.

Traditionally for example we may have done this by running on a 2 core machine and then run the same application on a 4 core machine with roughly same processor speed and same OS version.

But this method does not give a reliable estimate of scalability as there is lot of other parameters which change when we move between to physical machines.


We can use a muti-chip machine to access the scalability of an application. E.g. on a 2 chip Quad core machine (total 8 cores) we can test the application scalability on a single chip first (4 cores), by disable the all cores on other chip and then test the performance again on both the chips by enabling the already disabled cores i.e on all 8 cores.


Invoke the following commands through “root” user

To disable the cpu core:
echo -n "0">/sys/devices/system/cpu/cpu1/online

To enable the cpu cores use
echo -n "1">/sys/devices/system/cpu/cpu1/online


This way we can get to know how well the application scales using a single hardware box.

However we need to take care of things like which CPU cores to be disabled and which not, by knowing the processor layout of the hardware box under consideration which we catch up next time.