Skip to content

Commit

Permalink
Use variables for all the choke groups values (Closes #133)
Browse files Browse the repository at this point in the history
  • Loading branch information
chros authored and chros committed Mar 14, 2018
1 parent a83e6e5 commit adca611
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions ubuntu-14.04/home/chros73/.rtorrent-config.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ method.insert = cfg.slowup.d.peers_max, value, 50
method.insert = cfg.slowup.d.uploads_max, value, 15


## Variables for getting upload rate limit and upload slots for throttle groups
# Max, Min value of uprate limit throttle in KB and Max number of upload slots for slowup throttle group
## Variables for getting upload rate limit for throttle groups and max number of upload/download slots for choke groups
# Max, Min value of uprate limit throttle in KB and Max number of upload/download slots during leeching and seeding for slowup throttle group
method.insert = cfg.slowup.uprate.max, value, 1600
method.insert = cfg.slowup.uprate.min, value, 75
method.insert = cfg.slowup.upslots.max, value, 125
# Max, Min value of uprate limit throttle in KB and Max number of upload slots for tardyup throttle group
method.insert = cfg.slowup.slots.leech.max, value, 200
method.insert = cfg.slowup.slots.seed.max, value, 125
# Max, Min value of uprate limit throttle in KB and Max number of upload/download slots during leeching and seeding for tardyup throttle group
method.insert = cfg.tardyup.uprate.max, value, 1200
method.insert = cfg.tardyup.uprate.min, value, 25
method.insert = cfg.tardyup.upslots.max, value, 75
method.insert = cfg.tardyup.slots.leech.max,value, 150
method.insert = cfg.tardyup.slots.seed.max, value, 75

## Variables for getting global downrate limit
# Max, Min value of global downrate in KB
Expand All @@ -83,17 +85,17 @@ choke_group.insert = slowup_leech
choke_group.insert = slowup_seed
choke_group.up.heuristics.set = slowup_leech,upload_leech
choke_group.up.heuristics.set = slowup_seed,upload_seed
choke_group.down.max.set = slowup_leech,200
choke_group.up.max.set = slowup_leech,200
choke_group.up.max.set = slowup_seed,125
choke_group.down.max.set = slowup_leech,(cat,(cfg.slowup.slots.leech.max))
choke_group.up.max.set = slowup_leech,(cat,(cfg.slowup.slots.leech.max))
choke_group.up.max.set = slowup_seed,(cat,(cfg.slowup.slots.seed.max))
# Set up choke groups for tardyup group
choke_group.insert = tardyup_leech
choke_group.insert = tardyup_seed
choke_group.up.heuristics.set = tardyup_leech,upload_leech
choke_group.up.heuristics.set = tardyup_seed,upload_seed
choke_group.down.max.set = tardyup_leech,150
choke_group.up.max.set = tardyup_leech,150
choke_group.up.max.set = tardyup_seed,75
choke_group.down.max.set = tardyup_leech,(cat,(cfg.tardyup.slots.leech.max))
choke_group.up.max.set = tardyup_leech,(cat,(cfg.tardyup.slots.leech.max))
choke_group.up.max.set = tardyup_seed,(cat,(cfg.tardyup.slots.seed.max))


# Set the numwant field sent to the tracker, which indicates how many peers we want. A negative value disables this feature. Default: -1 (tracker_numwant)
Expand Down
4 changes: 2 additions & 2 deletions ubuntu-14.04/home/chros73/.rtorrent.rc
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ method.insert = get_downrate_global, simple|private, "branch=(and,((greater,((ma
schedule2 = adjust_throttle_global_down_max_rate, 54, 60, "throttle.global_down.max_rate.set_kb=(get_downrate_global)"

# helper methods: get new upload slots limit for slowup_seed and tardyup_seed choke groups (based on their current uprate and the given cfg values)
method.insert = get_slots_slowup, simple|private, "math.min=(cfg.slowup.upslots.max),(math.max,(math.div,(cfg.slowup.uprate.min),(cfg.global.slot.uprate.min)),(math.div,(throttle.up.rate,slowup),1024,(cfg.global.slot.uprate.min)))"
method.insert = get_slots_tardyup, simple|private, "math.min=(cfg.tardyup.upslots.max),(math.max,(math.div,(cfg.tardyup.uprate.min),(cfg.global.slot.uprate.min)),(math.div,(throttle.up.rate,tardyup),1024,(cfg.global.slot.uprate.min)))"
method.insert = get_slots_slowup, simple|private, "math.min=(cfg.slowup.slots.seed.max),(math.max,(math.div,(cfg.slowup.uprate.min),(cfg.global.slot.uprate.min)),(math.div,(throttle.up.rate,slowup),1024,(cfg.global.slot.uprate.min)))"
method.insert = get_slots_tardyup, simple|private, "math.min=(cfg.tardyup.slots.seed.max),(math.max,(math.div,(cfg.tardyup.uprate.min),(cfg.global.slot.uprate.min)),(math.div,(throttle.up.rate,tardyup),1024,(cfg.global.slot.uprate.min)))"
# Set new upload slots (unchoked peers) limit for slowup_seed and tardyup_seed choke groups in every 100 seconds
schedule2 = adjust_slots_slowup, 47, 100,"choke_group.up.max.set=slowup_seed,(cat,(get_slots_slowup))"
schedule2 = adjust_slots_tardyup, 48, 100,"choke_group.up.max.set=tardyup_seed,(cat,(get_slots_tardyup))"
Expand Down

0 comments on commit adca611

Please sign in to comment.