4 Debugging apps remotely

 

This chapter covers

  • Debugging an app installed in a remote environment
  • Upskilling debugging techniques with a hands-on example

One of my friends recently had a problem where a particular part of the software he was implementing was very slow. Generally, when we have these types of performance issues, we suspect that an I/O interface is the cause (e.g., a connection to a database or reading or writing in a file). Remember from chapter 1 that such interfaces often slow down apps, so they are a likely suspect. But in my friend’s case, interfaces were not the issue.

The performance issue was caused by the simple generation of a random value (a universally unique identifier [UUID] stored in the database). The operating system uses hardware sources (e.g., mouse movements, the keyboard, etc.) to collect randomness, referred to as entropy. The app uses this randomness to generate random values. But when we deploy the app in a virtualized environment such as a virtual machine or a container (which is pretty common for app deployments today), the operating system has fewer sources to create its entropy. Thus, sometimes there’s not enough entropy for the app to create the random values it needs. This situation causes performance problems and, in some cases, can have a negative impact on the app’s security.

4.1 What is remote debugging?

4.2 Investigating in remote environments

4.2.1 The scenario

4.2.2 Finding issues in remote environments

Summary