From 1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Dec 2022 13:38:28 +0100 Subject: Don't need to use redis to block tracker ips There could be many of them, so reduce load by storing IPs directly inside node memory --- server/initializers/constants.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/initializers/constants.ts') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 0e56f0c9f..ec5045078 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -781,6 +781,9 @@ const LRU_CACHE = { VIDEO_TOKENS: { MAX_SIZE: 100_000, TTL: parseDurationToMs('8 hours') + }, + TRACKER_IPS: { + MAX_SIZE: 100_000 } } @@ -884,7 +887,7 @@ const TRACKER_RATE_LIMITS = { INTERVAL: 60000 * 5, // 5 minutes ANNOUNCES_PER_IP_PER_INFOHASH: 15, // maximum announces per torrent in the interval ANNOUNCES_PER_IP: 30, // maximum announces for all our torrents in the interval - BLOCK_IP_LIFETIME: 60000 * 3 // 3 minutes + BLOCK_IP_LIFETIME: parseDurationToMs('3 minutes') } const P2P_MEDIA_LOADER_PEER_VERSION = 2 -- cgit v1.2.3