Raise the upload rate limit to 30/min, burst 20
Test and deploy / test (push) Successful in 1m54s
Test and deploy / deploy (push) Successful in 1m2s

Dropping several pictures onto a canvas page uploads them all at once,
which the old 5/min, burst 3 limit cut off after three. Uploading needs
a signed-in user and accounts are admin-created, so a far higher
ceiling is still safe against filling the volume.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 23:48:44 +01:00
co-authored by Claude Opus 5.5
parent 30e1fb31d8
commit 30918eefaa
6 changed files with 12 additions and 8 deletions
+7 -3
View File
@@ -89,8 +89,12 @@ http {
# (Production only; the dev template omits it.
# Its location is at the bottom of this file,
# not in the shared route table.)
# upload 5r/m burst=3 - uploads are 50MB-capable and hit disk; this
# bounds how fast one IP can fill the volume.
# upload 30r/m burst=20 - uploads hit disk; this bounds how fast one IP
# can fill the volume. Generous because only a
# signed-in user can upload and accounts are
# admin-created, and because dropping a batch of
# pictures onto a canvas page uploads them all
# at once — the burst lets ~20 through together.
# hotel_search 3r/m burst=2 - each request holds an upstream call to
# Travelodge/TfL for up to a few minutes and the
# Python side has a single search slot, so this is
@@ -109,7 +113,7 @@ http {
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s;
limit_req_zone $binary_remote_addr zone=graphql:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=upload:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=upload:10m rate=30r/m;
limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m;
log_format compact
+1 -1
View File
@@ -54,7 +54,7 @@ http {
# kept equal to production so a limit that would bite there bites here too.
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s;
limit_req_zone $binary_remote_addr zone=upload:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=upload:10m rate=30r/m;
limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m;
log_format compact
+1 -1
View File
@@ -148,7 +148,7 @@
}
location $BACKEND_ENDPOINT/messages/upload {
limit_req zone=upload burst=3 nodelay;
limit_req zone=upload burst=20 nodelay;
rewrite ^$BACKEND_ENDPOINT/(.*)$ /$1 break;
proxy_pass $upstream_backend;
proxy_set_header Host $host;