Pi vs UDOO MySQL performance test

Create test DB:

mysql -u root -p
mysql> create database test;
exit;

Prepare the database:

sysbench --test=oltp --oltp-table-size=100000 --mysql-db=test --mysql-user=root --mysql-password=mysqlpassword prepare

Run the test:

sysbench --test=oltp --oltp-table-size=100000 --mysql-db=test --mysql-user=root --mysql-password=mysqlpassword --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run

Pi Output:

OLTP test statistics:
    queries performed:
        read:                            28364
        write:                           0
        other:                           4052
        total:                           32416
    transactions:                        2026   (33.76 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 28364  (472.67 per sec.)
    other operations:                    4052   (67.52 per sec.)

Test execution summary:
    total time:                          60.0080s
    total number of events:              2026
    total time taken by event execution: 59.8767
    per-request statistics:
         min:                                 12.90ms
         avg:                                 29.55ms
         max:                                 76.67ms
         approx.  95 percentile:              50.34ms

Threads fairness:
    events (avg/stddev):           2026.0000/0.00
    execution time (avg/stddev):   59.8767/0.00

UDOO output:

OLTP test statistics:
    queries performed:
        read:                            287532
        write:                           0
        other:                           41076
        total:                           328608
    transactions:                        20538  (342.19 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 287532 (4790.71 per sec.)
    other operations:                    41076  (684.39 per sec.)

Test execution summary:
    total time:                          60.0186s
    total number of events:              20538
    total time taken by event execution: 479.3667
    per-request statistics:
         min:                                  7.26ms
         avg:                                 23.34ms
         max:                                196.47ms
         approx.  95 percentile:              32.59ms

Threads fairness:
    events (avg/stddev):           2567.2500/50.73
    execution time (avg/stddev):   59.9208/0.01

the important bit is the transactions line:
UDOO: transactions: 20538 (342.19 per sec.)
PI: transactions: 2026 (33.76 per sec.)

Last step – drop the test database:

mysql -u root -p
mysql> drop database test;
exit;

 

Pi vs UDOO quick CPU performance test

First install the software

apt-get install sysbench

then run on PI:

 sysbench --test=cpu --cpu-max-prime=2000 run

on UDOO:

 sysbench --test=cpu --num-threads=4 --cpu-max-prime=2000 run

UDOO output:

Maximum prime number checked in CPU test: 2000
Test execution summary:
 total time: 20.8079s
 total number of events: 10000
 total time taken by event execution: 166.2889
 per-request statistics:
 min: 8.18ms
 avg: 16.63ms
 max: 90.20ms
 approx. 95 percentile: 28.23ms
Threads fairness:
 events (avg/stddev): 1250.0000/6.71
 execution time (avg/stddev): 20.7861/0.03

PI output:

Maximum prime number checked in CPU test: 2000

Test execution summary:
total time: 48.0722s
total number of events: 10000
total time taken by event execution: 192.0741
per-request statistics:
min: 4.68ms
avg: 19.21ms
max: 71.20ms
approx. 95 percentile: 44.05ms

Threads fairness:
events (avg/stddev): 2500.0000/0.71
execution time (avg/stddev): 48.0185/0.02

UDOO – Debian – nginx – performance tuning

This is an update to my previous post: Optimizing Raspberry Pi performance

Unlike Raspberry Pi – UDOO board has quad core CPU. We can verify that by running:

grep ^processor /proc/cpuinfo | wc -l

So i’ve adjusted the /etc/nginx/nginx.conf accordingly:

# One worker per CPU-core.
worker_processes  4;

events {
    worker_connections  8096;
    multi_accept        on;
    use                 epoll;
}

 

 

 

 

Performance testing Nginx on Raspberry Pi

Having configured Nginx it is now time to test it.

I will use three tools to perform the tests: Autobench, httperf and OpenWebLoad. The principle behind them is to generate a massive amount of HTTP requests.

Autobench

is a simple Perl script for automating the process of benchmarking a web server (or for conducting a comparative test of two different web servers). The script is a wrapper around httperf. Autobench runs httperf a number of times against each host, increasing the number of requested connections per second on each iteration, and extracts the significant data from the httperf output, delivering a CSV or TSV format file which can be imported directly into a spreadsheet for analysis/graphing. For more details please refer to this website

explanation of some of the switches used:

* low rate – connections per second at the beginning of the test

*high_rate – connections per second at the end of the test

*num_call – how many requests should be sent per connection

* num_conn – total amount of connections

TSV file can be open in Excel. So based on the graph it would appear that Raspberry Pi can take approx 1000 connections per second without a loss! Not too bad for something worth so little.

Optimizing Raspberry Pi performance

CPU

The best way to overclock Raspberry Pi it is with the raspi-config tool

raspi-config

I go for the Modest option:

 

Nginx

Modify nginx.con (/etc/nginx/nginx.conf)

We only have one CPU thread…

worker_processes  1;

In the http { section add the following:

# Optimize memory
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
sendfile        on;
tcp_nopush     on;
server_names_hash_bucket_size 128;
keepalive_timeout  65;
# Enable website compression - it takes a lot of CPU
# If you are running low on CPU disable the Zip part.
gzip  on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

Also it is usefull to add:

#Hide Nginx version number
 server_tokens off;

 

 MySQL

Download and run this script: MySQL Tuner Perl script

perl mysqltuner.pl

then go to /etc/mysql/ and edit my.cnf accordingly.