Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance aggregator REST API performances #1327

Closed
5 tasks done
jpraynaud opened this issue Nov 6, 2023 · 3 comments
Closed
5 tasks done

Enhance aggregator REST API performances #1327

jpraynaud opened this issue Nov 6, 2023 · 3 comments
Assignees
Labels
performances 🥇 Performances

Comments

@jpraynaud
Copy link
Member

jpraynaud commented Nov 6, 2023

Why

The REST API of the aggregator performances are sub-optimal and have led to some unreachability as seen in #1310.

What

We want to have better performances of the aggregator by implementing long term solutions such as:

  • Optimize serializations of cryptographic types
  • Make use of multi-threaded connection to SQLite

How

  • Avoid back and forth serialization (database record -> entity -> message) in the REST API? (Implement a fn get_database_records<R: From<DatabaseRecord>>() -> StdResult<Vec<R>> function with a generic type)
    • Certificate
    • SignedEntity
  • Implement specific pragmas to optimize performances (see this article)
  • Make a multi-threaded connection to SQLite (see WAL, use pragma PRAGMA journal_mode=WAL; and make sure that the current SQlite crate used is compatible)

Later

  • Make the aggregator HTTP server or reverse proxy purge request after a timeout (with a 408 Request Timeout) (e.g. with tower which is compatible with warp)
  • Implement LIMIT in providers
  • Adding a memory cache layer to reduce load sent to the database (if none of the previous options worked)
@jpraynaud jpraynaud added performances 🥇 Performances to-groom 🤔 Needs grooming and removed to-groom 🤔 Needs grooming labels Nov 6, 2023
@ghubertpalo
Copy link
Collaborator

We did some performances tests prior and after the apply of the patch.
Results are slightly better with the patch but measurements remain within the standard deviation.

Before the patch

(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator
Document Length:        75 bytes

Concurrency Level:      100
Time taken for tests:   8.984 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      212000 bytes
HTML transferred:       75000 bytes
Requests per second:    111.31 [#/sec] (mean)
Time per request:       898.430 [ms] (mean)
Time per request:       8.984 [ms] (mean, across all concurrent requests)
Transfer rate:          23.04 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      103  613 249.6    581    1633
Processing:    31  202 109.3    180    1011
Waiting:       27  193  97.5    169     540
Total:        134  815 259.1    774    2300

Percentage of the requests served within a certain time (ms)
  50%    774
  66%    856
  75%    912
  80%    974
  90%   1114
  95%   1315
  98%   1644
  99%   1698
 100%   2300 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator
Document Length:        75 bytes

Concurrency Level:      100
Time taken for tests:   8.890 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      212000 bytes
HTML transferred:       75000 bytes
Requests per second:    112.48 [#/sec] (mean)
Time per request:       889.045 [ms] (mean)
Time per request:       8.890 [ms] (mean, across all concurrent requests)
Transfer rate:          23.29 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      103  626 244.1    572    1588
Processing:    32  198 100.9    180     703
Waiting:       29  191  91.2    179     517
Total:        139  824 259.2    754    1991

Percentage of the requests served within a certain time (ms)
  50%    754
  66%    857
  75%    920
  80%    995
  90%   1173
  95%   1404
  98%   1549
  99%   1647
 100%   1991 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/epoch-settings
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/epoch-settings
Document Length:        106 bytes

Concurrency Level:      100
Time taken for tests:   8.775 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      244000 bytes
HTML transferred:       106000 bytes
Requests per second:    113.96 [#/sec] (mean)
Time per request:       877.474 [ms] (mean)
Time per request:       8.775 [ms] (mean, across all concurrent requests)
Transfer rate:          27.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      101  593 196.4    576    1333
Processing:    34  209  92.9    200     637
Waiting:       29  201  82.8    195     556
Total:        135  803 191.3    782    1606

Percentage of the requests served within a certain time (ms)
  50%    782
  66%    867
  75%    925
  80%    962
  90%   1047
  95%   1131
  98%   1223
  99%   1346
 100%   1606 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/snapshots
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/snapshots
Document Length:        11141 bytes

Concurrency Level:      100
Time taken for tests:   8.987 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      11281000 bytes
HTML transferred:       11141000 bytes
Requests per second:    111.27 [#/sec] (mean)
Time per request:       898.734 [ms] (mean)
Time per request:       8.987 [ms] (mean, across all concurrent requests)
Transfer rate:          1225.79 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      101  629 240.3    602    1591
Processing:    29  198 116.8    177     653
Waiting:       29  189 107.9    170     653
Total:        258  827 229.7    805    1761

Percentage of the requests served within a certain time (ms)
  50%    805
  66%    913
  75%    965
  80%   1011
  90%   1114
  95%   1252
  98%   1351
  99%   1407
 100%   1761 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/mithril-stake-distributions
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/mithril-stake-distributions
Document Length:        4401 bytes

Concurrency Level:      100
Time taken for tests:   18.118 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      4540000 bytes
HTML transferred:       4401000 bytes
Requests per second:    55.19 [#/sec] (mean)
Time per request:       1811.764 [ms] (mean)
Time per request:       18.118 [ms] (mean, across all concurrent requests)
Transfer rate:          244.71 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      101  278 309.3    154    1856
Processing:    81 1427 650.6   1398    3415
Waiting:       80 1427 650.6   1398    3413
Total:        237 1705 637.6   1680    3551

Percentage of the requests served within a certain time (ms)
  50%   1680
  66%   1947
  75%   2118
  80%   2224
  90%   2549
  95%   2845
  98%   3100
  99%   3376
 100%   3551 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/certificates
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/certificates
Document Length:        29566 bytes

Concurrency Level:      100
Time taken for tests:   17.334 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      29706000 bytes
HTML transferred:       29566000 bytes
Requests per second:    57.69 [#/sec] (mean)
Time per request:       1733.396 [ms] (mean)
Time per request:       17.334 [ms] (mean, across all concurrent requests)
Transfer rate:          1673.58 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      102  257 266.6    152    1590
Processing:    98 1374 550.9   1367    3203
Waiting:       69 1345 551.0   1340    3175
Total:        216 1630 550.8   1607    3512

Percentage of the requests served within a certain time (ms)
  50%   1607
  66%   1815
  75%   1945
  80%   2037
  90%   2376
  95%   2611
  98%   2893
  99%   3076
 100%   3512 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ 

After the patch

(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator
Document Length:        75 bytes

Concurrency Level:      100
Time taken for tests:   8.230 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      212000 bytes
HTML transferred:       75000 bytes
Requests per second:    121.51 [#/sec] (mean)
Time per request:       823.010 [ms] (mean)
Time per request:       8.230 [ms] (mean, across all concurrent requests)
Transfer rate:          25.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      108  562 167.2    549    1382
Processing:    33  211 113.6    199     786
Waiting:       28  198  93.4    193     643
Total:        140  773 181.3    740    1721

Percentage of the requests served within a certain time (ms)
  50%    740
  66%    800
  75%    859
  80%    890
  90%   1002
  95%   1108
  98%   1330
  99%   1413
 100%   1721 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/epoch-settings
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/epoch-settings
Document Length:        106 bytes

Concurrency Level:      100
Time taken for tests:   8.033 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      244000 bytes
HTML transferred:       106000 bytes
Requests per second:    124.49 [#/sec] (mean)
Time per request:       803.288 [ms] (mean)
Time per request:       8.033 [ms] (mean, across all concurrent requests)
Transfer rate:          29.66 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      103  573 213.2    549    1451
Processing:    35  188  95.6    174     528
Waiting:       29  180  86.9    172     420
Total:        138  761 214.7    740    1653

Percentage of the requests served within a certain time (ms)
  50%    740
  66%    791
  75%    849
  80%    885
  90%   1004
  95%   1115
  98%   1481
  99%   1566
 100%   1653 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/snapshots
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/snapshots
Document Length:        11141 bytes

Concurrency Level:      100
Time taken for tests:   8.289 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      11281000 bytes
HTML transferred:       11141000 bytes
Requests per second:    120.65 [#/sec] (mean)
Time per request:       828.874 [ms] (mean)
Time per request:       8.289 [ms] (mean, across all concurrent requests)
Transfer rate:          1329.10 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      101  591 217.7    558    1586
Processing:    30  202  97.1    189     619
Waiting:       29  193  88.8    176     606
Total:        135  793 220.3    760    1923

Percentage of the requests served within a certain time (ms)
  50%    760
  66%    827
  75%    878
  80%    923
  90%   1091
  95%   1270
  98%   1424
  99%   1462
 100%   1923 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/mithril-stake-distributions
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/mithril-stake-distributions
Document Length:        4401 bytes

Concurrency Level:      100
Time taken for tests:   16.661 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      4540000 bytes
HTML transferred:       4401000 bytes
Requests per second:    60.02 [#/sec] (mean)
Time per request:       1666.106 [ms] (mean)
Time per request:       16.661 [ms] (mean, across all concurrent requests)
Transfer rate:          266.11 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      103  332 367.3    170    2216
Processing:    50 1274 575.4   1261    3536
Waiting:       46 1273 575.6   1261    3536
Total:        153 1605 551.4   1614    3759

Percentage of the requests served within a certain time (ms)
  50%   1614
  66%   1812
  75%   1962
  80%   2050
  90%   2330
  95%   2520
  98%   2687
  99%   2786
 100%   3759 (longest request)
(base) ➜  mithril git:(ensemble/1311-mithril-client-common-crates-publish) ✗ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/certificates
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/certificates
Document Length:        29566 bytes

Concurrency Level:      100
Time taken for tests:   16.098 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      29706000 bytes
HTML transferred:       29566000 bytes
Requests per second:    62.12 [#/sec] (mean)
Time per request:       1609.785 [ms] (mean)
Time per request:       16.098 [ms] (mean, across all concurrent requests)
Transfer rate:          1802.09 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      102  247 226.7    158    1415
Processing:    78 1304 511.3   1262    3100
Waiting:       46 1275 511.4   1232    3072
Total:        180 1551 498.9   1530    3244

Percentage of the requests served within a certain time (ms)
  50%   1530
  66%   1714
  75%   1842
  80%   1941
  90%   2193
  95%   2403
  98%   2732
  99%   3041
 100%   3244 (longest request)

@ghubertpalo ghubertpalo mentioned this issue Nov 17, 2023
11 tasks
@ghubertpalo
Copy link
Collaborator

Using the direct conversion between database records and messages, the performances are the following:

ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/certificates
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network
Document Path:          /aggregator/certificates
Document Length:        29326 bytes
Concurrency Level:      100
Time taken for tests:   8.707 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      29466000 bytes
HTML transferred:       29326000 bytes
Requests per second:    114.84 [#/sec] (mean)
Time per request:       870.743 [ms] (mean)
Time per request:       8.707 [ms] (mean, across all concurrent requests)
Transfer rate:          3304.69 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      104  569 173.8    554    1152
Processing:    61  249  86.6    240     671
Waiting:       33  214  81.0    207     56
Total:        165  818 168.8    804    1538
Percentage of the requests served within a certain time (ms)
  50%    804
  66%    864
  75%    911
  80%    943
  90%   1040
  95%   1106
  98%   1198
  99%   1343
 100%   1538 (longest request)

80% of the requests are served in less than 943ms instead of 1941ms. The RpS is > 110 instead of >60.

@ghubertpalo
Copy link
Collaborator

After the last patch, the signed entities routes have been tested with the following performances:

$ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/snapshots
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/snapshots
Document Length:        11141 bytes

Concurrency Level:      100
Time taken for tests:   8.107 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      11281000 bytes
HTML transferred:       11141000 bytes
Requests per second:    123.36 [#/sec] (mean)
Time per request:       810.660 [ms] (mean)
Time per request:       8.107 [ms] (mean, across all concurrent requests)
Transfer rate:          1358.97 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       67  577 247.1    523    1863
Processing:    23  196  93.7    180     646
Waiting:       18  185  83.6    174     580
Total:         90  773 256.1    731    2142

Percentage of the requests served within a certain time (ms)
  50%    731
  66%    795
  75%    853
  80%    909
  90%   1034
  95%   1208
  98%   1646
  99%   1909
 100%   2142 (longest request)


$ ab -n 1000 -c 100 https://aggregator.testing-preview.api.mithril.network/aggregator/artifact/mithril-stake-distributions
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking aggregator.testing-preview.api.mithril.network (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:        
Server Hostname:        aggregator.testing-preview.api.mithril.network
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,4096,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        aggregator.testing-preview.api.mithril.network

Document Path:          /aggregator/artifact/mithril-stake-distributions
Document Length:        4401 bytes

Concurrency Level:      100
Time taken for tests:   8.416 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      4540000 bytes
HTML transferred:       4401000 bytes
Requests per second:    118.82 [#/sec] (mean)
Time per request:       841.594 [ms] (mean)
Time per request:       8.416 [ms] (mean, across all concurrent requests)
Transfer rate:          526.81 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       67  610 270.5    574    1437
Processing:    23  191  97.3    177     691
Waiting:       19  185  91.2    170     556
Total:         92  801 281.6    751    1693

Percentage of the requests served within a certain time (ms)
  50%    751
  66%    802
  75%    859
  80%    928
  90%   1313
  95%   1437
  98%   1540
  99%   1583
 100%   1693 (longest request)

All routes performances are now acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performances 🥇 Performances
Projects
None yet
Development

No branches or pull requests

2 participants