From cae76b2d5398f0c15024a593c27562111d9f3369 Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Wed, 8 Dec 2021 18:08:14 +0100 Subject: [PATCH] Download rate limit to 10rps. --- docker/nginx/conf.d/server/server.api | 12 ++++++------ docker/nginx/nginx.conf | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/nginx/conf.d/server/server.api b/docker/nginx/conf.d/server/server.api index 4e6a4b7b..19ecea6a 100644 --- a/docker/nginx/conf.d/server/server.api +++ b/docker/nginx/conf.d/server/server.api @@ -177,13 +177,13 @@ location /skynet/skyfile { limit_req zone=uploads_by_ip burst=10 nodelay; limit_req zone=uploads_by_ip_throttled; - limit_req zone=downloads_by_ip burst=3 nodelay; + limit_req zone=downloads_by_ip burst=10 nodelay; limit_req zone=downloads_by_ip_throttled; limit_conn upload_conn 5; limit_conn upload_conn_rl 1; - limit_conn download_conn 3; + limit_conn download_conn 10; limit_conn download_conn_rl 1; client_max_body_size 1000M; # make sure to limit the size of upload to a sane value @@ -221,13 +221,13 @@ location /skynet/tus { limit_req zone=uploads_by_ip burst=10 nodelay; limit_req zone=uploads_by_ip_throttled; - limit_req zone=downloads_by_ip burst=3 nodelay; + limit_req zone=downloads_by_ip burst=10 nodelay; limit_req zone=downloads_by_ip_throttled; limit_conn upload_conn 3; limit_conn upload_conn_rl 1; - limit_conn download_conn 3; + limit_conn download_conn 10; limit_conn download_conn_rl 1; # TUS chunks size is 40M + leaving 10M of breathing room @@ -298,13 +298,13 @@ location /skynet/pin { limit_req zone=uploads_by_ip burst=10 nodelay; limit_req zone=uploads_by_ip_throttled; - limit_req zone=downloads_by_ip burst=3 nodelay; + limit_req zone=downloads_by_ip burst=10 nodelay; limit_req zone=downloads_by_ip_throttled; limit_conn upload_conn 3; limit_conn upload_conn_rl 1; - limit_conn download_conn 3; + limit_conn download_conn 10; limit_conn download_conn_rl 1; proxy_set_header User-Agent: Sia-Agent; diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 6310f2c8..5db0a05d 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -99,8 +99,8 @@ http { limit_req_zone $binary_remote_addr zone=uploads_by_ip:10m rate=10r/s; limit_req_zone $limit_key zone=uploads_by_ip_throttled:10m rate=10r/m; - limit_req_zone $binary_remote_addr zone=downloads_by_ip:10m rate=3r/s; - limit_req_zone $limit_key zone=downloads_by_ip_throttled:10m rate=3r/m; + limit_req_zone $binary_remote_addr zone=downloads_by_ip:10m rate=10r/s; + limit_req_zone $limit_key zone=downloads_by_ip_throttled:10m rate=10r/m; limit_req_zone $binary_remote_addr zone=registry_access_by_ip:10m rate=60r/m; limit_req_zone $limit_key zone=registry_access_by_ip_throttled:10m rate=20r/m;