NGINX Open Source and NGINX Plus are commonly used to enhance performance and fault tolerance by acting as a load balancer for many application servers, including Apache Tomcat™.
To help customers get the most out of their Tomcat deployments, NGINX, Inc. has published a new deployment guide, Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plus. This guide details how NGINX and NGINX Plus can be utilized as a load balancer and application delivery controller for Apache Tomcat application servers.
Why NGINX and NGINX Plus?
Many Apache Tomcat deployments use the Apache HTTP Server for application delivery, as specified in the Tomcat installation instructions. Apache HTTP Server’s thread-per-connection architecture delivers acceptable performance under low-to-medium load, but under heavy load the limitations of the architecture begin to surface. In one common scenario, the thread pool becomes exhausted when there is a large number of concurrent connections, which in turn delays acceptance of new connections until the threads are released. Issues like this, along with the small number of load‑balancing configuration options in HTTP Server, limit its usefulness as a load balancer in high‑traffic Apache Tomcat application server deployments.
NGINX and NGINX Plus eliminate HTTP Server’s performance limitations by using asynchronous operations to achieve high concurrency without the overhead of threads. This architecture enables them to scale and handle a large number of simultaneous connections using a very small memory footprint. In addition to performance and scale, NGINX provides a number of benefits for Apache Tomcat applications:
- Event-driven architecture – NGINX provides much greater scalability and resilience to traffic spikes and DOS attacks than WebLogic Server offers on its own.
- HTTP/2 support – NGINX supports the HTTP/2 protocol, which offers improved performance over HTTP/1.1.
- Load balancing – The variety of load balancing algorithms in NGINX enable you to scale out your Tomcat applications as well as maintain high availability.
- SSL/TLS termination – NGINX can terminate SSL/TLS connections to offload that work from Tomcat application servers.
- Caching – NGINX acts as a highly capable cache for both static and dynamic content, which greatly improves application performance.
And NGINX Plus, the enhanced and commercially supported product, builds on NGINX with additional enterprise‑ready features:
- Application health checks – NGINX Plus proactively monitors Tomcat application servers and stops sending requests to unhealthy servers.
- Session persistence – NGINX Plus leverages the
JSESSIONIDcookie to ensure that a user’s requests are forwarded to the same Tomcat application server every time.
- Dynamic reconfiguration of load‑balanced servers – You can reconfigure load-balanced server groups on the fly using the Domain Name System (DNS) or a simple HTTP API.
- Live activity monitoring – NGINX Plus has a real‑time activity monitoring interface that provides key load and performance metrics.
How Do I Get Started?
To get started using NGINX and NGINX Plus with Apache Tomcat application servers, check out the new deployment guide developed by NGINX, Inc. It provides step-by-step instructions for configuring NGINX and NGINX Plus to efficiently load balance and scale your servers. Configuration files for basic and enhanced load balancing are also available so you don’t have to cut and paste from the guide.
Experienced with Tomcat but new to NGINX Plus? Take advantage of our free 30-day trial or contact us to discuss your use cases, and see for yourself how NGINX Plus can boost the performance and manageability of your Tomcat applications.
- Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plus
- Download configuration file for basic load balancing of Tomcat application servers (for experienced NGINX Plus users)
- Download configuration file for enhanced load balancing of Tomcat application servers (for experienced NGINX Plus users)