Monitoring a Web Application Stack (Nginx,Haproxy,Apache)


Dearchitectureveloping a responsive highly available web application is a complex task with many subcomponents. In the old days , a web application used to consist of a web server, usually Apache with a few cgi scripts to provide content dynamically. As the web grew in size so did the stack, the number of subcomponents,hosts involved increased in number and complexity. A simple web application can now easily consist of a web server, a load balancer, a few databases and a web framework such as Django or Rails. In this blog post we are going to look  at the  different Logscape Apps needed to monitor a web farm.


The environment used is a simple static content web farm using HAProxy and Nginx. In this particular example we also have Apache instances alongside Nginx serving the same content. HAProxy has been configured to balance incoming requests equally across the 2 servers using the round-robin load balancing algorithm. The Apache Benchmark tool was used to stress the web servers.

1. Load Balancer  – HAProxy

HAProxy provides statistics through its admin socket. Using the ‘show info’ and the ‘show stats’ commands we can get a profile of how many connections are being handled by HAProxy and to which backends they are being forwarded too.


This information is imported by the HAProxyApp and visualized. Current queue lengths, open sessions and error response counts are some of the metrics collected.

2. Web Server Health

Nginx and Apache both collect and publish performance statistics. Apache uses the module and Nginx uses the http_status_module for this. Both need to be enabled to provide server performance monitoring. The dashboards found in the ApacheApp-1.0 and the NginxApp-1.0 display how well the servers are coping under the current load.

How the traffic forwarded by a haproxy affects the servers performance can seen using these Workspaces.



3.  Web Logs

The http access logs of the most popular servers Apache, Nginx ,IIS all use the same formats based around the common log format (CLF). They can be configured to provide more information like the page request times and bytes transferred in a request or response.

The WeblogsApp provides Workspace which visualize page throughput, request response times and bandwidth.


4. Server Health

The hosts running the various services also require monitoring. The Windows and Unix Apps provide workspaces visualizing operating system KPIs (key performance indicators). In the Workspace below the server load is displayed as a line chart and various metrics such as disk wait times and memory and network throughput are heatmapped in a table.


A quick glance at the Workspace will show any outliers. The UnixApp contains other dashboards which give a break down of disk, network and memory metrics and also security and syslog events.

5. Tying it all together

To monitor the load balancer, web servers and the operating system you will need 3 different Logscape Apps. The main problem with monitoring applications with many subcomponents is that the complexity of the infrastructure somehow finds its way into the monitoring solutions. The AppMetrics Workspace gives a simplified view of all the various processes running across your stack all in once place.



From this workspace you can identify a process or server that is running hot and what app is being used to monitor the process if you require to further analysis. Even though this workspace has less detail than many of the component specific Apps, it is still important since it gives a birds-eye view of everything running in the web application stack.

Where to get the Apps

You can download all these apps from the apps page.

Subscribe to our mailing list




Monitoring a web application stack is made easier by using a monitoring solution that understands and simplifies a complex application stack. Download Logscape and start monitoring today !!!