Download rate limit to 10rps.
This commit is contained in:
parent
b67b4b4335
commit
cae76b2d53
|
@ -177,13 +177,13 @@ location /skynet/skyfile {
|
||||||
limit_req zone=uploads_by_ip burst=10 nodelay;
|
limit_req zone=uploads_by_ip burst=10 nodelay;
|
||||||
limit_req zone=uploads_by_ip_throttled;
|
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_req zone=downloads_by_ip_throttled;
|
||||||
|
|
||||||
limit_conn upload_conn 5;
|
limit_conn upload_conn 5;
|
||||||
limit_conn upload_conn_rl 1;
|
limit_conn upload_conn_rl 1;
|
||||||
|
|
||||||
limit_conn download_conn 3;
|
limit_conn download_conn 10;
|
||||||
limit_conn download_conn_rl 1;
|
limit_conn download_conn_rl 1;
|
||||||
|
|
||||||
client_max_body_size 1000M; # make sure to limit the size of upload to a sane value
|
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 burst=10 nodelay;
|
||||||
limit_req zone=uploads_by_ip_throttled;
|
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_req zone=downloads_by_ip_throttled;
|
||||||
|
|
||||||
limit_conn upload_conn 3;
|
limit_conn upload_conn 3;
|
||||||
limit_conn upload_conn_rl 1;
|
limit_conn upload_conn_rl 1;
|
||||||
|
|
||||||
limit_conn download_conn 3;
|
limit_conn download_conn 10;
|
||||||
limit_conn download_conn_rl 1;
|
limit_conn download_conn_rl 1;
|
||||||
|
|
||||||
# TUS chunks size is 40M + leaving 10M of breathing room
|
# 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 burst=10 nodelay;
|
||||||
limit_req zone=uploads_by_ip_throttled;
|
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_req zone=downloads_by_ip_throttled;
|
||||||
|
|
||||||
limit_conn upload_conn 3;
|
limit_conn upload_conn 3;
|
||||||
limit_conn upload_conn_rl 1;
|
limit_conn upload_conn_rl 1;
|
||||||
|
|
||||||
limit_conn download_conn 3;
|
limit_conn download_conn 10;
|
||||||
limit_conn download_conn_rl 1;
|
limit_conn download_conn_rl 1;
|
||||||
|
|
||||||
proxy_set_header User-Agent: Sia-Agent;
|
proxy_set_header User-Agent: Sia-Agent;
|
||||||
|
|
|
@ -99,8 +99,8 @@ http {
|
||||||
limit_req_zone $binary_remote_addr zone=uploads_by_ip:10m rate=10r/s;
|
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 $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 $binary_remote_addr zone=downloads_by_ip:10m rate=10r/s;
|
||||||
limit_req_zone $limit_key zone=downloads_by_ip_throttled:10m rate=3r/m;
|
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 $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;
|
limit_req_zone $limit_key zone=registry_access_by_ip_throttled:10m rate=20r/m;
|
||||||
|
|
Reference in New Issue