On Mon, May 15, 2000 at 09:39:33AM -0700, Chin Fang wrote:
> However, the logs created by tcpserver and qmail-pop3d do not contain
> any size info, and this makes metering POP traffic difficult.  We
> don't have control of our router, so I would be appreciative for any
> hints for an alternative.

First it would be interesting how exact the metering should be!

If you have to know about every byte in/out you could plug a
modified "recordio" (from ucspi-tcp) just after the tcpserver command.
(recordio fork()s and duplicates the data stream. Thus you have one
stream for the "POP3 process" and one "locally" where you could
simply count bytes in/out (instead of outputting them) and on the
termination of the stream outout it, so it will show up in the logs.
This is probably the better (and exacter) approach.

The other possibility would be to patch qmail-pop3d.c to output
the number of bytes on every successfull "RETR" command (probably to
STDERR) and have them listed in the logfile.

Both approaches are still kinda vague, as they do "content" accounting,
which is different from IP accounting, as you won't catch TCP/IP
protocol overhead, retransmissions on packet loss, etc.
If you want to measure IP traffic, you should add some factor to the
content data. From our experience a rather realistic formula is 
     ip-traffic = 1.8 * content-size
This however also depends on the kind of userbase you have. If they all
are well connected the factor is smaller. If they access the POP3-Server
mostly remote from bad connected dialins it may also be higher.
The 1.8 is what we calculated from incoming/outgoing traffic for SMTP
connections to/from our local customers and in/out from/to the Internet
(i.e. mixed "userbase").

        \Maex

P.S. No, sorry, I don't have patches for any of the approaches I've described
     above.

-- 
SpaceNet GmbH             |   http://www.Space.Net/   | Stress is when you wake
Research & Development    | mailto:[EMAIL PROTECTED] | up screaming and you
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | realize you haven't
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  | fallen asleep yet.

Reply via email to