Using NGINX and NGINX Plus to Load Balance Apache Tomcat Servers – NGINX
Check out how to employ NGINX and NGINX plus for load balancing Tomcat servers.
Join the DZone community and get the full member experience.Join For Free
To help customers get the most out of their Tomcat deployments, NGINX, Inc. has published a new deployment guide, Using NGINX and NGINX Plus to Load Balance Apache Tomcat Servers. 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.
- SPDY and HTTP/2 support – NGINX supports both the SPDY and HTTP/2 protocols, which offer 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.
- TLS/SSL termination – NGINX can terminate TLS/SSL 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.
- On-the-fly 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, download the new deployment guide developed by NGINX, Inc. It provides step-by-step instructions 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 30-day free trial or contact us for a live demo, and see for yourself how NGINX Plus can boost the performance and manageability of your Tomcat applications.
Published at DZone with permission of Patrick Nommensen, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.