goinfinite / ez

From server to PaaS in no time. User-friendly, lightweight, free.
https://goinfinite.net/ez/
Other
10 stars 0 forks source link

feat: add disk performance units to accounts and container limits #84

Closed ntorga closed 3 months ago

ntorga commented 4 months ago

Oracle Cloud has this nice abstraction for disk performance called VPUs: https://docs.oracle.com/en-us/iaas/Content/Block/Concepts/blockvolumeperformance.htm

Most people won't dabble with IO/IOPS configs much. I wrote an article a couple months ago about the subject: https://ntorga.com/throughput-and-iops-how-much-is-enough/

Maybe we should have something similar to Oracle's VPU. Say we had something like "Disk Performance Level" or a nicer name.

We could assume 125MB/s 3kIOPS of AWS EBS gp3 defaults as the middle ground, dividing the total performance by the type of operations, such as:

Level ReadIo ReadIops WriteIo WriteIops
1 5000000 250 5000000 250
2 10000000 500 10000000 500
3 31250000 750 31250000 750
4 46875000 1000 46875000 1000
5 62500000 1500 62500000 1500
6 93750000 2250 93750000 2250
7 125000000 3000 125000000 3000
8 187500000 4500 187500000 4500
9 250000000 6000 250000000 6000
10 312500000 7500 312500000 7500

This should be ok for now. In the future we can create a benchmark (accessible via the API) to actually measure the disk and adjust the maximum limit and calculate the ratios for each level accordingly.

ntorga commented 3 months ago

Instead of going with a fixed table, I went with a base unit. 1 StoragePerformanceUnit = 5MB/s and 250 IOPS. This should be enough for small deployments. Say someone wants a lot of disk I/O and IOPS, well, set to 10 performance units. That will allow for 50MB/s and 2500 IOPS. This will scale better and I guess it's more intuitive to see that 1 is ok, 10 is a lot and 100 is why are you doing that? Hehehe.

Backend is ready. Going to take a closer look on the code again on Monday and set this to done.