Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-01 02:12:15 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-01 02:12:15 +0300
commit17c333c2a8de78c08dd070431652cc844fcc7b57 (patch)
tree740e9d1331a0a3adf9ba7515f7bb5ddc8d67c3d2 /app.go
parentaa91e391469b832a925ebe81cdf575b1ea59c2ad (diff)
chore: update method names
Diffstat (limited to 'app.go')
-rw-r--r--app.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/app.go b/app.go
index 1cbce369..fdebf56f 100644
--- a/app.go
+++ b/app.go
@@ -267,6 +267,9 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) {
if a.config.RateLimit.SourceIPLimitPerSecond > 0 {
rl := ratelimiter.New(
lru.New("source_ip",
+ // based on an avg ~4,000 unique IPs per minute
+ // https://log.gprd.gitlab.net/app/lens#/edit/f7110d00-2013-11ec-8c8e-ed83b5469915?_g=h@e78830b
+ lru.WithMaxSize(5000),
lru.WithCachedEntriesMetric(metrics.RateLimitSourceIPCachedEntries),
lru.WithCachedRequestsMetric(metrics.RateLimitSourceIPCacheRequests),
),