Get Advice Icon

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

Gunicorn
Gunicorn

639
312
+ 1
62
Unicorn
Unicorn

480
302
+ 1
295
Add tool

Gunicorn vs Unicorn: What are the differences?

Developers describe Gunicorn as "A Python WSGI HTTP Server for UNIX". Gunicorn is a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy. On the other hand, Unicorn is detailed as "Rack HTTP server for fast clients and Unix". Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between Unicorn and slow clients.

Gunicorn and Unicorn can be primarily classified as "Web Servers" tools.

"Python" is the primary reason why developers consider Gunicorn over the competitors, whereas "Fast" was stated as the key factor in picking Unicorn.

Gunicorn and Unicorn are both open source tools. Gunicorn with 5.91K GitHub stars and 1.12K forks on GitHub appears to be more popular than Unicorn with 1.35K GitHub stars and 248 GitHub forks.

reddit, hike, and OpenLabel are some of the popular companies that use Gunicorn, whereas Unicorn is used by Instacart, Shopify, and New Relic. Gunicorn has a broader approval, being mentioned in 184 company stacks & 50 developers stacks; compared to Unicorn, which is listed in 176 company stacks and 55 developer stacks.

What is Gunicorn?

Gunicorn is a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.

What is Unicorn?

Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between Unicorn and slow clients.
Get Advice Icon

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

Why do developers choose Gunicorn?
Why do developers choose Unicorn?

Sign up to add, upvote and see more prosMake informed product decisions

    Be the first to leave a con
    What companies use Gunicorn?
    What companies use Unicorn?

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

    What tools integrate with Gunicorn?
    What tools integrate with Unicorn?
      No integrations found
      What are some alternatives to Gunicorn and Unicorn?
      uWSGI
      The uWSGI project aims at developing a full stack for building hosting services.
      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.
      Microsoft IIS
      Internet Information Services (IIS) for Windows Server is a flexible, secure and manageable Web server for hosting anything on the Web. From media streaming to web applications, IIS's scalable and open architecture is ready to handle the most demanding tasks.
      Apache Tomcat
      Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.
      See all alternatives
      Decisions about Gunicorn and Unicorn
      Jerome Dalbert
      Jerome Dalbert
      Senior Backend Engineer at StackShare | 6 upvotes 94.3K views
      atStackShareStackShare
      Unicorn
      Unicorn
      Puma
      Puma
      Rails
      Rails

      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.
      See more
      Simon Bettison
      Simon Bettison
      Managing Director at Bettison.org Limited | 6 upvotes 136.5K views
      atBettison.org LimitedBettison.org Limited
      PostgreSQL
      PostgreSQL
      Elasticsearch
      Elasticsearch
      Sidekiq
      Sidekiq
      Redis
      Redis
      Amazon ElastiCache
      Amazon ElastiCache
      Rails
      Rails
      RSpec
      RSpec
      Selenium
      Selenium
      Travis CI
      Travis CI
      Ruby
      Ruby
      Unicorn
      Unicorn
      nginx
      nginx
      Amazon CloudFront
      Amazon CloudFront
      Amazon SES
      Amazon SES
      Amazon SQS
      Amazon SQS
      Amazon Route 53
      Amazon Route 53
      Amazon VPC
      Amazon VPC
      Docker
      Docker
      Amazon EC2 Container Service
      Amazon EC2 Container Service

      In 2010 we made the very difficult decision to entirely re-engineer our existing monolithic LAMP application from the ground up in order to address some growing concerns about it's long term viability as a platform.

      Full application re-write is almost always never the answer, because of the risks involved. However the situation warranted drastic action as it was clear that the existing product was going to face severe scaling issues. We felt it better address these sooner rather than later and also take the opportunity to improve the international architecture and also to refactor the database in. order that it better matched the changes in core functionality.

      PostgreSQL was chosen for its reputation as being solid ACID compliant database backend, it was available as an offering AWS RDS service which reduced the management overhead of us having to configure it ourselves. In order to reduce read load on the primary database we implemented an Elasticsearch layer for fast and scalable search operations. Synchronisation of these indexes was to be achieved through the use of Sidekiq's Redis based background workers on Amazon ElastiCache. Again the AWS solution here looked to be an easy way to keep our involvement in managing this part of the platform at a minimum. Allowing us to focus on our core business.

      Rails ls was chosen for its ability to quickly get core functionality up and running, its MVC architecture and also its focus on Test Driven Development using RSpec and Selenium with Travis CI providing continual integration. We also liked Ruby for its terse, clean and elegant syntax. Though YMMV on that one!

      Unicorn was chosen for its continual deployment and reputation as a reliable application server, nginx for its reputation as a fast and stable reverse-proxy. We also took advantage of the Amazon CloudFront CDN here to further improve performance by caching static assets globally.

      We tried to strike a balance between having control over management and configuration of our core application with the convenience of being able to leverage AWS hosted services for ancillary functions (Amazon SES , Amazon SQS Amazon Route 53 all hosted securely inside Amazon VPC of course!).

      Whilst there is some compromise here with potential vendor lock in, the tasks being performed by these ancillary services are no particularly specialised which should mitigate this risk. Furthermore we have already containerised the stack in our development using Docker environment, and looking to how best to bring this into production - potentially using Amazon EC2 Container Service

      See more
      Interest over time
      Reviews of Gunicorn and Unicorn
      No reviews found
      How developers use Gunicorn and Unicorn
      Avatar of Banyan
      Banyan uses GunicornGunicorn

      Gunicorn is WSGI container that we used to run our Tornado code as it supports Asynchronous operations on tornado.

      Avatar of SmartLogic
      SmartLogic uses UnicornUnicorn

      Rolling deploys are awesome! We use Unicorn to keep downtime to a minimum as we iterate quickly for our clients.

      Avatar of MiW CryptAnalytics
      MiW CryptAnalytics uses GunicornGunicorn

      Gunicorn runs as the HTTP application server. Serves the django application in WSGI mode.

      Avatar of Avalanche Network
      Avalanche Network uses UnicornUnicorn

      Our super server that runs a web instance and a worker instance.

      Avatar of TOMIS
      TOMIS uses GunicornGunicorn

      uWSGI server that is easy to configure with Nginx and Django

      Avatar of Val Neekman
      Val Neekman uses GunicornGunicorn

      Gunicorn is used as the backend webserver

      Avatar of Alec Cunningham
      Alec Cunningham uses GunicornGunicorn

      Runs my Django based API through nginx.

      Avatar of douglasresende
      douglasresende uses UnicornUnicorn

      I use with my Ruby on Rails projects.

      Avatar of Karma
      Karma uses UnicornUnicorn

      Our go-to Ruby application server.

      How much does Gunicorn cost?
      How much does Unicorn cost?
      Pricing unavailable
      Pricing unavailable
      News about Gunicorn
      More news
      News about Unicorn
      More news