AWS Builder Center
Troubleshooting bugs in cloud infrastructures: strategies and methods

Troubleshooting bugs in cloud infrastructures: strategies and methods

Effective methods to structure your problem-solving and troubleshooting processes in your cloud environments and infrastructures.

Cloud loves surprises... The good and the bad. Haha!
In my experience, working on cloud architectures is rewarding... That is, until you start debugging real problems with your infrastructure. That's when you need to develop tactics, strategies, and methods, and above all, arm yourself with a good dose of patience.
In this new article, I attempt to review the strategies that helped me get through these difficult times. Methods confirmed by experts and used by the best cloud architects I know.
I will accompany each method and strategy with detailed real-life case studies to support my approach.
Here we go !!!

Troubleshooting bugs in cloud infrastructures: strategies and methods

A) The 50/50 Troubleshooting Method :

The 50/50 method involves dividing the problem into two equal parts, which helps reduce complexity. For example, if you're experiencing a performance issue, you can divide it into potential server-side and client-side issues.
Next, you test each part separately to identify where the problem lies. This may involve checking the server infrastructure, configurations, or client-side connectivity issues.
After testing both parts, you analyze the results to determine which part is causing the problem. This allows you to focus your troubleshooting efforts on the problem area.

Real case studies of the 50/50 method

Problem: A company uses a cloud-hosted web application, and users are reporting slow loading times.
a) Divide the Problem:
1) Server Side: Potential issues with the server infrastructure, database, or application code.
2) Client Side: Potential issues with network connectivity, browsers, or user devices.
b) Test Each Side:
Server Side: Check server performance (CPU, memory, bandwidth). Analyze database queries to identify slow or inefficient queries.
Client Side: Test users' internet connection for latency issues. Check browser compatibility and extensions that might be slowing down loading.
c) Analyze the Results:
After running the tests, you discover that database queries may be taking a long time to execute due to a lack of indexing on certain tables. On the client side, tests may show that the internet connection is stable and that browsers are compatible.
This structured approach saves time and quickly identifies the source of problems in complex cloud environments.

B) The Five Whys Method

The Five Whys troubleshooting method really encourages you to dive deeper until you find the root cause of the issue. This method involves you repeatedly asking why until you reach the root cause of the issue. This can help guide your troubleshooting efforts as you think through what could be causing the issue. Let’s run through an example.
Problem: a web application is running slow.
  1. Why is the web application running slow? Because the response time for the page loads is unusually high.
  2. Why is the response time for page loads unusually high?Because the server is taking longer than usual to process requests.
  3. Why is the server taking longer than usual to respond to requests?Because the database queries run by the application are inefficient and result in slow data retrieval.
  4. Why are the database queries inefficient?Because the database schema is not optimized, leading to inefficient query execution.
  5. Why is the database schema not optimized?Because the application was initially designed for a smaller scale and didn't account for the growing volume of data and user traffic, resulting in suboptimal database indexing and query performance.
By asking why repeatedly, we've identified a deeper issue. The application's database schema was not designed to handle the increased data volume and user traffic, leading to inefficient query performance. To address the slow performance of the web application, it's essential to optimize the database schema, improve query efficiency, and possibly scale up the infrastructure to accommodate the growing demand.

C) The Bottom-Up Method

In this approach, troubleshooting starts at the lowest level components of the system and moves upwards towards the higher-level components. For example, when troubleshooting an application issue, you might start by checking the underlying infrastructure, such as server resources and network connectivity, before examining the application itself. Let’s run through an example.
Problem: A cloud-based file-sharing application is experiencing slow upload speeds.
Start at the lowest level
You begin by examining the network infrastructure closest to the user, such as their local network setup and internet connection.
Investigate network connectivity
  • Local Network: You check if there are any issues with the customers local network, like network slow downs, network rule configuration problems, or hardware issues.
  • Internet Service Provider: You verify the user's internet connection to ensure it meets the expected upload speed requirements and troubleshoot any issues with the ISP if necessary. This should eliminate the possibility that the slow upload speed is on the customer side.
Examine device-specific factors
  • User Device Issues: Everyone is using a device to connect to the file sharing application. So, you investigate if the user's device ( computer, smartphone) has any hardware or software limitations that could affect upload performance, such as outdated network drivers, insufficient processing power, or background processes consuming bandwidth.
  • Browser Compatibility: You also assess if the web browser being used by the user is optimized for file uploads and if any browser extensions or plugins are interfering with the upload process. You can usually inspect network traffic directly in the browser by using right click - inspect. You can also see if the browser is throwing any errors in the console.
Analyze application-level factors
  • File-sharing Application: You examine the cloud-based file-sharing application's server infrastructure, including server load, storage capacity, and network bandwidth availability.
  • Application Code: You review the application code to identify any inefficiencies or bottlenecks in the upload process, such as excessive data validation, or inefficient file chunking.
Narrow down potential causes
After investigating network connectivity, device-specific factors, and application-level factors, you analyze the collected data to narrow down potential causes of the slow upload speeds.

D) The Top-Down Method

This one is like the opposite of the bottom-up method. The top-down method begins at the highest level of the system components and drills down to lower-level components. You start by assessing the overall system behavior or user-reported symptoms and then narrow down the potential causes by analyzing system components.
Problem: The cloud-based email service is experiencing intermittent delivery delays.
Start with the highest level
You begin by assessing the overall behavior of the email service and the reported symptoms of intermittent delivery delays.
Check service-level factors
  • Email Service Status: Check the status of the email service to determine if there are any widespread outages or service disruptions affecting delivery performance.
  • Server Load: Evaluate the server infrastructure's overall load and performance metrics to identify any spikes in activity or resource bottlenecks that may be contributing to delays.
  • Service Logs: Review service logs and monitoring data to identify patterns or anomalies in email delivery times and pinpoint periods of slow performance.
Investigate application-level factors
  • Email Routing: Analyze the email routing process within the application to identify potential bottlenecks or misconfigurations that could delay message delivery. Check delivery logs if they exist.
  • Email Filters: Assess the performance of spam filters and virus scanners integrated into the email service to ensure they are not causing delays due to excessive processing times or false positives.
Analyze user-specific factors
  • User Settings and Preferences: Investigate if individual user settings or preferences, such as email forwarding rules are impacting message delivery times.
  • Recipient Mail Servers: Check the performance and responsiveness of recipient mail servers to determine if delays are occurring on the recipient's end rather than within the email service itself.
  • Network Latency: Assess network latency and connectivity issues between the email service and recipient mail servers that may be causing delays in message transmission.
Narrow down potential causes
After analyzing service-level factors, application-level factors, and user-specific factors, narrow down potential causes of the intermittent delivery delays.
Important note: The bottom-up method focuses on the most fundamental elements of a system, such as hardware (servers, routers), networks (connectivity), and core components (supporting software), analyzing them first before moving on to higher levels like applications and services. In contrast, the top-down method starts with a high-level view of the system, first examining overall performance and symptoms (like slowdowns or errors), and then drilling down to specific details, like application code or database configurations. Thus, the bottom corresponds to the basic and fundamental elements, while the top corresponds to the overall elements and behaviors of the system.

Epilogue: I've deliberately left out the dive and conquer method, which at first glance looks a lot like the 50/50 method in its approach. Therefore, this article is not intended to be an exhaustive list, but rather should give you some basic ideas on how to structure your thinking and process when solving problems in your cloud environments and infrastructures.

And you, tell me what method have you already used to debug your cloud infrastructure? Or do you have other methods to recommend? Share them with me. Thanks!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article