What's new

Router CPU benchmark with nbench

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

ndrp

Occasional Visitor
How do you test router's CPU? I tried nbench for my Asus RT-N16. For compiling I used 64 bit Ubuntu.

http://www.tux.org/~mayer/linux/bmark.html
Site is currently down.
http://web.archive.org/web/20131410201800/http://www.tux.org/~mayer/linux/bmark.html

1)
I downloaded AsusWRT source code to my home directory from
https://www.asus.com/us/Networking/RTN16/HelpDesk_Download/
by selecting OS to other.

Then I unpacked the source code.
unzip GPL_RT_N16_30043784850.zip
tar zxvf GPL_RT-N16_3.0.0.4.378.4850-g727db45.tgz


Deleted the archive files.
rm GPL_RT_N16_30043784850.zip
rm GPL_RT-N16_3.0.0.4.378.4850-g727db45.tgz


2)
I logged in my Asus and checked CPU info by running cat /proc/cpuinfo

admin@RT-N16:/tmp/home/root# cat /proc/cpuinfo
system type : Broadcom BCM4716 chip rev 1 pkg 10
processor : 0
cpu model : MIPS 74K V4.0
BogoMIPS : 239.20
wait instruction : no
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : no
hardware watchpoint : yes
ASEs implemented : mips16 dsp
shadow register sets : 1
VCED exceptions : not available
VCEI exceptions : not available

It's Broadcom MIPS 74K V4.0.

Because I unpacked the source code in my home directory I set PATH variable like this.
export PATH=$PATH:~/asuswrt/tools/brcm/hndtools-mipsel-uclibc/bin

3)
I downloaded nbench from http://fossies.org/linux/misc/nbench-byte-2.2.3.tar.gz because original site was down. Then unpacked the file and deleted the source code.
wget http://fossies.org/linux/misc/nbench-byte-2.2.3.tar.gz
tar zxvf nbench-byte-2.2.3.tar.gz
rm nbench-byte-2.2.3.tar.gz


Then I compiled nbench by using mipsel-linux-uclibc-gcc from defined path.
cd nbench-byte-2.2.3.
make CC=mipsel-linux-uclibc-gcc


3.1)
There is a bug in Makefile. If you are cross-compiling on x86-64 bit host nbench creates infinite loop when running ASSIGNMENT test. I'm using 64 bit Ubuntu so I needed to fix this bug. Fix was given in this forum thread https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=12579&start=25 .

I opened Makefile and searched this section.
pointer.h: pointer Makefile
$(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
-o pointer pointer.c
rm -f pointer.h
if [ "4" = `./pointer` ] ; then touch pointer.h ;\
else echo "#define LONG64" >pointer.h ; fi


I commeted out last two lines and added line touch pointer.h.
pointer.h: pointer Makefile
$(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
-o pointer pointer.c
rm -f pointer.h
# if [ "4" = `./pointer` ] ; then touch pointer.h ;\
# else echo "#define LONG64" >pointer.h ; fi
touch pointer.h


3.2)
If you get an error "make: mipsel-linux-uclibc-gcc: Command not fount" make sure you have installed package ia32-libs. I did not have that installed so I needed to run
sudo apt-get install ia32-libs
If ia32-libs is not found install suggested lib32z1 lib32ncurses5 lib32bz2-1.0 packages.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

4)
I used a FAT USB stick and created asusware directory to USB stick. To that directory I created .asusrouter file with one line.
#!/bin/sh

I think that file asusware/.asusrouter must exist so Asus knows to mount folder asusware to /opt directory.

I copied whole nbench-byte-2.2.3 folder to asusware folder.

5)
I sticked the USB memory my Asus RT-N16. I logged in using telnet (ssh can be also used) entered to /opt/nbench-byte-2.2.3 folder and runned ./nbench.

nbench does not support multithreading so results are for single code. Many results can be found here http://web.archive.org/web/20131019005215/http://www.tux.org/~mayer/linux/results2.html or by googling like https://learn.adafruit.com/embedded-linux-board-comparison/performance

NOT ALLOWED I attached to this message asusware.zip file that contains asusware folder with compiled nbench.

RESULTS

I have not found many routers tested.

My results for Asus RT-N16 are (compared to AMDK6/233 baseline).

MEMORY INDEX : 1.522
INTEGER INDEX : 1.469
FLOATING-POINT INDEX: 0.013
Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38

Full results.
Code:
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          161.96  :       4.15  :       1.36
STRING SORT         :          13.939  :       6.23  :       0.96
BITFIELD            :      5.8816e+07  :      10.09  :       2.11
FP EMULATION        :          28.662  :      13.75  :       3.17
FOURIER             :          19.956  :       0.02  :       0.01
ASSIGNMENT          :          1.7599  :       6.70  :       1.74
IDEA                :          668.49  :      10.22  :       3.04
HUFFMAN             :          39.995  :       1.11  :       0.35
NEURAL NET          :        0.015763  :       0.03  :       0.01
LU DECOMPOSITION    :         0.43453  :       0.02  :       0.02
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 5.977
FLOATING-POINT INDEX: 0.023
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU                 :
L2 Cache            :
OS                  : Linux 2.6.22.19
C compiler          : mipsel-linux-uclibc-gcc
libc                :
MEMORY INDEX        : 1.522
INTEGER INDEX       : 1.469
FLOATING-POINT INDEX: 0.013
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.

My results for PC-Engines Alix router with 500 MHz AMD Geode LX800 processors.

MEMORY INDEX : 2.078
INTEGER INDEX : 2.059
FLOATING-POINT INDEX: 1.631

Full results.
Code:
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          117.13  :       3.00  :       0.99
STRING SORT         :          20.056  :       8.96  :       1.39
BITFIELD            :      4.9587e+07  :       8.51  :       1.78
FP EMULATION        :          29.928  :      14.36  :       3.31
FOURIER             :          2108.6  :       2.40  :       1.35
ASSIGNMENT          :           3.688  :      14.03  :       3.64
IDEA                :          582.98  :       8.92  :       2.65
HUFFMAN             :          234.38  :       6.50  :       2.08
NEURAL NET          :          1.7341  :       2.79  :       1.17
LU DECOMPOSITION    :           73.44  :       3.80  :       2.75
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 8.283
FLOATING-POINT INDEX: 2.940
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU                 : AuthenticAMD Geode(TM) Integrated Processor by AMD PCS 498MHz
L2 Cache            : 128 KB
OS                  : Linux 3.2.0-4-486
C compiler          : gcc version 4.7.2 (Debian 4.7.2-5)
libc                : libc-2.13.so
MEMORY INDEX        : 2.078
INTEGER INDEX       : 2.059
FLOATING-POINT INDEX: 1.631
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.
 
I cannot edit my original post so I add updates this message.

Here are my Sysbench results for Asus RT-N16

./sysbench --num-threads=1 --test=cpu --cpu-max-prime=1000 --validate run
total time: 834.2059s

Really slow. Is there an error in copilation or is the processor missing some hardware operations?

Full results.
Code:
./sysbench --num-threads=1 --test=cpu --cpu-max-prime=1000 --validate run
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Additional request validation enabled.

Random number generator seed is 0 and will be ignored


Prime numbers limit: 1000

Initializing worker threads...

Threads started!


General statistics:
  total time:  834.2059s
  total number of events:  10000
  total time taken by event execution: 832.8806s
  response time:
  min:  82.64ms
  avg:  83.29ms
  max:  117.67ms
  approx.  95 percentile:  83.76ms

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

Here are my nbench and SysBench results for Asus RT-N18U

cat /proc/cpuinfo
Processor : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 1599.07
Features : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0


MEMORY INDEX : 4.779
INTEGER INDEX : 5.023
FLOATING-POINT INDEX: 0.441
Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38

Full results.
Code:
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          419.52  :      10.76  :       3.53
STRING SORT         :          46.705  :      20.87  :       3.23
BITFIELD            :       1.576e+08  :      27.03  :       5.65
FP EMULATION        :          73.181  :      35.12  :       8.10
FOURIER             :          480.68  :       0.55  :       0.31
ASSIGNMENT          :          6.0628  :      23.07  :       5.98
IDEA                :          963.43  :      14.74  :       4.38
HUFFMAN             :           573.8  :      15.91  :       5.08
NEURAL NET          :          0.5969  :       0.96  :       0.40
LU DECOMPOSITION    :          18.556  :       0.96  :       0.69
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 19.704
FLOATING-POINT INDEX: 0.796
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU                 :
L2 Cache            :
OS                  : Linux 2.6.36.4brcmarm
C compiler          : arm-brcm-linux-uclibcgnueabi-gcc
libc                :
MEMORY INDEX        : 4.779
INTEGER INDEX       : 5.023
FLOATING-POINT INDEX: 0.441
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.


./sysbench --num-threads=1 --test=cpu --cpu-max-prime=1000 --validate run
total time: 22.5549s

Full results.
Code:
./sysbench --num-threads=1 --test=cpu --cpu-max-prime=1000 --validate run
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Additional request validation enabled.

Random number generator seed is 0 and will be ignored


Prime numbers limit: 1000

Initializing worker threads...

Threads started!


General statistics:
  total time:  22.5549s
  total number of events:  10000
  total time taken by event execution: 22.5024s
  response time:
  min:  2.21ms
  avg:  2.25ms
  max:  14.05ms
  approx.  95 percentile:  2.30ms

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

-----------------------------------------------------------------------------------------------------

Asus RT-N16

I compiled SysBench for Asus RT-N16 like this.

wget https://github.com/akopytov/sysbench/archive/0.5.zip
unzip 0.5.zip
rm 0.5.zip
cd sysbench-0.5/
export PATH=$PATH:~/asuswrt/tools/brcm/hndtools-mipsel-uclibc/bin
./autogen.sh
export ac_cv_func_malloc_0_nonnull=yes
./configure --target=mipsel-linux-uclibc --host=mipsel-linux-uclibc --without-mysql LDFLAGS="-static"
make


Copied sysbench folder (~/sysbench-0.5/sysbench) to folder asusware/ on USB stick.

For example, run command.
./sysbench --num-threads=1 --test=cpu --cpu-max-prime=1000 --validate run
This took on RT-N16 838.9147 seconds!


Asus RT-N18U

I got source code for Asus RT-N18U as for RT-N16

Compiled nbench

export PATH=$PATH:~/asuswrt/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin

I compiled as for RT-N16 but replaced
mipsel-linux-uclibc with arm-brcm-linux-uclibcgnueabi
and
mipsel-linux-uclibc-gcc with arm-brcm-linux-uclibcgnueabi-gcc

make CC=arm-brcm-linux-uclibcgnueabi-gcc

Error: ./libexec/gcc/arm-brcm-linux-uclibcgnueabi/4.5.3/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
is fixed by:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/asuswrt/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/lib

If you get libelf.so.1 error install libelf1:i386.
sudo apt-get install libelf1:i386


Compiled SysBench

./autogen.sh
./configure --target=arm-brcm-linux-uclibcgnueabi --host=arm-brcm-linux-uclibcgnueabi --without-mysql LDFLAGS="-static"
make

-----------------------------------------------------------------------------------------------------

Here are my compiled nbench and SysBench for MIPS and ARM.
http://104.233.80.15/misc/nbench_and_sysbench_for_asus/

 
Last edited:
Little ARM's do nicely - again, single threaded, so it doesn't really leverage into the 4-core implementations on Pi2/Pi3...

pibench_element14.png
 
so the pentium 3 still beats the arm A7 quad core. The power of x86 lol, which is why it chews through NAT, firewall, QoS, VPN encryption way better than ARM and MIPS.

What if you ran 36 instances on the CCR? i wonder how much you would get.
 
hmm if i manage to hack my mikrotik ccr perhaps i could try this on it :D, see how well those 36 cores stack.

Sysbench is a better measure of performance these days... and it is multi-threaded as a CLI argument...

Code:
sysbench --num-threads=1 --test=cpu --cpu-max-prime=20000 --validate run
sysbench --num-threads=4 --test=cpu --cpu-max-prime=20000 --validate run
 
so the pentium 3 still beats the arm A7 quad core. The power of x86 lol, which is why it chews through NAT, firewall, QoS, VPN encryption way better than ARM and MIPS.

Actually the Pi's seem to place somewhere in between the P/// and the Athlon - and these are really old platforms, but the person there cherry picked them to give a sense of where the Broadcom A7/A53's stand - a Pi3 is actually usable for desktop computing to some degree..
 
Rasberry Pi 2 has a quad core 900 MHz ARM A7 processors. Asus RT-N18U has a single core 800 MHz ARM A7 processor.

rpi3_nbench.png


Asus RT-N18U
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX : 19.704
FLOATING-POINT INDEX: 0.796
Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0

It seems like that Asus RT-N18 doesn't have a floating point unit.

RT-N18U can achieve throughput of ~770 Mpbs. What could you expect if RT-N18 had a quad code processor?
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top