Monthly Bandwidth Allowance

Jeffrey M. Vinocur jeff at litech.org
Tue Jan 29 10:34:39 UTC 2008


On Tue, 29 Jan 2008, Richard Huang wrote:

> 1.how to define this question?what's the key word I can use in google ...
> 2.how to implement it generally?

This is fairly complicated to do in INN.  You would need to parse the 
news.notice log looking for the information at the end of each user 
connection:

Jan 29 05:30:39 puck nnrpd[26907]: puck.litech.org exit articles 8 groups 2
Jan 29 05:30:39 puck nnrpd[26907]: puck.litech.org times user 0.030 system 
0.010 idle 0.005 elapsed 36.099
Jan 29 05:30:39 puck nnrpd[26907]: puck.litech.org artstats get 8 time 0 
size 11459
Jan 29 05:30:39 puck nnrpd[26907]: puck.litech.org time 36104 idle 
35597(529) readart 216(8) nntpwrite 117(1850)

where the "artstats" size information is what you're looking for.  And 
then you would need to build a custom authenticator for nnrpd.  However, 
you might still have trouble because that only would check when a new 
connection is made, rather than in the middle of a connection.


If you can change your requirements, INN has builtin support for 
"bytes per second" style bandwidth limiting which you could implement 
easily.


-- 
Jeffrey M. Vinocur
jeff at litech.org


More information about the inn-workers mailing list