Track traffic across interface and device restarts and limit consumption to a donation-backed amount.
This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2011-09-13 22:05:28 +02:00
src implement throttling after exceeding traffic limit using tc 2011-09-13 22:05:28 +02:00
README.org README: nomen est omen 2011-09-09 20:14:55 +02:00

Track traffic across interface and device restarts and limit consumption to a donation-backed amount.

To increase SSD lifetime persistent storage is only touched every $MaxPerTrafficDiff bytes (currently 100 MB). So tracking can be trivially avoided by frequent router reboot.

Usage

  • call traffic_track via cron as often as possible
  • call traffic_account_donation to increase the traffic limit after you put the coin in the treasure chest

Internals

Counters

Max
traffic limit
Per
traffic accounted to disk
Eph
traffic acounted to /tmp
Cur
traffic directly obtained from `ip -s`
Obs
part of Cur already accounted

Caveats

  • scripts are non-reentrant