diff options
author | Chocobozzz <me@florianbigard.com> | 2022-12-23 13:38:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-12-23 13:40:42 +0100 |
commit | 1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6 (patch) | |
tree | 8d751c61e63527570907d08dac2158b7483dc731 /server/initializers/constants.ts | |
parent | 7624270a63c47c90b6cc12d5331b2803ee1d004c (diff) | |
download | PeerTube-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.ts | 5 |
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 | ||
890 | const P2P_MEDIA_LOADER_PEER_VERSION = 2 | 893 | const P2P_MEDIA_LOADER_PEER_VERSION = 2 |