Jump to content
  • Advertisement
Sign in to follow this  
jen6677

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

This topic is 5042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

lets say you own a website that hosts images for its users. How do you measure the bandwidth that one of your users consumes? C# asp.net

Share this post


Link to post
Share on other sites
Advertisement
Using a bandwidth auditing tool ofcourse :) There are several for linux, but it's been a few years since i used one, so I don't remember any names.

Share this post


Link to post
Share on other sites
If you host images and show them through a script (ie, <img src="image.php?user=blah&image=blah.jpg">), you could just get the size of the image and add the value to a database field every execution of the script.

Share this post


Link to post
Share on other sites
Quote:
Original post by GroZZleR
If you host images and show them through a script (ie, ), you could just get the size of the image and add the value to a database field every execution of the script.



how do you think a service such as photobucket does it? Is it reasonable to assume they use the method above?

Share this post


Link to post
Share on other sites
Thinking about the options, I'd say that it's a simple way of doing it. However, photobucket uses 'real' urls (instead of a querystring) which leads me to think that probably use a custom ISAPI filter to intercept the request and keep track of the downloads (see interesting article on MSDN).

If you don't have access to the server or can't install an ISAPI component, you could probably 'fake' it by using custom 404's to redirect a request to a DB query. So imagine your user stores an image, the 'real' url to access the image is http://yoursite.com/images.aspx?id=12345 - the custom 404 would take a URL such as http://yoursite.com/users/example/helloworld.jpg and redirect it to the first one through a process of DB lookups and such. The first URL could obviously have some kind of tracker already mentioned which will allow you to monitor the user's data transfer.

Share this post


Link to post
Share on other sites
If apache's mod_rewrite is installed on the server then you can use that as well to redirect "real" URL's hrough a database query string.

Share this post


Link to post
Share on other sites
Get your web server logs. Find some way of identifying which entries are from which user, and then add up the total number of bytes transferred (which should generally be logged).

That gives you the answer.

Unfortunately identifying users is a tad tricky normally - unless you're using HTTP authentication, in which case they should appear in the log.

Mark

Share this post


Link to post
Share on other sites
Hmm I don't think I understood the question.

Do you mean:

A) The amount of bandwidth used by an individual user, personally, by downloading stuff from your site

OR

B) The amount of bandwidth used by all users of items which belong to a specific user

B) is easy, A) is hard.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
Hmm I don't think I understood the question.

Do you mean:

A) The amount of bandwidth used by an individual user, personally, by downloading stuff from your site

OR

B) The amount of bandwidth used by all users of items which belong to a specific user

B) is easy, A) is hard.

Mark



sorry for not being clear. (B). I would like to track the bandwidth used by all users of items that belong to a specific user.

Thanks for all the tips in the thread. If anyone has a link to a tutorial that wouyld be great.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!