The Art Of Performance Engineering
Learn Performance Optimization techniques to ensure high performance of your application.
Vineeta Vashistha & Amit Vashistha
2014 - 2021 Vineeta Vashistha & Amit Vashistha
Table of Contents
Chapter 1 - Getting Started
Introduction
As the new age organizations are trying to embrace digital transformation, Application Performance has emerged as an indispensable requirement as a downtime of even few minutes can cause a loss of millions of dollars. There is a critical need to design robust applications which can bear the expectations and load of deiverse audience without any disruption. But how to ensure a high performance of application/technology in hand along with ensuring that it streches to the edge of its performance capacity. Performance Engineering is a one-stop solution to address these challenges and to ensure reliability and stability of any application. This book has been designed to pick up the most popular flavors (hardware & software) of this field to give you an insight into performance engineering and how it can be implemented for performance optimization at client/server side.
In this chapter, we will cover the following topics:
- The general concept of performance engineering
- Need of performance engineering
- Implementation Methodology
- Introduction to Performance Monitoring
Performance Engineering
Performance Engineering is defined as a set of methodologies to ensure that the components of your network are achieving their intended goal. Its a vast field as the concept of tuning varies with technologies, language, hardware and software stack in use. It is often interpreted as performance testing but in reality, performance testing is a small subset within the vast arena of Performance Engineering. While, Performance testing is about recording a script with popular tool, collecting performance numbers,reporting results to development team and then further analyze results and come back with improvement patch or build. On the other hand, Performance Engineering is an art of thinking like software;applying the concepts you learned during Computer Science Engineering to the likes of imagining data flow right from data packets transaction over widely distributed network wire which hits web server then passing through firewall configuration to application server which would process data with the help of database and return back the results back through same route.
May be its not as excited as hacking sounds, but there is nothing more closer to it.I have seen this as a passion among many senior technical professionals both from development and testing who at the peak of their career wants to shift their focus completely to performance engineering. The moment you will toss the word performance engineering people will start talking about tuning of web server, application tuning and DB tuning but there is more to it rather than just knowing these software stacks. You need to feel the flow of data right from customer desktop to all the way to server and its way back. Then start feeling where all your performance is bleeding.
Need of Performance Engineering
Performance Engineering of a product or an application plays a critical role in not only providing competitive edge to an organization but also enhances the business value by discovering potential issues earlier in the software development lifecycle. If an organization want to get it right the first time while launching a product in market then they need to adopt a performance engineering mindset and define what needs to be optimized in the earlier iterations so that they can plan for the performance optiizations in their project budgets. Pushing performance to the end of release cycle will cause a delay in identifying potential bottlenekcs thus impacting the original project timelines and goals.
While developers may traditionally think that by increasing the hardware configuration and memory allocation to maximum, they can fix any product and make it stable. If you are not worried about the cost and you have lot of money to throw away then in some cases, this solution might work. But if you are looking for a strategic solution then we need to adopt a shift-left aprroach and start early in the development cycle. The intent is build a smooth road for high volume data packets flow for faster performance.
Implementation Methodology
With respect to methodology, one needs to adopt an iterative approach by first making modifications such as adjusting the configuration of database or indexing the database or for that matter doing application server changes and then monitoring these changes and repeating them if needed to further stabliize the application performance.
In addition to this, Performance Engineering needs to be implemented at various layers to optimize the performance. On a high level, we can categorize these layers as:
- Client Side Optimization - The client side relates to performance of the client machine. This includes initial page load time, downloading all of the resources, JavaScript that runs in the browser, and more.
- Server Side Optimization - The server side relates to how long it takes to run on the server to execute requests. Optimizing the performance on the server generally revolves around optimizing areas like web server(IIS, Apache), application server(Jboss, Weblogic, Websphere, Tomcat,.Net) and database server (MS-SQL) and other application dependencies.
There are also various tuning techniques such as JVM Tuning, SQL Tuning which can be leveraged to enhance the performance of the system.
Performance Monitoring
Monitoring the performance of an application/digital platform by usage of certain tools and processes is called as Performance Monitoring. These tools provide detailed performance metrics that can help you to not only troubleshoot the reasons for slowdown in performance or downtime but also identify the root cause of these issues. The issues can be caused due to:
- CPU Usage
- Response Time
- Garbage Collection
- Request Rates
There are many debugging mechanisms such as Heap Dump, Thread Dump, Java Flight Recorder and Java Profiler that can be used to troubleshoot performance issues.
Java and PHP
Java and PHP coding languages are widely used accross industry for software developement of applications. While Java is used as a server-side as well as client-side language to create applications, PHP is a server side scripting language and provides a wide range of frameworks that are useful for building responsive websites. Since both have different architecture, this impacts the approach that you need to adopt for performance optimization.
Summary
In this chapter, we explored performance engineering at a very high level and familiarized ourselves with the big picture and major concepts that we are going to explore in the following chapters in more detail. We learned the need of performance engineering and the approach that need to be taken for implementing within an enterprise. We will discuss the infrastructure design and understand architecture of its various components in the next chapter.
Chapter 2 - Infrastructure Design
Introduction
The moment we think of infrastructure requirement for Performance Engineering, we need to think of hardware comprising of a good load balancer together with host server which has decent amount of CPU/RAM combined with good network bandwidth. In addition to this, component architecture also plays an important role while planning the hardware design.
In this chapter, we will cover the following topics: