I have a proxy-/backup-/application-server with multiple users. The proxy has a total bandwidth-limit of 5TB/month. Each user can use 1TB/month, but I don't think that each user will need a complete TB, so I think a soft-limit with email-warnings would be the best. In addition, I want to throttle users, that have exceeded a 2TB/month limit for the rest of the month. After all users exceed 5TB in a month, i want to deny all connections to the server.
Each user is able to connect via SSH, SFTP, PPTP and OpenVPN and can run own processes (like node.js or apache), that shall be charged on his traffic-account.
What's the best way to track each user's usage? I'm a complete newby in traffic-shaping. Can you recommend some good howTos/tutorials or good software?