Common Performance Management Mistakes


Common Performance Management Mistakes

How to Avoid Pain Points Introduced by Cloud-Based Architectures

Editor’s Note: The following is an article written for and published in DZone’s 2021 Application Performance Management Trend Report

Performance in any cloud-distributed application is key to successful user experience. Thus, having a deep understanding of how to measure performance and what metric IO pattern to use is quite important. In this article, we will cover the following:

  • Performance analysis checklist and strategies

  • Performance issue detection and tools

  • Performance anti-patterns and how to mitigate issues

Performance Monitoring in the Cloud Checklist

When improving the performance of your application or infrastructure architecture, use the following checklist:

  • Introduce logging tools in your application and infrastructure components

  • Find anti-patterns and bottlenecks of your code and infrastructure

  • Set up monitoring tools to gather CPU, memory, and storage utilization

  • Adjust monitoring tools to gather info about events between base components

  • Do not log everything identify important events to log

Most Common Application Performance Anti-Patterns

The most important item from the performance checklist is identifying anti-patterns. This will save valuable time once you already know the weak spots.

Nosy Neighbor

Imagine you have a microservice that is deployed as a Docker container, and it is eating more CPU and memory than other containers. That can lead to outages since other services might not receive enough resources. For example, if you use Kubernetes, it may kill other containers to release some resources. You can easily fix this by setting up CPU and memory limits at the very beginning of the design and implementation phases.

No Caching

Some applications that tend to work under a high load do not contain any caching mechanisms. This may lead to fetching the same data and overusing the main database. You can fix this by introducing a caching layer in your application, and it can be based on a Redis cache or just a memory cache module. Of course, you don’t need to use caching everywhere, since that may lead to data inconsistency. Sometimes, you can improve your performance by simply adding output caching to your code. For example:

namespace MvcApplication1.Controllers
{
  [HandleError]
  public class HomeController : Controller
  {

     [OutputCache(Duration=10, VaryByParam="none")]
     public ActionResult Index()
     {
         return View();
     }
   }
}

Above, I’ve added the output cache attribute to the MVC application. It will cache static content for 60 seconds.

Busy Database

This issue is often found in modern microservices architectures, when all services are in a Kubernetes cluster and deployed via containers but they all use a single database instance. You can fix this problem by identifying the data scope for each microservice and splitting one database into several. You can also use the database pools mechanism. For example, Azure provides the Azure SQL elastic pool service.

Retry Storm

Retrying storms and the issues they cause usually occur in microservice or cloud-distributed applications; when some component or service is offline, other services try to reach it. This often results in a never-ending retry loop. It can be fixed, however, by using the circuit breaker pattern. The idea for circuit breaker comes from radio electronics. It can be implemented as a separate component, like an auto switch. When the circuit runs into an issue (like a short circuit), then the switch turns the circuit off.

Example: Cloud Performance Monitoring Architecture That Results in an Outage

 ...

You can read complete full article in the community page here.



Want to boost your cloud and software architecture skills? Enroll on my hands-on courses:

Building Enterprise applications with multitenancy

Building Event Driven and Microservices Architecture in Azure

Comments