Is there a way to find the actual cost to compute a given task in terms of electricity consumption, or has this been a solved problem and hosting companies just add their proprietary sauce and then charge for the end result?
I’m curious in this way, because I’d love to be able to host for clients in my geographical area, but I don’t want to over-charge more than what it is actually worth to run the infrastructure.
At the core of my question is understanding the basic economics of hosting in relation to electrical consumption and hardware wear. I’d guess the outer layer of my question has a bit to do with knowing the true cost of hosting rather than how to make the most off of clients for simple services.
Appreciate any and all input!
At the core of it: you'll need a server, you'll need operational costs like utilities, you'll need to maintain its hardware and software. those are all your costs. The server is fixed, the rest you could project across a given month or year.
Generally, the rotation for compute is around 3 years, so divide (server_cost + operational)/36 is a monthly cost to run.
But wait! thats just for one server. But we can divide one server into virtual servers. So we get a machine with 128 cores and 64GB of RAM and 10TB of space, and now we can host many customers.
but of course, thats with no redundancy, on one server, in one location. But you could buy 2 servers and do some failover between them.
how many you can fit into a box is based on the servers and also the workload. You could setup 5000 customers on a server if every customer is very low load.
but also... power supplies die. hard drives die. networks get attacked. Customers do wild things.
That's it in a rough nutshell. Companies learn as they go, drive costs down as much as they can and drive price up as much as the market will tolerate.
This is why it can be simpler for startups to just rent compute from digitalocean or AWS, because everything that goes into actually running the servers can be expensive. Once you get to a certain size, it starts to become cheaper to self-host.
hope this helps!