This is a canonical question about capacity planning
Related:
I have a question regarding capacity planning. Can the Server Fault community please help with the following:
- What kind of server do I need to handle some number of users?
- How many users can a server with some specifications handle?
- Will some server configuration be fast enough for my use case?
- I'm building a social networking site: what kind of hardware do I need?
- How much bandwidth do I need for some project?
- How much bandwidth will some number of users use in some application?
The Server Fault community generally can't help you with capacity planning - the best answer we can offer is "Benchmark your code on hardware similar to what you'll be using in production, identify any bottlenecks, then determine how much of a workload your current hardware can handle, and/or how much hardware horsepower you need to handle your target workload".
There are a number of factors at play in capacity planning which we can't adequately assess on a Question and Answer site:
Doing a proper analysis on these factors, and others, is beyond the scope of a simple question-and-answer site: They require detailed knowledge about your environment and requirements which only your team (or an adequately-compensated consultant) can gather efficiently.
Some Capacity Planning Axioms
If you expect your application to use a lot of RAM you should put in as much RAM as you can afford / fit.
If you expect to use a lot of disk you should buy big drives - lots of them.
SAN/NAS storage is less cheap, and should also usually be spec'd large rather than small to avoid costly upgrades later.
Assume your resource needs will increase.
Bear in mind that the increase may not be symmetrical (CPU and RAM may rise faster than disk), and it may not be linear.
Even though RAM and disks have decreased in price considerably, the cost of electricity has gone up steadily. All those extra disks and RAM, not to mention CPU power, will increase your electricity bill (or the bill you pay to your provider). Plan accordingly.
Virtual Machine Count planning
When it comes to figuring out how many VMs you should plan for on a single host, there are actually no really good rules of thumb. In fact, there is only one, and it is only kind of good:
Which isn't terribly helpful. If those VMs are going to be running low-CPU applications, then your limiter is going to be based on RAM. Each VM platform has its own abilities to oversubscribe RAM, so it isn't as easy as TOTAL_RAM / Per-VM-RAM = MachineCount, but that number is a good planning item.
But what if your VMs are doing things besides low-CPU packet-slinging?
Virtual-machine counts are bounded by seven discrete resources available to the host machine:
All of these can be the thing you trip over, it all depends on what you're doing with your VMs. Some things to remember:
To figure out how many VMs you can pack into a host-system, you need to know how your systems run and what they require to run well. Once you know that, you can then do the count-planning. And better yet, figure out how beefy you need to make your host-systems!
Make sure you're asking the right question.
If you don't know what you'll need, that implies you don't need very much. If you have a hot web site, you also probably also have an operations team who knows how much ram, disk, io, network etc... your app needs. If you're in the dreaming stage, you should start with your desktop and work your way up.
Make sure you have some idea how you're going to scale when things get bigger. Can you add more servers behind the load balancer? Can you shard the redis server?
Also, having your own data center sucks. A data center (even if it's just one computer) is a distraction from your actual purpose. You can not just buy a computer, turn it on, and walk away. You need air conditioning, air filtration, reliable power, reliable internet, backups, spare parts, physical room to grow, power capacity to grow, power cables that don't get tripped on and a zillion other headaches.