torrc 文件中的核算选项,可用于指定中继在一段时间内可用的最大字节数。

    AccountingStart day week month [day] HH:MM

这指定了何时进行核算重置。例如,设置为一周内字节总额(每个周三上午 10:00 重置 ),可使用:

    AccountingStart week 3 10:00
    AccountingMax 500 GBytes

This specifies the maximum amount of data your relay will send during an accounting period, and the maximum amount of data your relay will receive during an accounting period. 当(根据 AccountingStart)重置核算周期后,AccountingMax 计数器将重置为0。

比如:假设你想要每天每个方向设置 50GB 的流量,并且计数器在每天中午重置:

    AccountingStart day 12:00
    AccountingMax 50 GBytes

请注意,中继并不会正好在每个核算周期开始时唤醒。 它将记录上一周期配额使用速度,并在新周期中随机选择一个点启动。 通过这种方式,可避免每月开始时大量中继在运行而月末没有中继还在运行。

如果相对于连接速度,你只能贡献一小部分带宽,我们推荐你使用每日核算方式,这样你就不会在每月第一天用完整月的额度。 只需将每月总额除以 30 即可。另外,可可对流量限速,以便每天有更多时间是运行的:如果想要在每个方向提供 X GB,可将 RelayBandwidthRate 设为20*X KB。 比如,如果每种方法可提供 50GB,可将RelayBandwidthRate 设置为 1000 KBytes: 这样中继可保持每天中至少有一半时间是可用的。

    AccountingStart day 0:00
    AccountingMax 50 GBytes
    RelayBandwidthRate 1000 KBytes
    RelayBandwidthBurst 5000 KBytes # 允许较高突发值但保持平均