Compare donation performance of old application and rewrite
Closed, ResolvedPublic5 Story Points

Description

Use Apache ab to test the performance of the old and the new donation application.

Back up the test databases and truncate the spenden table.

Create files that contain the POST data for the forms (the donation field names have changed so you have to create two files). Test with

ab -v 5 -T 'application/x-www-form-urlencoded' -p old_form_data.txt http://test-spenden.wikimedia.de/spenden/spenden.php
ab -v 5 -T 'application/x-www-form-urlencoded' -p new_form_data.txt http://test-spenden-2.wikimedia.de/donation/add

If the output looks good, donate 100 or 1000 times:

ab -n 100 -T 'application/x-www-form-urlencoded' -p old_form_data.txt http://test-spenden.wikimedia.de/spenden/spenden.php
ab -n 100 -T 'application/x-www-form-urlencoded' -p new_form_data.txt http://test-spenden-2.wikimedia.de/donation/add

Then have a look how well the applications handle concurrent donations, for example 10 at a time, 1000 donations overall:

ab -n 1000 -c 10 -T 'application/x-www-form-urlencoded' -p old_form_data.txt http://test-spenden.wikimedia.de/spenden/spenden.php
ab -n 1000 -c 10 -T 'application/x-www-form-urlencoded' -p new_form_data.txt http://test-spenden-2.wikimedia.de/donation/add
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 30 2016, 12:31 PM
kai.nissen triaged this task as "Normal" priority.Jun 30 2016, 3:10 PM

I just ran the tests on both servers. The results differ quite a lot. The machine that hosts the new application had only half the amount of RAM when the tests were run (1GB vs. 2GB). The new application also sends confirmation mails while the old one doesn't. I already assigned 2GB of RAM to the new machine and will run the tests again once we can configure the confirmation (or rather any) mail being sent.

See the results of the performance tests below:

100 requests to old application:

15:56 $ ab -n 100 -T 'application/x-www-form-urlencoded' -p old_form.txt https://test-spenden.wikimedia.de/spenden/spende.php
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test-spenden.wikimedia.de (be patient).....done


Server Software:        nginx
Server Hostname:        test-spenden.wikimedia.de
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /spenden/spende.php
Document Length:        35029 bytes

Concurrency Level:      1
Time taken for tests:   23.196 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      3661500 bytes
Total body sent:        95800
HTML transferred:       3502900 bytes
Requests per second:    4.31 [#/sec] (mean)
Time per request:       231.955 [ms] (mean)
Time per request:       231.955 [ms] (mean, across all concurrent requests)
Transfer rate:          154.15 [Kbytes/sec] received
                        4.03 kb/s sent
                        158.19 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       87   91   1.8     90      99
Processing:   131  141  19.4    138     323
Waiting:      105  113  19.5    109     295
Total:        219  232  19.6    229     413

Percentage of the requests served within a certain time (ms)
  50%    229
  66%    232
  75%    234
  80%    235
  90%    238
  95%    240
  98%    267
  99%    413
 100%    413 (longest request)

100 requests to new application:

15:56 $ ab -n 100 -T 'application/x-www-form-urlencoded' -p new_form.txt https://test-spenden-2.wikimedia.de/donation/add
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test-spenden-2.wikimedia.de (be patient).....done


Server Software:        nginx
Server Hostname:        test-spenden-2.wikimedia.de
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /donation/add
Document Length:        56204 bytes

Concurrency Level:      1
Time taken for tests:   69.377 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      5686100 bytes
Total body sent:        59700
HTML transferred:       5620400 bytes
Requests per second:    1.44 [#/sec] (mean)
Time per request:       693.774 [ms] (mean)
Time per request:       693.774 [ms] (mean, across all concurrent requests)
Transfer rate:          80.04 [Kbytes/sec] received
                        0.84 kb/s sent
                        80.88 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       85   88   2.4     87     102
Processing:   587  606  11.1    604     650
Waiting:      558  576  11.1    574     619
Total:        672  694  11.3    692     739

Percentage of the requests served within a certain time (ms)
  50%    692
  66%    696
  75%    700
  80%    701
  90%    707
  95%    713
  98%    733
  99%    739
 100%    739 (longest request)

1000 requests (10 concurrently) to old application:

15:58 $ ab -n 1000 -c 10 -T 'application/x-www-form-urlencoded' -p old_form.txt https://test-spenden.wikimedia.de/spenden/spende.php
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test-spenden.wikimedia.de (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx
Server Hostname:        test-spenden.wikimedia.de
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /spenden/spende.php
Document Length:        35029 bytes

Concurrency Level:      10
Time taken for tests:   45.914 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      36615000 bytes
Total body sent:        958000
HTML transferred:       35029000 bytes
Requests per second:    21.78 [#/sec] (mean)
Time per request:       459.136 [ms] (mean)
Time per request:       45.914 [ms] (mean, across all concurrent requests)
Transfer rate:          778.79 [Kbytes/sec] received
                        20.38 kb/s sent
                        799.16 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       87   93   5.0     91     122
Processing:   204  365  30.2    363     747
Waiting:      176  336  29.7    334     700
Total:        293  458  30.3    454     859

Percentage of the requests served within a certain time (ms)
  50%    454
  66%    462
  75%    467
  80%    472
  90%    485
  95%    498
  98%    520
  99%    546
 100%    859 (longest request)

1000 requests (10 concurrently) to new application:

16:00 $ ab -n 1000 -c 10 -T 'application/x-www-form-urlencoded' -p new_form.txt https://test-spenden-2.wikimedia.de/donation/add
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test-spenden-2.wikimedia.de (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx
Server Hostname:        test-spenden-2.wikimedia.de
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /donation/add
Document Length:        56204 bytes

Concurrency Level:      10
Time taken for tests:   174.497 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      56861000 bytes
Total body sent:        597000
HTML transferred:       56204000 bytes
Requests per second:    5.73 [#/sec] (mean)
Time per request:       1744.971 [ms] (mean)
Time per request:       174.497 [ms] (mean, across all concurrent requests)
Transfer rate:          318.22 [Kbytes/sec] received
                        3.34 kb/s sent
                        321.56 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       84   90   6.5     88     155
Processing:   894 1648 171.3   1621    2548
Waiting:      864 1611 172.7   1585    2516
Total:        982 1738 171.3   1713    2657

Percentage of the requests served within a certain time (ms)
  50%   1713
  66%   1801
  75%   1855
  80%   1890
  90%   1971
  95%   2029
  98%   2080
  99%   2152
 100%   2657 (longest request)
kai.nissen added a comment.EditedJul 19 2016, 9:53 AM

Ran the test again with caching enabled:

18:47 $ ab -n 1000 -c 10 -T 'application/x-www-form-urlencoded' -p ~/new_form.txt https://test-spenden-2.wikimedia.de/donation/add
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test-spenden-2.wikimedia.de (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx
Server Hostname:        test-spenden-2.wikimedia.de
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /donation/add
Document Length:        56204 bytes

Concurrency Level:      10
Time taken for tests:   45.188 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      56861000 bytes
Total body sent:        597000
HTML transferred:       56204000 bytes
Requests per second:    22.13 [#/sec] (mean)
Time per request:       451.875 [ms] (mean)
Time per request:       45.188 [ms] (mean, across all concurrent requests)
Transfer rate:          1228.84 [Kbytes/sec] received
                        12.90 kb/s sent
                        1241.74 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       84   89   3.6     88     111
Processing:   267  362  22.9    360     703
Waiting:      236  331  22.8    329     671
Total:        353  450  23.4    448     810

Percentage of the requests served within a certain time (ms)
  50%    448
  66%    452
  75%    454
  80%    456
  90%    462
  95%    467
  98%    480
  99%    519
 100%    810 (longest request)

So after properly setting up page and twig cache the response times seem quite good.

These two files were used in the performance tests:

Restricted Application added a project: WMDE-Fun-Team. · View Herald TranscriptJan 26 2017, 9:39 AM

Can we close this?

gabriel-wmde closed this task as "Resolved".Feb 13 2017, 8:46 AM
gabriel-wmde claimed this task.