1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

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
This commit is contained in:
Chocobozzz 2022-12-23 13:38:28 +01:00
parent 7624270a63
commit 1fed9cb8d3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 20 additions and 32 deletions

View file

@ -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