问题
I am in the process of building a Ruby on Rails based SaaS app. The app is being hosted on AWS (Amazon).
I need to measure the bandwidth usage by each customer for billing and customer segmenting. The customers could be identified by their Urls. like customer1.myapp.com or mycustomer.com
Can somebody suggest the best way to accomplish this? Any tools or simple hacks would be appreciated.
回答1:
Assuming you are fronting your Rails app with Nginx or Apache, you could use a log format that includes the vhost, then pull out the bytes transferred and the vhost from the log lines (nightly, monthly, or whatever). Add up the bytes, grouping by vhost, and there you go.
回答2:
My suggestion is New Relic - http://newrelic.com/
回答3:
Need the same. Do by this way: bandwidth management with rails?
All using only the Rails App.
来源:https://stackoverflow.com/questions/9694953/measure-saas-app-bandwidth-usage