Software Architecture Performance, let’s talk about Performance in Software Architecture of an application. Performance is very critical component of any application as it is one of the major factor to determine the application’s efficiency.
In this topic we will cover and learn about what exactly the performance is and how it plays a major role in determining overall application rating as lower the performance low or no value of your system will be.
Look at the below general application overview:
In the above diagram, we see that a request is coming from a web browser, and it passes some data like JSON, images or XML to a web application.
Web Application layer transforms those data and convert into objects.
Business Application can be a business logic layer or other application API’s from where we are calculating business logic.
Database layer we are getting data from the DB layer so that we can store or retrieve for processing.
Batch processing is used to process a single or set of batches of data from various other systems into a database.
What is Performance
Performance is a measure of how fast or responsive a system is under a given workload and with given hardware it works on.
Workload:
Workload is the amount of data the application can process over a given period of time. It is one of the major factor in determining the performance. For e.g. on E-commerce sites like Amazon or Flipkart we see surge in traffic on offers/festive seasons.
Hardware:
Hardware is another major factor which determines the performance of an application, as it determines what kind of hardware we are using and what is the capacity of hardware. If the hardware doesn’t have the capacity to handle the number of request, then the application will either slow down or fails with timeout as the processing will take time. So it is equally important that the applications should be optimized and appropriate hardware capacity is equipped with the system.
In short, how fast our system works depends on the above two factors. As if we increase capacity of hardware, then our system performance will increase.
Software Architecture Performance Problems
Let’s talk about the performance problems, how to identify them in the first place.
How to spot a performance problem? How does it look like?
No one wants to have performance issues within their application, So it makes sense to check how and what causes the problem of performance.
Performance problem is the result of some queue. What it means is that because of queuing we face performance problems like network queue, DB queue, OS queues. If these resources are congesting, and it’s building then it causes performance problems that means performance problem is the result of Queue Building in our application.
Queue Building Reasons
1. Inefficient slow processing: if the application has few algorithms which runs slowly that will bring down the performance of application.
2. Serial resource access: Suppose we are executing some processes on single thread and working on that thread works upon serial access, so it will slow down as we need to wait for other works for that thread to complete.
3. Limited resource capacity: Now, let’s assume that we are executing requests in parallel, but our CPU is not efficient (limited CPU resource) to perform that many request at the same time then we will see performance issues as we don’t have the capacity.
These are major 3 reasons which will cause queue building and creates performance problems. Slow processing impacts all the processes of your application, serial resource access needs to wait for operation to complete and limited resources will not allow parallel execution beyond its capacity.
Request Processing
Serial/Single Request Processing
Serial request or single requests are those which are processed one after the other. Once the first request completes, then only second request processing starts.
Concurrent Request Processing
At any given time, we have multiple request present in the system, and they are either being processed Simultaneously or serially. Generally, they are processed Simultaneously.
In the above diagram, you can clearly see how single and concurrent request processing happens.
Checkout the principles of performance of software here.