T
T
Tyoma Makeev2015-08-28 23:57:44
MySQL
Tyoma Makeev, 2015-08-28 23:57:44

What determines the performance of MYSQL?

Hello! I decided to test the VPS servers that I currently have. That is VPSie, Digital Ocean and micro on EC2. I installed Sysbench, MariaDB 10.1 on them, they all have the same OS (Ubuntu 15.04), all the parameters are about the same (1 core, 1GB RAM, SSD drive). I won’t post irrelevant information (like download speed from different servers), I’ll write only a part.
sysbench --test=cpu --cpu-max-prime=20000 run
DO did this test in 38 seconds, VPSie in 27, and EC2 in 30.
With this command

dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync && rm -f test
DO had 15.6 MB/s (very strange), VPSie had 504 MB/s, EC2 had 64.3 MB/s.
It seems that according to all these indicators, we can assume that VPSie is the fastest, and DO is the weakest.
But when I started using the same Sysbench to benchmark the database with the following commands
sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=1234 prepare

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

sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=1234 cleanup

I got the following results from
VPSie:
OLTP test statistics:
    queries performed:
        read:                            310884
        write:                           0
        other:                           44412
        total:                           355296
    transactions:                        22206  (370.04 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 310884 (5180.56 per sec.)
    other operations:                    44412  (740.08 per sec.)

Test execution summary:
    total time:                          60.0098s
    total number of events:              22206
    total time taken by event execution: 479.9248
    per-request statistics:
         min:                                  4.85ms
         avg:                                 21.61ms
         max:                                106.37ms
         approx.  95 percentile:              33.49ms

Threads fairness:
    events (avg/stddev):           2775.7500/12.39
    execution time (avg/stddev):   59.9906/0.00

DO:
OLTP test statistics:
    queries performed:
        read:                            349062
        write:                           0
        other:                           49866
        total:                           398928
    transactions:                        24933  (415.49 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 349062 (5816.85 per sec.)
    other operations:                    49866  (830.98 per sec.)

Test execution summary:
    total time:                          60.0088s
    total number of events:              24933
    total time taken by event execution: 479.8953
    per-request statistics:
         min:                                  5.33ms
         avg:                                 19.25ms
         max:                                114.93ms
         approx.  95 percentile:              32.82ms

Threads fairness:
    events (avg/stddev):           3116.6250/8.69
    execution time (avg/stddev):   59.9869/0.00

EC2:
OLTP test statistics:
    queries performed:
        read:                            682780
        write:                           0
        other:                           97540
        total:                           780320
    transactions:                        48770  (812.76 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 682780 (11378.62 per sec.)
    other operations:                    97540  (1625.52 per sec.)

Test execution summary:
    total time:                          60.0055s
    total number of events:              48770
    total time taken by event execution: 479.8626
    per-request statistics:
         min:                                  2.41ms
         avg:                                  9.84ms
         max:                                 77.80ms
         approx.  95 percentile:              12.70ms

Threads fairness:
    events (avg/stddev):           6096.2500/13.25
    execution time (avg/stddev):   59.9828/0.00

It turns out that EC2 turned out to be approximately twice as fast as DO, and, it would seem, the most powerful VPSie became the slowest.
Tell me, am I somehow decoding the results of these benchmarks, or is the performance of the database very much dependent on something that I missed? Or how could this even happen?
UPD: MariaDB settings did not differ. The only thing done between install and test is mysql_secure_installation

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergei Borisov, 2015-08-30
@risik

I don’t know how it is with DO and VPSie, but I can speak for EC2. A micro instance is an instance with no guaranteed performance. It can give you high performance for a short time, and then take away your CPU time. This is how the entire t2 instance series behaves:
> T2 instances are Burstable Performance Instances ...
https://aws.amazon.com/ec2/instance-types/ > A CPU Credit provides the performance of a full CPU core for one minute.
Look at the "CPU Credits / hour"
setting of the micro instance to 6. Swipe more tests within an hour immediately after the start of the instance - you should see a performance drawdown. credits are accumulated until the end of the day.
Or run the test for more than one minute, since the duration of one credit is just 1 minute:
on the same link.

N
Night, 2015-08-29
@maxtm

Offtopic: I always considered DO to be the fastest cloud platform... your tests discouraged me a little. Probably time to check it out yourself.
According to the database itself - the speed can very much depend on the settings, up to 1000% performance.
Provided that these same settings are different - the question is for you - did they differ on your instances?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question