[web] how do you go about measuring the amount of bandwidth one of your users is consuming

Started by
10 comments, last by evolutional 19 years, 5 months ago
In which case you should be able to just do some log file analysis.

Presumably you have some easy way to determine, from the path of a file, which user it belongs to (or even a hard way would do).

So just run some log analysis and sum the bandwidth used by the items that belong to each user.

If for example, each user had their own subdirectory, it would be very easy (some log analysis packages may already be able to do this).

Even if you can't do it with an off-the-shelf kit, writing your own log analyser is very easy.

Mark
Advertisement
Here's some links on URL rewriting and custom 404's which could be used to 'fake' the URL on a hosted account. By doing this and wiring up the real url to a database, you should be able to keep track of data transfer.
http://www.4guysfromrolla.com/webtech/101701-1.shtml

My method is realtime, but would require some changes to your setup (namely where your pages are stored and how things are hooked up the database). The log analysis stuff isn't realtime, but it'd be your best bet without changing anything. If you own the server, you could probably set some task sitting in the background reading the logs and updating the statistics.

Of course, if you had admin access (and the the machine.config, etc) you'd have so much more flexibility (mmm, custom HTTP Handlers - Rewrite.NET).

This topic is closed to new replies.

Advertisement