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

Check performance of libjpeg-turbo in a dockerized setup #150

Closed
randomorder opened this issue Jul 9, 2024 · 3 comments
Closed

Check performance of libjpeg-turbo in a dockerized setup #150

randomorder opened this issue Jul 9, 2024 · 3 comments
Assignees

Comments

@randomorder
Copy link
Member

In the dockerfile we are downloading and building the libjpeg-turbo native libraries from source with the goal of getting better performance on jpeg compression.

It is not clear though with recent JVM versions what the benefit is in terms of performance. We want to run a quick benchmark and evaluate if it is still worth building and installing the native libraries in the docker image.

@randomorder randomorder self-assigned this Jul 9, 2024
@randomorder randomorder assigned mo3rfan and unassigned randomorder Jul 16, 2024
@randomorder
Copy link
Member Author

randomorder commented Jul 16, 2024

@mo3rfan
We want to run a simple benchmark with Apache AB https://httpd.apache.org/docs/2.4/programs/ab.html to test the performance of JPEG compression with and without the libjpeg-turbo plugin installed in the docker image.

The request hitting geoserver can be a fixed WMS GetMap request in the jpeg format. Please provide here the outcome of the tests along with the test setup.

@mo3rfan
Copy link
Contributor

mo3rfan commented Jul 18, 2024

It does feel like the build without libjpeg-turbo is slightly faster on my M1 macos. I ran the ab tool with -n 200 -c 20 on this URL:

http://localhost/geoserver/wms?request=GetMap&service=WMS&version=1.1.1&layers=topp%3Astates&styles=population&srs=EPSG%3A4326&bbox=-145.15104058007,21.731919794922,-57.154894212888,58.961058642578&&width=780&height=330&format=image%2Fjpeg

I also had to run the ab tool many times over on the same test setup to get results that are 'more stable'.

Without libjpeg-turbo

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)


Server Software:        nginx
Server Hostname:        localhost
Server Port:            80

Document Path:          /geoserver/wms?request=GetMap&service=WMS&version=1.1.1&layers=topp%3Astates&styles=population&srs=EPSG%3A4326&bbox=-145.15104058007,21.731919794922,-57.154894212888,58.961058642578&&width=780&height=330&format=image%2Fjpeg
Document Length:        23750 bytes

Concurrency Level:      20
Time taken for tests:   2.235 seconds
Complete requests:      200
Failed requests:        0
Total transferred:      4869000 bytes
HTML transferred:       4750000 bytes
Requests per second:    89.47 [#/sec] (mean)
Time per request:       223.541 [ms] (mean)
Time per request:       11.177 [ms] (mean, across all concurrent requests)
Transfer rate:          2127.08 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    3   2.3      2      17
Processing:    67  209  70.1    210     469
Waiting:       53  207  70.3    208     468
Total:         69  212  70.0    212     471

Percentage of the requests served within a certain time (ms)
  50%    212
  66%    241
  75%    254
  80%    263
  90%    290
  95%    318
  98%    402
  99%    456
 100%    471 (longest request)

With libjpeg-turbo

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)


Server Software:        nginx
Server Hostname:        localhost
Server Port:            80

Document Path:          /geoserver/wms?request=GetMap&service=WMS&version=1.1.1&layers=topp%3Astates&styles=population&srs=EPSG%3A4326&bbox=-145.15104058007,21.731919794922,-57.154894212888,58.961058642578&&width=780&height=330&format=image%2Fjpeg
Document Length:        23750 bytes

Concurrency Level:      20
Time taken for tests:   2.402 seconds
Complete requests:      200
Failed requests:        0
Total transferred:      4869000 bytes
HTML transferred:       4750000 bytes
Requests per second:    83.27 [#/sec] (mean)
Time per request:       240.174 [ms] (mean)
Time per request:       12.009 [ms] (mean, across all concurrent requests)
Transfer rate:          1979.77 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    3   3.3      2      21
Processing:    80  225  71.7    222     728
Waiting:       59  222  71.3    217     727
Total:         83  228  71.9    224     731

Percentage of the requests served within a certain time (ms)
  50%    224
  66%    251
  75%    272
  80%    284
  90%    306
  95%    338
  98%    380
  99%    424
 100%    731 (longest request)

@randomorder
Copy link
Member Author

Ok, there is no point in keeping libjpeg-turbo in the dockerfile then. Removing it will improve the build time of the docker images and get a lower footprint in terms of image size.

Thanks @mo3rfan

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

No branches or pull requests

2 participants