Knowledgebase

Script to calculate # of requests and bandwidth for file

Posted by dantheman733, 12-17-2010, 04:06 AM
I need to calculate the total bandwidth a file consumes. This would be (total requests)x(image size). The files I want to do this for are images, so I cannot simply use php to track the views (unless I serve the images with php, which I don't want to do). I was thinking of parsing http logs to get this data. Does anyone know of a script out there that will parse a servers http log to calculate the number of requests a particular file has received (you could then get the bandwidth by multiplying by the filesize)? Upon doing that I would also want the data inserted into a mySQL database. Are there any other ways to track the bandwidth consumption of files without having to serve the file as php? Thanks!

Posted by Mike Johnson, 12-17-2010, 02:28 PM
There are a lot of programs out there for analyzing your HTTP traffic. The amount of bandwidth a file has consumed is a very basic metric, so I suspect most of the programs out there will be able to tell you this. You might like to check out AWStats.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Burst/Nocster Down (Views: 673)


Language:

Client Login

Email

Password

Remember Me

Search