Need advice about which tool to choose?Ask the StackShare community!

Puma

839
263
+ 1
20
Apache Tomcat

16.5K
12.4K
+ 1
201
Add tool

Apache Tomcat vs Puma: What are the differences?

Introduction

Apache Tomcat and Puma are both popular web servers used for hosting and managing web applications. While they share some similarities, there are key differences that set them apart.

  1. Deployment Model: Apache Tomcat is primarily designed for Java applications and supports Java Servlets and JavaServer Pages (JSP). It provides a lightweight environment for running Java-based web applications. On the other hand, Puma is a web server designed for Ruby applications, specifically Ruby on Rails. It provides a robust and high-performance platform for hosting Ruby web applications.

  2. Concurrency Model: Apache Tomcat uses a thread per request model, where each incoming request is handled by a separate thread. This makes it capable of handling multiple requests concurrently. Puma, on the other hand, uses a hybrid concurrency model with multiple worker processes and threads within each process. This allows Puma to handle a higher number of concurrent requests while utilizing system resources more efficiently.

  3. Scalability: When it comes to scalability, Apache Tomcat supports clustering and load balancing, allowing you to distribute the load across multiple instances of Tomcat servers. This helps in achieving higher availability and better performance for your applications. Puma, on the other hand, does not natively support clustering and load balancing. However, it can be used with other tools and technologies like Nginx or AWS Elastic Load Balancer to achieve similar scalability.

  4. Configuration and Tuning: Apache Tomcat provides a range of configuration options and tuning parameters that allow you to optimize its performance and behavior. It also supports features like session persistence, connection pooling, and resource caching. Puma, being a web server for Ruby applications, relies more on the configuration and optimization of the Ruby on Rails framework itself. It provides fewer server-specific tuning options compared to Tomcat.

  5. Operating System Compatibility: Apache Tomcat is written in Java and is platform-independent, making it compatible with a wide range of operating systems, including Windows, Linux, and macOS. Puma, on the other hand, is specifically designed for Unix-based systems like Linux and macOS. While it can be used on Windows systems, it is not as well optimized for that platform.

  6. Ecosystem and Community: Both Apache Tomcat and Puma have large and active communities supporting them. However, Apache Tomcat has a larger ecosystem and community due to its longstanding presence and popularity. It has a wide range of documentation, tutorials, and community-driven plugins and libraries available. Puma, being more focused on Ruby applications, has a slightly smaller ecosystem but still benefits from the vibrant Ruby community.

In Summary, Apache Tomcat and Puma differ in terms of their deployment model, concurrency model, scalability options, configuration and tuning abilities, operating system compatibility, and ecosystem size.

Advice on Puma and Apache Tomcat
Mark Ndungu
Software Developer at Nouveta · | 4 upvotes · 31.1K views
Needs advice
on
PumaPuma
and
UnicornUnicorn

I have an integration service that pulls data from third party systems saves it and returns it to the user of the service. We can pull large data sets with the service and response JSON can go up to 5MB with gzip compression. I currently use Rails 6 and Ruby 2.7.2 and Puma web server. Slow clients tend to prevent other users from accessing the system. Am considering a switch to Unicorn.

See more
Replies (1)
Recommends
on
PumaPuma

Consider trying to use puma workers first. puma -w basically. That will launch multiple puma processes to manage the requests, like unicorn, but also run threads within those processes. You can turn the number of workers and number of threads to find the right memory footprint / request per second balance.

See more
Decisions about Puma and Apache Tomcat

I was in a situation where I have to configure 40 RHEL servers 20 each for Apache HTTP Server and Tomcat server. My task was to 1. configure LVM with required logical volumes, format and mount for HTTP and Tomcat servers accordingly. 2. Install apache and tomcat. 3. Generate and apply selfsigned certs to http server. 4. Modify default ports on Tomcat to different ports. 5. Create users on RHEL for application support team. 6. other administrative tasks like, start, stop and restart HTTP and Tomcat services.

I have utilized the power of ansible for all these tasks, which made it easy and manageable.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Puma
Pros of Apache Tomcat
  • 4
    Free
  • 3
    Convenient
  • 3
    Easy
  • 2
    Multithreaded
  • 2
    Consumes less memory than Unicorn
  • 2
    Default Rails server
  • 2
    First-class support for WebSockets
  • 1
    Lightweight
  • 1
    Fast
  • 79
    Easy
  • 72
    Java
  • 49
    Popular
  • 1
    Spring web

Sign up to add or upvote prosMake informed product decisions

Cons of Puma
Cons of Apache Tomcat
  • 0
    Uses `select` (limited client count)
  • 3
    Blocking - each http request block a thread
  • 2
    Easy to set up

Sign up to add or upvote consMake informed product decisions

What is Puma?

Unlike other Ruby Webservers, Puma was built for speed and parallelism. Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications.

What is Apache Tomcat?

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.

Need advice about which tool to choose?Ask the StackShare community!

Jobs that mention Puma and Apache Tomcat as a desired skillset
What companies use Puma?
What companies use Apache Tomcat?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Puma?
What tools integrate with Apache Tomcat?
    No integrations found

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    What are some alternatives to Puma and Apache Tomcat?
    Atlas
    Atlas is one foundation to manage and provide visibility to your servers, containers, VMs, configuration management, service discovery, and additional operations services.
    Panther
    It is a convenient standalone library to scrape websites and to run end-to-end tests using real browsers.
    NGINX
    nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. According to Netcraft nginx served or proxied 30.46% of the top million busiest sites in Jan 2018.
    Apache HTTP Server
    The Apache HTTP Server is a powerful and flexible HTTP/1.1 compliant web server. Originally designed as a replacement for the NCSA HTTP Server, it has grown to be the most popular web server on the Internet.
    Amazon EC2
    It is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.
    See all alternatives