aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-23 13:38:28 +0100
committerChocobozzz <me@florianbigard.com>2022-12-23 13:40:42 +0100
commit1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6 (patch)
tree8d751c61e63527570907d08dac2158b7483dc731 /server/initializers/constants.ts
parent7624270a63c47c90b6cc12d5331b2803ee1d004c (diff)
downloadPeerTube-1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6.tar.gz
PeerTube-1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6.tar.zst
PeerTube-1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6.zip
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
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts5
1 files changed, 4 insertions, 1 deletions
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 = {
781 VIDEO_TOKENS: { 781 VIDEO_TOKENS: {
782 MAX_SIZE: 100_000, 782 MAX_SIZE: 100_000,
783 TTL: parseDurationToMs('8 hours') 783 TTL: parseDurationToMs('8 hours')
784 },
785 TRACKER_IPS: {
786 MAX_SIZE: 100_000
784 } 787 }
785} 788}
786 789
@@ -884,7 +887,7 @@ const TRACKER_RATE_LIMITS = {
884 INTERVAL: 60000 * 5, // 5 minutes 887 INTERVAL: 60000 * 5, // 5 minutes
885 ANNOUNCES_PER_IP_PER_INFOHASH: 15, // maximum announces per torrent in the interval 888 ANNOUNCES_PER_IP_PER_INFOHASH: 15, // maximum announces per torrent in the interval
886 ANNOUNCES_PER_IP: 30, // maximum announces for all our torrents in the interval 889 ANNOUNCES_PER_IP: 30, // maximum announces for all our torrents in the interval
887 BLOCK_IP_LIFETIME: 60000 * 3 // 3 minutes 890 BLOCK_IP_LIFETIME: parseDurationToMs('3 minutes')
888} 891}
889 892
890const P2P_MEDIA_LOADER_PEER_VERSION = 2 893const P2P_MEDIA_LOADER_PEER_VERSION = 2