DEV Community


Discussion on: When do you know the performance bottleneck is not your code, but the infrastructure?

david_j_eddy profile image
David J Eddy

As @rhymes pointed out; hardware or software either way you pay for performance enhancement changes. As well as, the more efficient your hardware the more the software will fill to use it. The more efficient the software the less hardware will be used to handle the processing. It is a never ending tug-of-war back and forth.

As for your question: how do you find the bottleneck in a system? The first thing you will need is monitoring and metrics. Just like @rhymes says "...There's no magical formula, it takes visibility into your system, monitoring, measuring and expertise...."

How would I would find the bottleneck? Load testing with system monitoring. For Example: does the CPU max out under X load? Ok, if I increase the hardware resources by 50% can I handle 50% more load? If not, look at metrics. What resources are being used by what process for how long? What function call in the application takes the longest (flame graphs are great for this).

At the end, finding the balance between acceptable hardware costs and software performance is a never ending back-and-forth.