ceph/examples/rgw-cache/nginx-slicing.conf

138 lines
5.1 KiB
Plaintext
Raw Normal View History

rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
#config cache size and path to the cache directory, you should make sure that the user that is running nginx have permissions to access the cache directory
#max_size means that Nginx will not cache more than 20G, It should be tuned to a larger number if the /data/cache is bigger
proxy_cache_path /data/cache levels=2:2:2 keys_zone=mycache:999m max_size=20G inactive=1d use_temp_path=off;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
upstream rgws {
# List of all rgws (ips or resolvable names)
server rgw1:8000 max_fails=2 fail_timeout=5s;
server rgw2:8000 max_fails=2 fail_timeout=5s;
server rgw3:8000 max_fails=2 fail_timeout=5s;
}
server {
listen 80;
server_name cacher;
location /authentication {
internal;
client_max_body_size 0;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
proxy_pass http://rgws$request_uri;
proxy_pass_request_body off;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
proxy_set_header Host $host;
# setting x-rgw-auth allow the RGW the ability to only authorize the request without fetching the obj data
proxy_set_header x-rgw-auth "yes";
proxy_set_header Authorization $http_authorization;
proxy_http_version 1.1;
proxy_method $request_method;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
# Do not convert HEAD requests into GET requests
proxy_cache_convert_head off;
error_page 404 = @outage;
proxy_intercept_errors on;
if ($request_uri = "/") {
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
return 200;
}
# URI included with question mark is not being cached
if ($request_uri ~* (\?)) {
return 200;
}
if ($request_method = "PUT") {
return 200;
}
if ($request_method = "POST") {
return 200;
}
if ($request_method = "HEAD") {
return 200;
}
if ($request_method = "COPY") {
return 200;
}
if ($request_method = "DELETE") {
return 200;
}
if ($http_if_match) {
return 200;
}
if ($http_authorization !~* "aws4_request") {
return 200;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
}
}
location @outage{
return 403;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
}
location / {
slice 1m;
auth_request /authentication;
proxy_set_header Range $slice_range;
proxy_pass http://rgws;
set $authvar '';
# if $do_not_cache is not empty the request would not be cached, this is relevant for list op for example
set $do_not_cache '';
# the IP or name of the RGWs
rewrite_by_lua_file /etc/nginx/nginx-lua-file.lua;
#proxy_set_header Authorization $http_authorization;
# my cache configured at the top of the file
proxy_cache mycache;
proxy_cache_lock_timeout 0s;
proxy_cache_lock_age 1000s;
proxy_http_version 1.1;
set $date $aws_auth_date;
# Getting 403 if this header not set
proxy_set_header Host $host;
# Cache all 200 OK's for 1 day
proxy_cache_valid 200 206 1d;
# Use stale cache file in all errors from upstream if we can
proxy_cache_use_stale updating;
proxy_cache_background_update on;
# Try to check if etag have changed, if yes, do not re-fetch from rgw the object
proxy_cache_revalidate on;
# Lock the cache so that only one request can populate it at a time
proxy_cache_lock on;
# prevent convertion of head requests to get requests
proxy_cache_convert_head off;
# Listing all buckets should not be cached
if ($request_uri = "/") {
set $do_not_cache "no";
set $date $http_x_amz_date;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
}
# URI including question mark are not supported to prevent bucket listing cache
if ($request_uri ~* (\?)) {
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
set $do_not_cache "no";
set $date $http_x_amz_date;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
}
# Only aws4 requests are being cached - As the aws auth module supporting only aws v2
if ($http_authorization !~* "aws4_request") {
set $date $http_x_amz_date;
}
if ($request_method = "PUT") {
set $date $http_x_amz_date;
}
if ($request_method = "POST") {
set $date $http_x_amz_date;
}
if ($request_method = "HEAD") {
set $do_not_cache "no";
set $date $http_x_amz_date;
}
if ($request_method = "COPY") {
set $do_not_cache "no";
set $date $http_x_amz_date;
}
if ($http_if_match) {
#set $do_not_cache "no";
set $date $http_x_amz_date;
set $myrange $slice_range;
}
if ($request_method = "DELETE") {
set $do_not_cache "no";
set $date $http_x_amz_date;
}
proxy_set_header if_match $http_if_match;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
# Use the original x-amz-date if the aws auth module didn't create one
proxy_set_header x-amz-date $date;
proxy_set_header X-Amz-Cache $authvar;
proxy_no_cache $do_not_cache;
proxy_set_header Authorization $awsauthfour;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
# This is on which content the nginx to use for hashing the cache keys
proxy_cache_key "$request_uri$request_method$request_body$slice_range";
client_max_body_size 0;
rgw: Adding data cache and CDN capabilities This feature is meant to add data cache feature to the RGW. It is using Nginx as a cache server. This feature adds 2 new apis, Auth api and Cache api. Some Performance tests using hsbench: 16K objs: RGW direct access: Mode: GET, Ops: 3001, MB/s: 46.89, Lat(ms): [ min: 30.4, avg: 33.2, 99%: 34.7, max: 35.2 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1363, MB/s: 21.30, Lat(ms): [ min: 63.8, avg: 73.8, 99%: 78.1, max: 86.6 ] Nginx access (objs have been cached) Mode: GET, Ops: 2446, MB/s: 38.22, Lat(ms): [ min: 36.9, avg: 41.0, 99%: 43.9, max: 45.9 ] 512K objs: RGW direct access: Mode: GET, Ops: 1492, MB/s: 746.00 Lat(ms): [ min: 60.4, avg: 66.7, 99%: 73.5, max: 75.9 ] Nginx access (objs have not been cached) Mode: GET, Ops: 1382, MB/s: 691.00, Lat(ms): [ min: 64.5, avg: 72.1, 99%: 77.9, max: 82.8 ] Nginx access (objs have been cached) Mode: GET, Ops: 2947, MB/s: 1473.50, Lat(ms): [ min: 3.3, avg: 32.7, 99%: 62.2, max: 72.1 ] 2M objs: RGW direct access: Mode: GET, Ops: 613, MB/s: 1226.00, Lat(ms): [ min: 143.6, avg: 162.0, 99%: 180.2, max: 190.1 ] Nginx access (objs have not been cached) Mode: GET, Ops: 462, MB/s: 924.00, Lat(ms): [ min: 180.2, avg: 215.0, 99%: 243.2, max: 248.3 ] Nginx access (objs have been cached) Mode: GET, Ops: 1392, MB/s: 2784.00, Lat(ms): [ min: 3.0, avg: 5.3, 99%: 18.8, max: 30.2 ] 10M objs: RGW direct access: Mode: GET, Ops: 135, MB/s: 1350.00, Lat(ms): [ min: 191.1, avg: 265.8, 99%: 373.1, max: 382.8 ] Nginx access (objs have not been cached) Mode: GET, Ops: 120, MB/s: 1200.00, Lat(ms): [ min: 302.1, avg: 428.8, 99%: 561.2, max: 583.7 ] Nginx access (objs have been cached) Mode: GET, Ops: 281, MB/s: 2810.00, Lat(ms): [ min: 3.2, avg: 8.3, 99%: 16.9, max: 25.6 ] gdal_translate 4GiB image gdal_translate -co NUM_THREADS=ALL_CPUS /vsis3/hello/sat.tif Nginx (have not cached): real 0m24.714s user 0m8.692s sys 0m10.360s Nginx (have been cached): real 0m21.070s user 0m9.140s sys 0m10.316s RGW: real 0m21.859s user 0m8.850s sys 0m10.386s The results are showing that for objects larger than 512K the cache will increase the performance by twice or more. For small objs, the overhead of sending the auth request will make the cache less efficient The result for cached objects in the 10MB test can be explained by net limit of 25 Gb/s(it could reach more) In Gdal (image decoder/encoder over s3 using range requests) the results were not that different because of Gdal single cpu encoding/decoding. Gdal have been chosen because of the ability to check the smart cache of the nginx. https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ Signed-off-by: Or Friedmann <ofriedma@redhat.com>
2020-02-03 10:36:10 +00:00
}
}