Search code examples
phpbandwidth

monitor bandwith a web app takes


I have a form that is going to be submitted a few times and I want to know how much bandwidth is used ( upload and download ) for one submission of this form and when the php behind it does with the submitted data until the confirmation page is reached.

How can I monitor that either by echoing it right before the confirmation page is displayed so that I know how much upload and download bandwidth is taken on that one visit and form submission?

I wouldn't have it echo'd in the deployed version, just right now for testing.


Solution

  • Some details as to what type of web server you are using would be beneficial. Regardless, I use bandwidthd on my router's span port to track bandwidth by host, though this wouldn't give you the granularity that you are looking for it should give you enough to get you started.

    For more granular consumption monitoring I would recommend something like mod_logio, which will allow you to write the bytes sent/received per request to the apache log file.

    http://httpd.apache.org/docs/trunk/mod/mod_logio.html