Application Performance Management and NGINX

Successful businesses understand their customers. This can be a bit easier with a physical storefront, where you have a direct connection to your customers and can visually gauge their experience. If they have to wait in line too long, you can quickly see that with your own eyes, and your customers are sure to tell you about it. Running a business digitally, however, means that you lose that face‑to‑face interaction. The challenge this poses is critical. Digital customers are quick to move on: 80% say they are less likely to come back after having a poor experience.

A poor experience online is also not just usability problems, either; a delay of even a few seconds for a screen to render or any kind of technical hiccup during a transaction is interpreted by many users as a breakdown in the experience, and with it their trust in your brand. With a digital business it’s even more critical to understand what your customers are experiencing.

Application performance management (APM) solutions help bridge that gap to give businesses visibility into how well their applications are performing and what the user experience is like. Engineers can take a customer complaint, such as “my checkout is slow”, and, using the APM tool, dive down and find the root cause of the problem. Vendors that offer Application Performance Management solutions include AppDynamics, Dynatrace, New Relic, and Riverbed.

This blog provides an overview on APM as well as the insights NGINX provides into application performance.

A Typical Application

Application performance management tools aim to give end‑to‑end visibility into the application. The diagram below depicts a typical three‑tier application, for example an ecommerce site. The first tier is the clients and their user interface (UI), depicted on the left. This first layer is closest to the user and covers what they see in the browser, how the images are laid out, where the text goes, and in general the overall structure of each page.

A typical application architure
A three‑tier architecture with NGINX

The content on most pages of an ecommerce site, such as the pricing information that appears when the user clicks on a product, are dynamically generated by the second tier, the application servers. To build the pages, the application server interfaces with the third tier, the database, depicted all the way on the right of the diagram. In this example, the application server queries the database for the product description, price, and other information it needs. It then builds the page using this data and returns it to the browser to be displayed.

Sitting between the clients and application servers, NGINX load balances, caches, and reverse proxies traffic. This is sometimes called the delivery tier.

Monitoring Performance of Application Servers

At the core of application performance management is monitoring the application servers, where the core application logic lives. They are responsible for generating the dynamic pages users see and handling user input.

To monitor an application server, an agent is typically installed on the server itself. The agent periodically polls the interpreter or virtual machine (VM) for the programming language the application uses. It collects data, such as transaction traces, and feeds that data back to a portal.

With this information the portal can provide visualizations like the one in the following screenshot from Dynatrace. Looking through the transaction trace, we can see that it took a little over a second to check the credit card number provided by the user. Having identified this as being a potential bottleneck in the transaction, engineers can now focus their efforts on improving this piece of the application.

Application Performance Management with Dynatrace
A transaction trace from Dynatrace

Application monitoring tools can also monitor overall call counts, error rates, and time spent on database calls to give a full picture of what is going on inside the application servers.

Monitoring Performance with NGINX and NGINX Plus

NGINX and NGINX Plus sit on the edge of a site’s internal network, between clients and the application. From this position they see most or all of the traffic that passes in and out of the application. They are responsible for packaging traffic to be sent over the Internet as well as protecting the application servers from being overwhelmed.

Monitoring NGINX performance with DataDog
Performance monitoring NGINX with DataDog

The screenshot from Datadog above shows how many requests per second NGINX handled. NGINX provides other valuable statistics, such as:

  • Connections – The number of current connections as well as the number that are active vs. idle
  • Bandwidth – How much bandwidth the application is using

WIth NGINX Plus you get even more data on application performance:

  • Cache – How full is the cache and what percentage of requests are being served out of the cache
  • Granularity – NGINX Plus breaks down the statistics per server, so you can see how your servers are performing relative to each other
  • Health – With active health checks in NGINX, you can quickly identify any failed servers

NGINX Plus has a built‑in dashboard where you can see all of the available statistics, or they can be exported to our various partners, such as New Relic, Data Dog, and Dynatrace.

Real User Monitoring

So far the monitoring has been focused in the data center, but what about the browser and the actual user? The back end services in the data center generate the pages the are loaded in the client’s web browser. Real user monitoring (RUM) attempts to quantify the experience of the actual user and where the time is being sent from the moment the user hits enter till when the page is fully rendered.

Real user monitoring works with the help of JavaScript code that is downloaded along with the rest of the elements that comprise the web page. Once the JavaScript runs, it reports back to the portal the amount of time spent in each stage of the page loading in the browser.

RUM with New Relic
Real user monitoring with New Relic

In the above example we can see that the majority of the time was spent downloading and rendering the page within the browser.

Conclusion

For a digital business, gaining insight into the user experience is critical to success. Application performance management can help provide that insight and give businesses the tools they need to be proactive in maintaining a high level of customer satisfaction. Through both our own application performance monitoring software and our partnerships with the leading APM vendors, NGINX and NGINX Plus are committed to providing the kind of rich data that will give you the best possible visibility and control, and to helping you ensure a flawless user experience.

To try NGINX Plus, start your free 30-day trial today or contact us for a demo.

Cover image
Free O'Reilly Ebook
Your guide to everything NGINX