Skip to content

Instantly share code, notes, and snippets.

@DarthSim
Created February 11, 2022 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarthSim/f3d78285b4dcc84ab22a5ae7ff18ffb5 to your computer and use it in GitHub Desktop.
Save DarthSim/f3d78285b4dcc84ab22a5ae7ff18ffb5 to your computer and use it in GitHub Desktop.

Для тестов использовались latest версии darthsim/imgproxy и mtsrus/image-optimize.

В качестве тестового изображения использовалась https://labeg.ru/content/images/portfolio/avilex/ncuo_10-1920w.jpg. в качестве источника использовался локально поднятый Nginx.

Для создания нагрузки и снятия метрик использовалась утилита ab:

ab -n 1000 -c 4 $url

картинка ресайзится до with 500 и сохраняется в WebP с качеством 80 и в AVIF с качеством 50.

URL для imgproxy:

http://127.0.0.1:8082/unsigned/rs:fit:500/q:80/plain/http://host.docker.internal/ncuo_10-1920w.jpg@webp
http://127.0.0.1:8082/unsigned/rs:fit:500/q:50/plain/http://host.docker.internal/ncuo_10-1920w.jpg@avif

URL для MTS image optimize:

http://127.0.0.1:3000/optimize?size=500&format=webp&quality=80&src=http://host.docker.internal/ncuo_10-1920w.jpg
http://127.0.0.1:3000/optimize?size=500&format=avif&quality=50&src=http://host.docker.internal/ncuo_10-1920w.jpg

Результаты

imgproxy AVIF

Server Software:        imgproxy
Server Hostname:        127.0.0.1
Server Port:            8082

Document Path:          /unsigned/rs:fit:500/q:50/plain/http://host.docker.internal/ncuo_10-1920w.jpg@avif
Document Length:        27201 bytes

Concurrency Level:      4
Time taken for tests:   357.336 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      27498000 bytes
HTML transferred:       27201000 bytes
Requests per second:    2.80 [#/sec] (mean)
Time per request:       1429.343 [ms] (mean)
Time per request:       357.336 [ms] (mean, across all concurrent requests)
Transfer rate:          75.15 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       6
Processing:   642 1426 177.4   1397    2255
Waiting:      642 1425 177.3   1397    2254
Total:        643 1426 177.4   1398    2255

Percentage of the requests served within a certain time (ms)
  50%   1398
  66%   1467
  75%   1506
  80%   1536
  90%   1642
  95%   1770
  98%   1894
  99%   2091
 100%   2255 (longest request)

MTS image optimize AVIF

Server Software:
Server Hostname:        127.0.0.1
Server Port:            3000

Document Path:          /optimize?size=500&format=avif&quality=50&src=http://host.docker.internal/ncuo_10-1920w.jpg
Document Length:        28051 bytes

Concurrency Level:      4
Time taken for tests:   370.485 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      28242000 bytes
HTML transferred:       28051000 bytes
Requests per second:    2.70 [#/sec] (mean)
Time per request:       1481.942 [ms] (mean)
Time per request:       370.485 [ms] (mean, across all concurrent requests)
Transfer rate:          74.44 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       9
Processing:   612 1478 166.7   1457    2562
Waiting:      611 1478 166.7   1457    2562
Total:        612 1479 166.7   1458    2562

Percentage of the requests served within a certain time (ms)
  50%   1458
  66%   1512
  75%   1547
  80%   1567
  90%   1634
  95%   1722
  98%   2005
  99%   2201
 100%   2562 (longest request)

imgproxy WebP

Server Software:        imgproxy
Server Hostname:        127.0.0.1
Server Port:            8082

Document Path:          /unsigned/rs:fit:500/q:80/plain/http://host.docker.internal/ncuo_10-1920w.jpg@webp
Document Length:        45896 bytes

Concurrency Level:      4
Time taken for tests:   29.618 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      46193000 bytes
HTML transferred:       45896000 bytes
Requests per second:    33.76 [#/sec] (mean)
Time per request:       118.471 [ms] (mean)
Time per request:       29.618 [ms] (mean, across all concurrent requests)
Transfer rate:          1523.09 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:    86  118  63.8    110    1126
Waiting:       86  117  63.7    110    1126
Total:         86  118  63.8    111    1126

Percentage of the requests served within a certain time (ms)
  50%    111
  66%    115
  75%    119
  80%    121
  90%    129
  95%    140
  98%    170
  99%    203
 100%   1126 (longest request)

MTS image optimize WebP

Server Software:
Server Hostname:        127.0.0.1
Server Port:            3000

Document Path:          /optimize?size=500&format=webp&quality=80&src=http://host.docker.internal/ncuo_10-1920w.jpg
Document Length:        45576 bytes

Concurrency Level:      4
Time taken for tests:   36.563 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      45767000 bytes
HTML transferred:       45576000 bytes
Requests per second:    27.35 [#/sec] (mean)
Time per request:       146.250 [ms] (mean)
Time per request:       36.563 [ms] (mean, across all concurrent requests)
Transfer rate:          1222.41 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       3
Processing:    68  145  44.4    139     625
Waiting:       68  145  44.4    138     625
Total:         68  146  44.4    139     625

Percentage of the requests served within a certain time (ms)
  50%    139
  66%    148
  75%    154
  80%    158
  90%    171
  95%    195
  98%    261
  99%    357
 100%    625 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment