Web Server vs WAS — Major Product Comparison
The web server and WAS markets offer a variety of products. Understanding the characteristics and tradeoffs of each, and establishing criteria for which product to choose in which situation, is critical in production environments.
Web Server Comparison: Nginx vs Apache HTTPD
In terms of current market share, Nginx and Apache form a two-player dominance in the web server landscape.
Architectural Differences
The most fundamental difference between the two web servers is their request handling model.
Apache HTTPD — Process/Thread-Based (Multi-Processing Module, MPM)
Apache allocates a process or thread to each connection.
[Apache Prefork MPM]
Request 1 → Worker process 1
Request 2 → Worker process 2
Request 3 → Worker process 3
...
Request N → Worker process N (risk of memory exhaustion)
- Prefork: A separate process per request (high memory usage but stable, works well with PHP mod_php)
- Worker: Hybrid multi-threaded/multi-process approach
- Event: Manages idle connections with a dedicated thread (currently recommended)
Nginx — Asynchronous Event-Driven
Nginx uses a small number of Worker processes running an event loop to asynchronously handle thousands of connections.
[Nginx]
┌─ Event Loop ──┐
Worker process 1 │ Connection 1 │
(1 CPU core) │ Connection 2 │ ← Handles thousands concurrently
│ Connection 3 │
│ ... │
└───────────────┘
Worker process 2 (created to match number of CPU cores)
This architecture is why Nginx became famous for solving the C10K problem(handling 10,000 concurrent connections).
Nginx vs Apache Performance Comparison
| Aspect | Nginx | Apache |
|---|---|---|
| Concurrent connections | Excellent (event-driven) | Lower (thread/process per connection) |
| Static file serving | Very fast | Fast |
| Memory usage | Low | High (thread/process per connection) |
| Configuration flexibility | Medium | Very high (.htaccess support) |
| Module system | Statically compiled | Dynamic loading possible |
| Reverse proxy | Excellent | Possible but more complex than Nginx |
| PHP integration | FastCGI (php-fpm) | mod_php can be embedded directly |
| Learning curve | Medium | Medium to high (many config options) |
| Documentation/community | Rich | Very rich (long history) |
Selection Criteria
Choose Nginx when:
- High-performance, high-traffic environments (thousands to tens of thousands of requests per second)
- Reverse proxy or load balancer role is important
- Used as an API Gateway for microservices
- Cloud/container environments (Docker, Kubernetes)
- Static file (CDN Origin) heavy services
Choose Apache when:
- PHP applications (using mod_php)
- Shared hosting environments that require .htaccess
- Complex URL rewriting (mod_rewrite) is needed
- Maintaining existing Apache-based legacy systems
- Various authentication modules (mod_auth_*) are required
WAS Comparison: Tomcat vs JBoss(WildFly) vs WebLogic vs WebSphere
Apache Tomcat
Tomcat is a lightweight open-source WAS that implements the Java Servlet and JSP specifications. Because it implements only Servlet, JSP, and WebSocket rather than the full Java EE spec, it is lightweight and fast.
[Tomcat Components]
Catalina ← Servlet container (core)
Coyote ← HTTP/AJP connector
Jasper ← JSP engine (JSP → Servlet conversion)
Characteristics:
- Free and open source
- Simple installation and configuration
- Most widely used as Spring Boot's embedded WAS
- Suitable for lightweight services, startups, and small-to-medium scale
Servlet/JSP Spec by Version:
| Tomcat Version | Servlet Spec | JSP Spec | Jakarta EE | Minimum Java |
|---|---|---|---|---|
| Tomcat 11 | 6.1 | 4.0 | Jakarta EE 11 | Java 17 |
| Tomcat 10 | 6.0 | 3.1 | Jakarta EE 10 | Java 11 |
| Tomcat 9 | 4.0 | 2.3 | Java EE 8 | Java 8 |
Note: Starting from Tomcat 10, the package changed from
javax.*tojakarta.*. Spring Boot 3.x is based on Tomcat 10+.
JBoss / WildFly
JBoss(now ** WildFly**) is an open-source WAS developed by Red Hat that implements the full Java EE/Jakarta EE specification. It is used in environments requiring enterprise features such as EJB (Enterprise JavaBeans), JMS, and CDI.
Characteristics:
- Full Jakarta EE spec support
- Official support with Red Hat Enterprise Linux
- Choose JBoss EAP (Enterprise Application Platform) for paid support
- Used in large enterprises, financial institutions, and government agencies
Oracle WebLogic
A commercial enterprise WAS that Oracle acquired through the BEA Systems purchase.
Characteristics:
- Optimal integration with the Oracle ecosystem (Oracle DB, Oracle Cloud)
- Powerful high-availability clustering and session replication
- Very expensive licensing (per-core licensing)
- Primarily used in large financial institutions and public SI projects
- Usage is declining as organizations shift to cloud-native approaches
IBM WebSphere
A large-scale commercial WAS developed by IBM that integrates with IBM's server and middleware ecosystem.
Characteristics:
- Integration with IBM mainframes, DB2, and MQ
- Exists as aged legacy in large financial, insurance, and government organizations
- Very high maintenance costs
- Primarily involved in legacy maintenance rather than new projects
Eclipse Jetty
A more lightweight Java Servlet container than Tomcat. More commonly used as a library embedded within applications rather than running standalone.
Characteristics:
- Very lightweight with fast startup time
- One of the embedded WAS options in Spring Boot (
spring-boot-starter-jetty) - Supports WebSocket and HTTP/2
- Suitable for test environments and lightweight microservices
Web Server + WAS Combination Selection Guide
| Scenario | Recommended Combination | Reason |
|---|---|---|
| Startups / small services | Nginx + Tomcat (Spring Boot embedded) | Lightweight, free, simple configuration |
| PHP-based services | Nginx + php-fpm or Apache + mod_php | Optimized PHP integration |
| High-traffic Java services | Nginx + Tomcat cluster | Load balancing and static file separation |
| Legacy Java EE maintenance | Apache + JBoss/WildFly | Requires Java EE spec |
| Large financial/public SI | Nginx/Apache + WebLogic/WebSphere | Existing environment and contracts |
| Kubernetes / containers | Nginx Ingress + Spring Boot (embedded Tomcat) | Cloud-native |
| Static sites / Jamstack | Nginx standalone or CDN | WAS not needed |
Market Share (Reference)
In the web server market (2024 data, Netcraft survey), Nginx holds the highest market share, forming a dominant two-player landscape alongside Apache. Cloudflare and Microsoft IIS also hold significant shares.
In the Java WAS market, Spring Boot's embedded Tomcat has effectively become the de facto standard, while WebLogic and WebSphere in enterprise environments are gradually being replaced by cloud-native solutions.
Summary
- Web Server Selection: Nginx for new services, Apache for PHP legacy, or a combination of both
- WAS Selection: Tomcat (Spring Boot embedded) for new Java projects, WildFly/WebLogic for enterprise Java EE
- Core Principle: Consider team proficiency, operating environment, costs, and licensing holistically rather than just the tech stack