diff --git a/example_config.yaml b/example_config.yaml index d9eb484..beae654 100644 --- a/example_config.yaml +++ b/example_config.yaml @@ -12,15 +12,6 @@ chihaya: # For more info see: https://prometheus.io prometheus_addr: "0.0.0.0:6880" - # The maximum number of peers returned in an announce. - max_numwant: 50 - - # The default number of peers returned in an announce. - default_numwant: 25 - - # The number of infohashes a single scrape can request before being truncated. - max_scrape_infohashes: 50 - # This block defines configuration for the tracker's HTTP interface. # If you do not wish to run this, delete this section. http: @@ -113,6 +104,9 @@ chihaya: name: memory config: # The frequency which stale peers are removed. + # This balances between + # - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value) + # - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value). gc_interval: 3m # The amount of time until a peer is considered stale. @@ -132,6 +126,9 @@ chihaya: # name: redis # config: # # The frequency which stale peers are removed. + # # This balances between + # # - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value) + # # - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value). # gc_interval: 14m # # The frequency which metrics are pushed into a local Prometheus endpoint. diff --git a/frontend/http/parser.go b/frontend/http/parser.go index a34e3ba..ca53e87 100644 --- a/frontend/http/parser.go +++ b/frontend/http/parser.go @@ -22,9 +22,9 @@ type ParseOptions struct { // Default parser config constants. const ( - defaultMaxNumWant uint32 = 100 - defaultDefaultNumWant uint32 = 50 - defaultMaxScrapeInfoHashes uint32 = 50 + defaultMaxNumWant = 100 + defaultDefaultNumWant = 50 + defaultMaxScrapeInfoHashes = 50 ) // ParseAnnounce parses an bittorrent.AnnounceRequest from an http.Request. diff --git a/frontend/udp/parser.go b/frontend/udp/parser.go index ca12fc4..96ea9d8 100644 --- a/frontend/udp/parser.go +++ b/frontend/udp/parser.go @@ -60,9 +60,9 @@ type ParseOptions struct { // Default parser config constants. const ( - defaultMaxNumWant uint32 = 100 - defaultDefaultNumWant uint32 = 50 - defaultMaxScrapeInfoHashes uint32 = 50 + defaultMaxNumWant = 100 + defaultDefaultNumWant = 50 + defaultMaxScrapeInfoHashes = 50 ) // ParseAnnounce parses an AnnounceRequest from a UDP request.