The best way to measure and cap bandwidth usage in a LAMP SaaS Web application


The company I work for is thinking of developing a LAMP SaaS Web application that would be plan based. We want to monitor usage because it involves external references, and would draw bandwidth through the placement of an iframe or JavaScript snippet on a third-party site. My first thought was relying only on a page impression algorithm, but since this is really a bandwidth issue, I wonder if monitoring that is a better approach. What is the best way to do this monitoring in a fashion that would allow me to message the third-party site that the cap has been exceeded?

Best Solution

I think a web service gateway would be a good option. Most of them (IBM, Layer 7, Vordel) offer throttling and contract management features. They'll allow you to set thresholds on access to whatever is behind them.

If you're using authorization and authentication for users and service, you can easily configure them to send a notification if the usage gets too high (from abuse, exceeding the SLA for requests, or whatever else you configure.

Best of all, they'll work with whatever is consuming your application / data, be it users, batch processes, or services.

Related Question