Saturday, December 5, 2009

Aide mémoire sysbench

Afin d'avoir de la matière pour comparer des pommes et des oranges, il est bien pratique d'avoir un petit benchmark sous le coude. Je vous présente donc sysbench, présent dans l'archive Debian/Ubuntu et dans les ports/pkgsrc BSD. Sysbench permet des comparaisons rapides et de vérifier que les cores/cpus qu'on vous annonce avec fanfare servent à quelque chose. Nous mesurons ici le temps de calcul des 10 000 premiers nombres premiers.

Machine 1:
grep "model name" /proc/cpuinfo # deux cpu/cores
model name : AMD Athlon(tm) Dual Core Processor 5400B
model name : AMD Athlon(tm) Dual Core Processor 5400B

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done

threads: 1 total time: 36.2429s
threads: 2 total time: 18.1774s
threads: 3 total time: 18.5373s
threads: 4 total time: 18.1599s


Machine 2 :
grep "model name" /proc/cpuinfo
model name : Dual-Core AMD Opteron(tm) Processor 2220
model name : Dual-Core AMD Opteron(tm) Processor 2220
model name : Dual-Core AMD Opteron(tm) Processor 2220
model name : Dual-Core AMD Opteron(tm) Processor 2220


for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done

threads: 1 total time: 35.7832s
threads: 2 total time: 17.8263s
threads: 3 total time: 12.0110s
threads: 4 total time: 11.9021s

Conclusion:

Le passage de 1 à 4 cpus permet bien des gains de performance pour une application de calcul, mais ceci de manière non linéaire. Pourquoi ? De mémoire, le nombre de threads augmentent, plus le noyau doit passer de temps  à les synchroniser . J'aurais bien aimé trouver un lien pour confirmer, mais non, cette fois ci, STFW se tait (ou cherche dans le vide plus exactement)

17 comments:

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : Intel(R) Core(TM)2 Duo CPU E8235 @ 2.80GHz
model name : Intel(R) Core(TM)2 Duo CPU E8235 @ 2.80GHz

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 9.1061s
threads: 2 total time: 4.5573s
threads: 3 total time: 4.5581s
threads: 4 total time: 4.5584s

Emmanuel Kasper said...

Serveur Virtuel Prmgr 128 Mo RAM:

rosa:~# grep "model name" /proc/cpuinfo
model name : AMD Opteron(tm) Processor 6128

rosa:~# for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 51.3370s
threads: 2 total time: 50.7380s
threads: 3 total time: 52.2723s
threads: 4 total time: 51.9077s

Emmanuel Kasper said...

Telephone Portable Palm Pre:

Processor : ARMv7 Processor rev 3 (v7l) 600 Mhz

around 950 s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfomodel name : AMD Opteron(tm) Processor 4170 HE
model name : AMD Opteron(tm) Processor 4170 HE
model name : AMD Opteron(tm) Processor 4170 HE
model name : AMD Opteron(tm) Processor 4170 HE
model name : AMD Opteron(tm) Processor 4170 HE
model name : AMD Opteron(tm) Processor 4170 HE

for THREADS in 1 2 3 4 5 6 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 16.8368s
threads: 2 total time: 8.4227s
threads: 3 total time: 5.6284s
threads: 4 total time: 4.2753s
threads: 5 total time: 3.4208s
threads: 6 total time: 2.8583s

Emmanuel Kasper said...

virtual server V12 Hetzner ( KVM)

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 9.4030s
threads: 2 total time: 9.4050s
threads: 3 total time: 9.3838s
threads: 4 total time: 9.4395s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo model name : Intel(R) Xeon(R)

CPU E5620 @ 2.40GHz
model name : Intel(R) Xeon(R)
etc ...


root@panama:~# for THREADS in $(seq 1 16); do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 11.7136s
threads: 2 total time: 5.8630s
threads: 3 total time: 3.9098s
threads: 4 total time: 2.9323s
threads: 5 total time: 2.4497s
threads: 6 total time: 1.9556s
threads: 7 total time: 1.6766s
threads: 8 total time: 1.4662s
threads: 9 total time: 1.4053s
threads: 10 total time: 1.3533s
threads: 11 total time: 1.2976s
threads: 12 total time: 1.2752s
threads: 13 total time: 1.2016s
threads: 14 total time: 1.1606s
threads: 15 total time: 1.1392s
threads: 16 total time: 1.1070s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : Intel(R) Atom(TM) CPU N450 @ 1.66GHz
model name : Intel(R) Atom(TM) CPU N450 @ 1.66GHz

threads: 1 total time: 66.1031s
threads: 2 total time: 42.0981s
threads: 3 total time: 42.7518s
threads: 4 total time: 41.9797s

Emmanuel Kasper said...

NetBSD 5.1 sur le meme systeme:

/home/manu $ dmesg | grep cpu
cpu0 at mainbus0 apid 0: Intel 686-class, 5985MHz, id 0x106ca
cpu1 at mainbus0 apid 1: Intel 686-class, 5985MHz, id 0x106ca

threads: 1 total time: 76.0051s
threads: 2 total time: 49.5338s
threads: 3 total time: 49.2597s
threads: 4 total time: 49.2649s

Emmanuel Kasper said...

system_profiler | grep Processor Processor Name: Intel Core 2 Duo
Processor Speed: 2,8 GHz
Number Of Processors: 1

sysctl machdep.cpu.core_count
machdep.cpu.core_count: 2

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 12.3568s
threads: 2 total time: 6.2809s
threads: 3 total time: 6.2393s
threads: 4 total time: 6.2345s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : AMD Turion(tm) II Neo N40L Dual-Core Processor
model name : AMD Turion(tm) II Neo N40L Dual-Core Processor

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 23.3766s
threads: 2 total time: 11.6926s
threads: 3 total time: 11.6921s
threads: 4 total time: 11.6915s

Emmanuel Kasper said...

Samsung ARM chromebook with EXYNOS5250

grep Processor /proc/cpuinfo
Processor : ARMv7 Processor rev 4 (v7l)

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 98.2407s
threads: 2 total time: 51.3301s
threads: 3 total time: 49.8419s
threads: 4 total time: 49.9037s

Emmanuel Kasper said...

Droplet Digital Ocean 1GB RAM:

grep "model name" /proc/cpuinfo
model name : QEMU Virtual CPU version 1.0

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 15.4100s
threads: 2 total time: 15.4346s
threads: 3 total time: 15.2749s
threads: 4 total time: 15.4027s

Emmanuel Kasper said...

sudo dmidecode | grep M92z
Version: ThinkCentre M92z

grep "model name" /proc/cpuinfo
model name : Intel(R) Pentium(R) CPU G2020 @ 2.90GHz
model name : Intel(R) Pentium(R) CPU G2020 @ 2.90GHz

threads: 1 total time: 11.2230s
threads: 2 total time: 5.7589s
threads: 3 total time: 5.6784s
threads: 4 total time: 5.6834s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz


threads: 1 total time: 7.9625s
threads: 2 total time: 4.1254s
threads: 3 total time: 2.7402s
threads: 4 total time: 2.0480s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : Intel(R) Core(TM) i7-3770S CPU @ 3.10GHz (*8)

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench --test=cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 8.5812s
threads: 2 total time: 4.3684s
threads: 3 total time: 3.0194s
threads: 4 total time: 2.3094s

Emmanuel Kasper said...

grep "model name" /proc/cpuinfo
model name : ARMv7 Processor rev 2 (v7l) (beagle board black - single cpu)

threads: 1 total time: 200.4365s
threads: 2 total time: 199.9417s

Emmanuel Kasper said...

hetzner CX21

for THREADS in 1 2 3 4 ; do printf "threads: $THREADS" ; sysbench cpu --cpu-max-prime=10000 --num-threads=$THREADS run | grep "total time:" ; done
threads: 1 total time: 10.0007s
threads: 2 total time: 10.0006s
threads: 3 total time: 10.0016s
threads: 4 total time: 10.0020s