Capacity planning is a fairly detailed and vast area. You will need to adopt an iterative model using "Theoretical Basic> Load Testing> Tuning and Optimization."
Theory
The first step is to identify your business requirements: how many users are expected for maximum use? Remember - these numbers are usually inaccurate with some margin.
As an example, suppose that all peak traffic (in the worst case) will exceed 4 hours of the day. Therefore, if the site expects 100 thousand hits per day, we do not divide it by 24 hours, but instead by 4 hours. Therefore, my site should now support peak traffic of 25 thousand hits per hour.
This is reduced to 417 views per minute or 7 beats per second. It is only on the front side.
Add to this the number of internal transactions, such as database operations, any input / output files for each user, any batch jobs that can be performed on the system, reports, etc. Connect all of this to get the number of transactions per second, per minute, etc. that your system should support.
This becomes even more complicated if you have requirements such as βAvg response time should be 3 seconds, etc.β, which means you need to calculate the number of delays in the network / firewall / proxy, etc.
Finally, when it comes to hardware choices, check out published specifications from each manufacturer, such as Sun, HP, IBM, Windows, etc. This details the maximum transactions per second in a test environment. Usually we take 50% of these peaks in real conditions :)
But ultimately, choosing hardware is usually a commercial solution.
You also need to save at least 2 servers at each level: web / app / even db for failover clustering.
Load loading
It is recommended that a separate reference test environment is recommended during the project life cycle and after launch so that you can return to performing specific performance tests in the application. Scale this to be a smaller production version, so if Prod has 4 servers and Ref has 1, then you are testing 25% of peak transactions, etc.
Tuning and optimization
Too often, people throw some expensive equipment together and expect that everything will work beautifully. You will need to configure the hardware and OS for various parameters, such as TCP timeouts, etc. - They are published by software vendors, and this must be done after the software is completed. Set these settings to Ref env, test, and then determine which ones you want to transfer to Production.