HACKER Q&A
📣 hchua

How to monitor usage per user to implement performance based pricing?


I'm curious how does one implement performance-based pricing, e.g. X bandwidth and Y storage for tier 1 plans, X2 bandwidth and Y2 storage for tier 2 plans. I've also seen memory and cpu limits in some pricing plans before.

As for database usage, how do you monitor how much storage the account is using considering the data is spread across multiple tables?

Is there a tool that does all these?


  👤 verdverm Accepted Answer ✓
Not really, I've only seen in house systems

1. you need accurate, timely, and granular monitoring metrics, network is typically the hardest here

2. A quota system and control mechanisms

3. Databases limits are typically record based or you run a DB per customer / chargeable unit

Using VMs rather than Kubernetes makes things easier for you, but then you lose some opportunities for lower cost of goods

Of course, your options will depends on your pricing model and product. This is a large reason a common solution does not exist, another is where you run your services.


👤 mindhash
I worked for an infra provider. We used token buckets for network usage. We didn't have actual cpu usage but you can use zabbix for that. Memory is hard to capture because of paging etc

For database use, it's better to create separate dB if you want to charge by storage. If the tables are shared, use the (count of rows for customer/ total rows)* total table storage. Ideally this should be possible at tablespace level