How to decide which equipment to deploy a web application

Suppose you have a web application, there is no specific stack (Java / .NET / LAMP / Django / Rails, all is well).

How would you determine what equipment to deploy it? What rules of thumb exist when determining how many cars you need?

How would you formulate such parameters as simultaneous users, simultaneous connections, daily images and the ratio of reading / writing the database to the decision about how much and what equipment do you need?

Any resources on this issue will be very helpful ...

In particular, any hard numbers from real world experiences and case studies would be great.

+4
source share
3 answers

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.

+3
source

Determine the expected load. Configure the machine and perform some tests against it using the load testing tool. How close you are, if you only reach 10% of the peak load with some margin of error, then you know that you will need some load balancing. Design and execute the solution and re-test. Make sure the solution is flexible enough to scale.

Litigation and error are pretty much the way to go. It really depends on the individual applications and usage patterns.

0
source

Test the load sample application and measure performance and load. Database queries, disk images, latency, whatever.

Then get an estimate of the expected load during deployment (contact your domain expert) (you need to consider the average load and peaks).

Multiply two and add some to be sure. This is really a rough idea of ​​what you need.

Then implement it, bearing in mind that you usually don't scale linearly, and you probably won't get the expected load;)

0
source

Source: https://habr.com/ru/post/1308021/


All Articles