phpserverbandwidth

How to use PHP to get the website bandwidth


I want to get the website bandwidth with PHP

get the information like this:
aaa.example.com 200g/m
bbb.example.com 150g/m


Solution

  • I don't think PHP have any standard tools to provide this data. You probably will have to set up custom logs for Apache where it will save subdomain and page size for all requests and then you will need to extract this data and present it with some statistical tool like Munin. Actually maybe someone already made a plugin for Munin that is doing just that, just try to google for it.