Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

[Story] Disable Thumbor S3 result storage to download images faster #1653

Closed tschaffter closed 1 year ago

tschaffter commented 1 year ago

What projects is this story for?

OpenChallenges

As a user, I want

NA

Description

We have observed that images are displayed slowly in the web app. Sometimes images failed to be downloaded with an 500 error from the API gateway. After exploring the issue in #1641, I made the following observations:

  1. Downloading the images directly from Thumbor mostly eliminate the 500 error experience when proxying the requests to the API gateway. The reason is likely because Thumbor has a larger request timeout than the API gateway (Spring API Gateway).
  2. Disabling Thumbor S3 result storage enables Thumbor to return requested images much faster.
  3. The first request to an image will be slower than subsequent requests to the same image because it needs to be processed first.

The goal of this ticket is to make the following changes to Thumbor to improve its performance:

Acceptance criteria

No response

Tasks

No response

Anything else?

No response

Have you linked this story to a GitHub Project?

tschaffter commented 1 year ago

Update: I can't make Thumbor slow again

Even when proxying the requests to the API gateway, the org logos now show quickly on the org search page despite seemingly changing "nothing" for Thumbor aside creating a fresh Docker volume for it. I'm trying to understand why.

I reported the following benchmark results when downloading an image directly from Thumbor in #1641 .

vscode@0f6993f91f7e:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   36.368 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    2.75 [#/sec] (mean)
Time per request:       363.676 [ms] (mean)
Time per request:       363.676 [ms] (mean, across all concurrent requests)
Transfer rate:          26.46 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:   186  364 211.3    247     866
Waiting:      186  363 211.2    247     865
Total:        186  364 211.3    247     867

Percentage of the requests served within a certain time (ms)
  50%    247
  66%    308
  75%    591
  80%    632
  90%    722
  95%    802
  98%    865
  99%    867
 100%    867 (longest request)

After thinking to have figured out that the S3 result storage was what was taking so much time, I can't reproduce the previous time. The times I get now are much faster and are shown below;

Note The value of Document Length (assuming its the image size) is the same as in the above results, which is expected since the same image is used.

vscode@0f6993f91f7e:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   1.463 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    68.34 [#/sec] (mean)
Time per request:       14.633 [ms] (mean)
Time per request:       14.633 [ms] (mean, across all concurrent requests)
Transfer rate:          657.57 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:    10   15  13.3     12     143
Waiting:       10   14  13.3     12     143
Total:         10   15  13.3     12     143

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     13
  75%     14
  80%     16
  90%     18
  95%     21
  98%     30
  99%    143
 100%    143 (longest request)

The only think that I can think of that is different is that I cleaned up ALL my Docker resources, including the volumes, which I haven't done in a long wail. Thumbor has been configured to use one of these volumes to store original images - while the processed images are saved to S3 - for a while now and maybe the volume got messed up (or may have filled up the 200M of memory allocated to the container as I've seen before cleaning the volumes), or the large collection of docker volumes slowed down Docker altogether?

tschaffter commented 1 year ago

Experiment

The goal of this experiment is to evaluate the effect of cleaning all docker resources - but most importantly the volume used by Thumbor container - on the time it takes to download images from Thumbor.

  1. Install ApacheBench: sudo apt update && sudo apt install apache2-utils
  2. Checkout the main branch
  3. Remove all Docker resources BUT NOT the volumes: docker system prune
  4. Build the images: openchallenges-build-images
  5. Start the stack: nx serve-detach openchallenges-apex
  6. Run the benchmark: ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png and share the results here.
  7. Visit the org search page and confirm that images load slowly when the browser cache is disabled
  8. Check the memory used by the Thumbor and share the value here: docker stats
  9. Stop the stack: workspace-docker-stop
  10. ~Remove ALL Docker resources: docker system prune --volumes~ Disconnect the Thumbor data volume by commenting out this volumes block.
  11. Repeat Steps 4-8
rrchai commented 1 year ago

@rrchai benchmarking results:

Default - TPR: 409.437 ```console vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 40.944 seconds Complete requests: 100 Failed requests: 2 (Connect: 0, Receive: 0, Length: 2, Exceptions: 0) Total transferred: 965594 bytes HTML transferred: 940800 bytes Requests per second: 2.44 [#/sec] (mean) Time per request: 409.437 [ms] (mean) Time per request: 409.437 [ms] (mean, across all concurrent requests) Transfer rate: 23.03 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 192 409 226.5 287 931 Waiting: 0 399 233.1 275 931 Total: 192 409 226.5 287 931 Percentage of the requests served within a certain time (ms) 50% 287 66% 575 75% 644 80% 687 90% 745 95% 816 98% 864 99% 931 100% 931 (longest request) ``` ```console docker stats openchallenges-thumbor CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 9dc4dcfaf95c openchallenges-thumbor 0.00% 174.9MiB / 200MiB 87.47% 1.86MB / 1.61MB 97.3MB / 4.06MB 14 ```
:broom: Default (w/ clean up docker volumes) - TPR: 385.569 ```console vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 38.557 seconds Complete requests: 100 Failed requests: 1 (Connect: 0, Receive: 0, Length: 1, Exceptions: 0) Total transferred: 975447 bytes HTML transferred: 950400 bytes Requests per second: 2.59 [#/sec] (mean) Time per request: 385.569 [ms] (mean) Time per request: 385.569 [ms] (mean, across all concurrent requests) Transfer rate: 24.71 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 1 Processing: 162 385 211.6 264 1001 Waiting: 0 381 214.8 263 1001 Total: 162 386 211.6 264 1001 Percentage of the requests served within a certain time (ms) 50% 264 66% 514 75% 603 80% 631 90% 697 95% 753 98% 833 99% 1001 100% 1001 (longest request) ``` ```console docker stats openchallenges-thumbor CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS fe8f6daaa2d9 openchallenges-thumbor 3.23% 191.6MiB / 200MiB 95.80% 1.27MB / 1.32MB 0B / 3.25MB 15 ```
:broom: Disable Thumbor's volume - TPR: 369.577 ```console vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 36.958 seconds Complete requests: 100 Failed requests: 1 (Connect: 0, Receive: 0, Length: 1, Exceptions: 0) Non-2xx responses: 1 Total transferred: 975610 bytes HTML transferred: 950400 bytes Requests per second: 2.71 [#/sec] (mean) Time per request: 369.577 [ms] (mean) Time per request: 369.577 [ms] (mean, across all concurrent requests) Transfer rate: 25.78 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 184 369 315.8 246 1503 Waiting: 184 369 315.8 245 1503 Total: 184 370 315.8 246 1503 Percentage of the requests served within a certain time (ms) 50% 246 66% 266 75% 294 80% 308 90% 997 95% 1119 98% 1428 99% 1503 100% 1503 (longest request) ``` ```console docker stats openchallenges-thumbor CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS b8b317c439d6 openchallenges-thumbor 2.86% 183.4MiB / 200MiB 91.71% 1.22MB / 1.28MB 102kB / 1.43MB 15 ```
:broom: Increase Thumbor's memory limit to 500M (keep Thumbor's volume)- TPR: 249.576 ```console vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 24.958 seconds Complete requests: 100 Failed requests: 0 Total transferred: 985300 bytes HTML transferred: 960000 bytes Requests per second: 4.01 [#/sec] (mean) Time per request: 249.576 [ms] (mean) Time per request: 249.576 [ms] (mean, across all concurrent requests) Transfer rate: 38.55 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 165 249 55.1 237 517 Waiting: 165 249 55.1 237 517 Total: 165 250 55.1 237 517 Percentage of the requests served within a certain time (ms) 50% 237 66% 257 75% 274 80% 285 90% 324 95% 362 98% 390 99% 517 100% 517 (longest request) ``` ```console docker stats openchallenges-thumbor CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 1dc60c0fdfb3 openchallenges-thumbor 0.00% 291.6MiB / 500MiB 58.31% 1.53MB / 1.39MB 1.31MB / 0B 17 ```
:broom: Increase Thumbor's memory limit to 1000M (keep Thumbor's volume)- TPR: 262.072 vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 26.207 seconds Complete requests: 100 Failed requests: 0 Total transferred: 985300 bytes HTML transferred: 960000 bytes Requests per second: 3.82 [#/sec] (mean) Time per request: 262.072 [ms] (mean) Time per request: 262.072 [ms] (mean, across all concurrent requests) Transfer rate: 36.72 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 1 Processing: 172 262 54.1 245 497 Waiting: 172 262 54.0 245 496 Total: 172 262 54.1 245 497 Percentage of the requests served within a certain time (ms) 50% 245 66% 266 75% 284 80% 295 90% 334 95% 378 98% 433 99% 497 100% 497 (longest request) ``` ```console docker stats openchallenges-thumbor CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS e007175173e5 openchallenges-thumbor 0.00% 303.9MiB / 1000MiB 30.39% 1.23MB / 1.3MB 0B / 0B 18 ```
:broom: Decrease Thumbor's memory limit back to 500M (disable Thumbor's volume)- TPR: 258.811 ```console vscode@5149bd2c0e34:/workspaces/sage-monorepo$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient).....done Server Software: Thumbor/7.4.7 Server Hostname: localhost Server Port: 8889 Document Path: /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png Document Length: 9600 bytes Concurrency Level: 1 Time taken for tests: 25.881 seconds Complete requests: 100 Failed requests: 0 Total transferred: 985300 bytes HTML transferred: 960000 bytes Requests per second: 3.86 [#/sec] (mean) Time per request: 258.811 [ms] (mean) Time per request: 258.811 [ms] (mean, across all concurrent requests) Transfer rate: 37.18 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 1 Processing: 171 259 52.7 248 448 Waiting: 171 258 52.7 248 447 Total: 171 259 52.8 248 448 Percentage of the requests served within a certain time (ms) 50% 248 66% 265 75% 279 80% 297 90% 344 95% 380 98% 403 99% 448 100% 448 (longest request) ``` ```console docker stats openchallenges-thumbor M USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS ad69e5d6a6b5 openchallenges-thumbor 0.00% 288.4MiB / 500MiB 57.67% 1.27MB / 1.34MB 0B / 0B 17 ```
tschaffter commented 1 year ago

Timeout config

vpchung commented 1 year ago

Initial Benchmark

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   30.529 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    3.28 [#/sec] (mean)
Time per request:       305.292 [ms] (mean)
Time per request:       305.292 [ms] (mean, across all concurrent requests)
Transfer rate:          31.52 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   149  305 179.1    202     690
Waiting:      149  305 179.1    202     690
Total:        149  305 179.1    202     690

Percentage of the requests served within a certain time (ms)
  50%    202
  66%    240
  75%    536
  80%    550
  90%    632
  95%    664
  98%    677
  99%    690
 100%    690 (longest request)

Docker stats

CONTAINER ID   NAME                                  CPU %     MEM USAGE / LIMIT   MEM %     NET I/O           BLOCK I/O         PIDS
1079044259e3   openchallenges-thumbor                0.00%     182.8MiB / 200MiB   91.38%    1.4MB / 1.46MB    48.5MB / 2.01MB   14

After commenting out thumbor volume

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   29.002 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    3.45 [#/sec] (mean)
Time per request:       290.022 [ms] (mean)
Time per request:       290.022 [ms] (mean, across all concurrent requests)
Transfer rate:          33.18 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   141  290 167.9    200     701
Waiting:      141  290 167.9    200     700
Total:        141  290 167.9    201     701

Percentage of the requests served within a certain time (ms)
  50%    201
  66%    223
  75%    273
  80%    550
  90%    574
  95%    641
  98%    700
  99%    701
 100%    701 (longest request)

After commenting out thumbor volume

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   28.485 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    3.51 [#/sec] (mean)
Time per request:       284.853 [ms] (mean)
Time per request:       284.853 [ms] (mean, across all concurrent requests)
Transfer rate:          33.78 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   150  285 166.1    202     709
Waiting:      150  285 166.1    202     709
Total:        150  285 166.1    202     709

Percentage of the requests served within a certain time (ms)
  50%    202
  66%    216
  75%    271
  80%    538
  90%    587
  95%    645
  98%    703
  99%    709
 100%    709 (longest request)
CONTAINER ID   NAME                     CPU %     MEM USAGE / LIMIT   MEM %     NET I/O          BLOCK I/O         PIDS
6986c2fea6e1   openchallenges-thumbor   0.00%     186.6MiB / 200MiB   93.28%    1.2MB / 1.26MB   33.6MB / 1.14MB   15
tschaffter commented 1 year ago

Update

The reason Thumbor was responding faster for me is because result storage was disable, which is what I was exploring in this ticket but failed to revert because the property RESULT_STORAGE was defined twice in .env:

RESULT_STORAGE=thumbor_aws.result_storage
RESULT_STORAGE=thumbor.result_storages.no_storage # OVERWRITES THE PREVISOUS VALUE
tschaffter commented 1 year ago

Results

Storing the results to S3 (current)

thumbor/.env:

RESULT_STORAGE=thumbor_aws.result_storage
...

Benchmark:

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   41.111 seconds
Complete requests:      100
Failed requests:        1
   (Connect: 0, Receive: 0, Length: 1, Exceptions: 0)
Non-2xx responses:      1
Total transferred:      975610 bytes
HTML transferred:       950400 bytes
Requests per second:    2.43 [#/sec] (mean)
Time per request:       411.113 [ms] (mean)
Time per request:       411.113 [ms] (mean, across all concurrent requests)
Transfer rate:          23.17 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:   159  411 276.0    266    1493
Waiting:      159  411 276.0    266    1493
Total:        159  411 276.0    266    1493

Percentage of the requests served within a certain time (ms)
  50%    266
  66%    384
  75%    587
  80%    701
  90%    853
  95%    970
  98%   1075
  99%   1493
 100%   1493 (longest request)

Thumbor logs:

$ docker logs -f openchallenges-thumbor
2023-06-19 15:30:24 thumbor:INFO [RESULT_STORAGE] Image retrieved successfully at img-cache/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png.
2023-06-19 15:30:24 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 249.24ms
2023-06-19 15:30:24 thumbor:INFO [RESULT_STORAGE] Image retrieved successfully at img-cache/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png.
2023-06-19 15:30:24 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 251.02ms
...

Storing the results to the filesystem

thumbor/.env:

RESULT_STORAGE=thumbor.result_storages.file_storage

Benchmark:

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   0.256 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    390.25 [#/sec] (mean)
Time per request:       2.562 [ms] (mean)
Time per request:       2.562 [ms] (mean, across all concurrent requests)
Transfer rate:          3754.97 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:     1    2   1.5      2      10
Waiting:        1    2   1.3      2       9
Total:          1    3   1.5      2      10

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      3
  90%      5
  95%      6
  98%      8
  99%     10
 100%     10 (longest request)

Thumbor logs:

$ docker logs -f openchallenges-thumbor
2023-06-19 15:36:32 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 5.45ms
2023-06-19 15:36:32 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 1.42ms
2023-06-19 15:36:32 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 1.37ms
...

No result storage

thumbor/.env:

RESULT_STORAGE=thumbor.result_storages.no_storage

Benchmark:

$ ab -n 100 http://localhost:8889/v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:        Thumbor/7.4.7
Server Hostname:        localhost
Server Port:            8889

Document Path:          /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png
Document Length:        9600 bytes

Concurrency Level:      1
Time taken for tests:   2.063 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      985300 bytes
HTML transferred:       960000 bytes
Requests per second:    48.48 [#/sec] (mean)
Time per request:       20.625 [ms] (mean)
Time per request:       20.625 [ms] (mean, across all concurrent requests)
Transfer rate:          466.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:    12   21  27.7     15     287
Waiting:       11   20  27.7     15     287
Total:         12   21  27.7     15     287

Percentage of the requests served within a certain time (ms)
  50%     15
  66%     18
  75%     21
  80%     22
  90%     27
  95%     35
  98%     42
  99%    287
 100%    287 (longest request)

Thumbor logs:

$ docker logs -f openchallenges-thumbor
2023-06-19 15:33:23 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 27.64ms
2023-06-19 15:33:23 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 12.46ms
2023-06-19 15:33:23 tornado.access:INFO 200 GET /v7P2QbvYYxWnBLJeePXFv-1Y0UY=/140x140/logo/dfci.png (172.21.0.1) 11.77ms
...