Most of the processes that can slow down or take up more resources than necessary are not detectable without stressing the application.
Evaluate the load to be supported
In this context, several cases can arise. We may be dealing with a new service for which no reference is known. It will therefore be necessary to refer to the business plan by applying a substantial safety margin. In the case of a redesign or optimization of an existing service, the exercise is easier, provided you have measured the audience. If this is not the case, it will take additional time to install a traffic measurement system and collect enough data for it to be relevant. The goal is not to seek the limits of the system, but to make sure that the service is not degraded, even in difficult conditions.
Choose your scenarios
Not all parts of the same system have the same resource requirements, and some interactions, such as concurrent access to a database or file sharing system, can be problematic during heavy loadings. As said before, it will be important to have a baseline against which to assess the expected traffic, but a level of complexity must be added. The question therefore becomes: "How do my end users behave on the application? ".
This is the moment when the interaction with the business can become decisive. We will have to analyze audience statistics to extract personas. Typical users who represent most of the traffic. Each of these personas must have a weight, a realistic proportion of the traffic they represent. Keep in mind that some traffic can be caused by bots: generally just crawling data, bots behave differently from humans. They can generate a significant additional burden and can be taken into account if their impact is likely to be significant.
The importance of measurement
As with the traffic assessment and the choice of scenarios, having precise data when running the tests will prove to be extremely useful in determining possible areas for improvement. Even though the scale-out simulation utilities provide a report, it does not say exactly where the weak spots in your system are. The use of an APM (Application Performance Monitoring) is strongly recommended, if not essential. Do not choose a tool for its popularity or the notoriety of its supplier, make sure that it meets your needs and that it is well suited to the technology used by your application.
Shoot but not to kill
Carrying out charge shots doesn’t have to be intuitive; many services will offer you to drop the application first so you can see the maximum traffic you can reach. But then what do we do? Are we adding machines? More powerful machines? This is the wrong way to go: this method will not give you any precise and reliable indication for a robust application.
Favor a progressive and iterative approach. Do not try to take the application out of service, rather look, as the load gradually increases, for the point at which the service begins to degrade. Measure, analyze, correct, then verify the impact of changes. And this until your goal is reached.
Find the culprits
If you have followed our advice, and you have used the right APM for your system. You will have fine metrics on what is consuming too many resources in your application. But to be sure that the solution provided is relevant and effective, we will have to experiment. Start by deploying the fixes one at a time and simulating the same load as before, making sure everything else is equal, so you will know what the impact of each change is.
It sounds like a waste of time, but let's set a concrete scenario. You make several modifications, you make a charge shot, and the overall impact is positive. But in reality you have added a database index which has optimized some queries but others are slower. In general, this change degrades the service. In this case, you may not realize it.
The advantage of the method
You must start to feel the principle, it is by saving resources that your application will be able to provide faster service in more difficult conditions; but in addition, resources have a cost, whether they are physical or that you host in a cloud. Optimizing your system and looking for bottlenecks will allow you long-term savings on your infrastructure. The time and resources implemented to improve your performance will therefore never be a loss of investment.
Is optimizing high traffic applications a subject that concerns you?
Discuss it with the Continuous team!