Triggered quota writes

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Post Reply
qawplo1
Posts: 5
Joined: Fri May 29, 2015 5:23 am

Triggered quota writes

Post by qawplo1 »

Instead of writing quota data to flash only periodically it would be much more effective to also have "triggered" writes.
We should be able to write quota data:
- after a limit is reached
- after xx MB/GB/TB of traffic

Benefits:
- quota is up to date at any point of time
- flash is preserved by not being written too many times
- (un)intentional abuse is prevented

Consider a situation in which a user is given a quota but he also has physical access to the router. What happenes once the quota is reached?
1. the Internet access will be cut
2. the user, possibly without even knowing he exceeded the quota, assumes something is wrong
3. the user thinks "Hm, let me try to power cycle the router, maybe it starts working again!"
4. since the quota data have not been written, after the router boots, the user indeed gains internet access
5. after a while, he exceeds the quota again and we go back to step 1...

Depending on the quota and available bandwidth, it is quite possible the user is able to use multiple quotas.

Currently, we can set up crontab such that quota data is written more often, but that approach results in way too many flash writes, which results in a shortened router life span.
Also, most of the writes would be completely needless - think of sleeping or being away.

Post Reply