Cowboy vs Puma: What are the differences?
Cowboy: Small, fast, modular HTTP server written in Erlang. Cowboy aims to provide a complete HTTP stack in a small code base. It is optimized for low latency and low memory usage, in part because it uses binary strings. Cowboy provides routing capabilities, selectively dispatching requests to handlers written in Erlang; Puma: A Modern, Concurrent Web Server for Ruby. 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.
Cowboy and Puma can be primarily classified as "Web Servers" tools.
"Websockets integration" is the top reason why over 6 developers like Cowboy, while over 2 developers mention "Easy" as the leading cause for choosing Puma.
Cowboy and Puma are both open source tools. Puma with 5.78K GitHub stars and 987 forks on GitHub appears to be more popular than Cowboy with 5.59K GitHub stars and 999 GitHub forks.
What is Cowboy?
What is Puma?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Cowboy?
Sign up to get full access to all the companiesMake informed product decisions
What tools integrate with Cowboy?
What tools integrate with Puma?
We switched from Unicorn (process model) to Puma (threaded model) to decrease the memory footprint of our Rails production web server. Memory indeed dropped from 6GB to only 1GB!
We just had to decrease our worker count and increase our thread count instead. Performance (response time and throughput) remained the same, if not slightly better. We had no thread-safety errors, which was good.
Free bonus points are:
- Requests are blazing fast on our dev and staging environments!
- Puma has first-class support for WebSockets, so we know for sure that Rails ActionCable or GraphQL subscriptions will work great.
- Being on Puma makes us even more "default Rails"-compliant since it is the default Rails web server these days.