-
-
Notifications
You must be signed in to change notification settings - Fork 344
Throttling enabled #227
base: master
Are you sure you want to change the base?
Throttling enabled #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
cmd/magneticod/main.go
Outdated
@@ -140,7 +141,8 @@ func parseFlags() (*opFlags, error) { | |||
IndexerInterval uint `long:"indexer-interval" description:"Indexing interval in integer seconds." default:"1"` | |||
IndexerMaxNeighbors uint `long:"indexer-max-neighbors" description:"Maximum number of neighbors of an indexer." default:"10000"` | |||
|
|||
LeechMaxN uint `long:"leech-max-n" description:"Maximum number of leeches." default:"200"` | |||
LeechMaxN uint `long:"leech-max-n" description:"Maximum number of leeches." default:"200"` | |||
MaxThrottle uint `long:"max-throttle" description:"Maximum requests per second." default:"0"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably called this variable more precisely. Probably MaxRps
and --max-rps
or something more self-describing as a parameter name.
I'm trying to build it, but I'm getting
|
This seems to work pretty fine. |
Hi @lruggieri
What is mps? It seems requests per second but which requests are you talking about? DHT or BitTorrent? |
Added a simple throttler to limit the mps. Nothing fancy, just a limiter on the number of messages (of any kind) sent each second.