HandyOSS / HandyHost

Host DVPN/HNS, Sia and Akash all in one UI.
https://handyhost.computer
GNU Lesser General Public License v2.1
102 stars 16 forks source link

Q: akash: difference reported available cpu vs actual #54

Closed avolon42x closed 2 years ago

avolon42x commented 2 years ago

I have a question regarding the reported available cpu's.

Provider log reports: available-cpu="units:<val:\"2795\" > available-cpu="units:<val:\"1380\" > available-cpu="units:<val:\"1825\" >

-> 6000

Handyhost and K9s reports (hh probably gets the data from kubernetes?):

Screenshot 2022-01-28 at 16 30 14 Screenshot 2022-01-28 at 16 30 31

This means that somehow there is a 4000 mili cpu difference? What could be the reason?

alexsmith540 commented 2 years ago

Yeah HandyHost is picking up from kubernetes. I suppose its possible that the akash provider incorporates the "limit" from the kubernetes output into their numbers maybe? In hh we pretty much use current top of the k8s system for current cpu usage and the nodes described allocatable for the total avail. Maybe that's the difference when you factor in the 'limit' which we dont use in hh? If you feel like seeing the output of the scripts hh uses to talk to kubernetes, they're /opt/handyhost/aktAPI/getK8sClusterStats.sh and /opt/handyhost/aktAPI/getK8sTop.sh you will probably have to run as root. If you see anything that adds up to the discrepancy let me know.

avolon42x commented 2 years ago

Thx Alex - i’ll have a look at it.

avolon42x commented 2 years ago

I think I can explain the discrepancy: leased vs actually used. Deployment gets made with 1vcpu but it only uses 0.1. HH will report the actual use 0.1 vs the reserved capacity 1.0 in the lease. Akash will block 1.0 on your host (reported in log). So you will “loose” 0.9 potential capacity since its reserved in the lease.