Search code examples
raspberry-piraspberry-pi2sysbench

Unusual sysbench results Raspberry Pi


I have 2 raspberry pi's that I wanted to benchmark for load balancing purpose.

  • Raspberry pi Model B v1.1 - running Raspbian Jessie
  • Raspberry pi Model B+ v1.2 - running Raspbian Jessie

I installed sysbench on both systems and ran: sysbench --num-threads=1 --test=cpu --cpu-max-prime=10000 --validate run on the first and changed --num-threads=4 on the second, as its quadcore and ran both.

The results are not at all what I expected (I obviously expected the multithreaded benchmark to severely outperform the single threaded benchmark). When I ran a the command with a single thread, performance was about the same on both systems. But when I changed the number of threads to 4 on the second Pi it still took the same amount of time, except that the per request statistics showed that the average request took about 4 times as much time. I can seem to grasp why this is.

Here are the results:


Raspberry pi v1.1
Single thread
Maximum prime number checked in CPU test: 20000

Test execution summary:

  • total time: 1325.0229s
  • total number of events: 10000
  • total time taken by event execution: 1324.9665

per-request statistics:

  • min: 131.00ms
  • avg: 132.50ms
  • max: 171.58ms
    approx. 95 percentile: 137.39ms

Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 1324.9665/0.00


Raspberry pi v1.2
Four threads
Maximum prime number checked in CPU test: 20000

Test execution summary:

  • total time: 1321.0618s
  • total number of events: 10000
  • total time taken by event execution: 5283.8876

per-request statistics:

  • min: 486.45ms
  • avg: 528.39ms
  • max: 591.60ms
    approx. 95 percentile: 553.98ms

Threads fairness: events (avg/stddev): 2500.0000/0.00 execution time (avg/stddev): 1320.9719/0.03



Solution

  • "Raspberry pi Model B+ v1.2" has the same CPU as "Raspberry pi Model B v1.1". Both boards are from the first generation of Raspberry Pi and they have 1 core CPU.

    For 4 CPU you need Raspberry Pi 2 Model B instead of Raspberry pi Model B+.

    Yeah, the naming is a bit confusing :(