Backend Development 10 min read

Using Undertow as an Alternative to Tomcat in SpringBoot: Features, Configuration, and Performance Comparison

This article explains how SpringBoot’s default embedded Tomcat can be replaced with the high‑performance Undertow server, shows the necessary Maven dependencies, lists Undertow’s key features, presents benchmark results comparing QPS and memory usage, and concludes with recommendations for high‑concurrency applications while also noting related AI‑product promotions.

Top Architect
Top Architect
Top Architect
Using Undertow as an Alternative to Tomcat in SpringBoot: Features, Configuration, and Performance Comparison

In SpringBoot the most commonly used embedded container is Tomcat, which is the default and runs out‑of‑the‑box. SpringBoot also supports the Undertow container, which offers better performance and lower memory consumption.

1. SpringBoot’s Tomcat Container

SpringBoot is a popular Java web framework that simplifies project setup by eliminating heavy XML configuration. As a web project, a container is required to run the application, and Tomcat is the default embedded container.

2. Setting Up Undertow in SpringBoot

Undertow is a flexible, high‑performance web server written in Java. It uses non‑blocking NIO, supports Servlet 3.1, and is the default server for WildFly. It provides an easy‑to‑use builder API and can be embedded directly in Java applications.

What is Undertow? A lightweight, high‑performance web server that supports both blocking and non‑blocking I/O.

Key Features High performance under load Servlet 4.0 support Full WebSocket (JSR‑356) support Embedded design – no external container needed Chainable handlers for flexible request processing Lightweight core consisting of two JARs

SpringBoot already integrates Undertow; you only need to modify the Maven dependencies.

Remove the default Tomcat dependency:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Add the Undertow starter:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-undertow</artifactId>
</dependency>

After these changes, the application starts with Undertow as the embedded server.

3. Tomcat vs. Undertow Performance Comparison

Benchmark tests on identical hardware show that Undertow outperforms Tomcat in both QPS and memory usage, especially under high concurrency. Undertow also enables persistent connections by default, further improving throughput.

Result: For high‑concurrency business systems, Undertow is the preferred choice.

4. Conclusion

SpringBoot allows you to use either Tomcat or Undertow for HTTP services. In high‑traffic scenarios, Undertow delivers superior performance and lower resource consumption, making it a strong alternative to the default Tomcat.

Promotional Note: The article also includes a series of promotional messages about AI tools, a paid “DeepSeek” product bundle, and various giveaways. These sections are marketing material and not part of the technical tutorial.

backendJavaperformanceSpringBootTomcatUndertow
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.