dedicated web server costs
How to calculate server costs per user for a social networking type platform where storage for each user would max out at 2gb a month/500mb a day - quora
I understand your server is running an application. Personally, I found more easy to calculate the “server cost” per application, and then the “application cost” per user.
I will try to give you a comprehensive guide.
A server cost can be measured in $ per GB of storage, per megabit of bandwidth, per clock cycles in the CPU and so on.
To calculate the server cost, you need to know the Meantime Between Failures of each component first. This value is after how many years is your server (or Disk, network cart etc.) expected to fail. So, purchasing hardware is a recurring costs. You want to find the MTBF of the server itself and of the disks, at least. Divide the cost of the hardware for the MTBF.
For example, if your server cost 10k and your disks cost 2k, with respective MTBF of 10 years and 5 years, you need to do: 10k / ( 10 * 12 ), and then add this to 2k / ( 10 * 12 ). This is a total of 116.64$ per month.
Now, you need to add all the licensing costs, connectivity costs, software costs, electricity costs and so on. These are either yearly or monthly in general. Let's say your server reaches 200$ per month with these costs.
Now you know how much the server costs. If you choose an hosting provider which provides an already up and running server you can skip this part (except for licenses) and consider the price they make you monthly as the server cost.
At this point, you need evaluate the cost of each resource, being more specific than “server cost”. Let's assume your server as 4TB of storage, 128GB of RAM, an uplink of 300Mbps and an octacore CPU working at 3GHz. Divide the server cost for each of that.
So, we now know that we pay 0.05$ for a GB of storage, 0.15$ for each MB of RAM, 0.06$ for each Kbps of uplink and 0.008$ for each MHz of CPU. These are not cumulative costs! The bigger one is RAM, and you need to adjust the other to meet it. In other words, now many GB of Storage are do you get with 0.15$? Just divide 0.15$ per the cost per GB, the multiply the result from the original number of GB. Do the same for other measures.
So, we know that you pay 0.15$ for 3GB of storage, 2.5Kbps of bandwidth and, 1MB of RAM and 18.75Mhz of CPU. This is the base unit of your server cost, if you don't like the balance of resources try changing them and doing the computations again.
Now, how many base units resources need your applications for a user? You should do a benchmark with demo traffic to these your system and know these values. Also, consider how that storage is permanent - therefore always in use - while RAM and CPU are distributed only to active users.
Here, you need to calculate the ratio of active users over total uses. This way, you can find how much RAM and CPU to have for each GB of storage.
So, instead of comparing resources to users, compare them to a base unit for users. For example, you know that on average 1 user out of 50 is active. So, to convert this in resources calculate RAM, CPU and bandwidth for a user, and Storage for 50. Then, try to adjust your base unit for resources according to that.