Questions tagged [puma]

Puma is a simple, fast, threaded, and highly concurrent HTTP server for Ruby/Rack applications.

From the introduction:

Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for Rubinius, but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.

Also see the GitHub project.

1218 questions
225
votes
17 answers

NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream

I have Puma running as the upstream app server and Riak as my background db cluster. When I send a request that map-reduces a chunk of data for about 25K users and returns it from Riak to the app, I get an error in the Nginx log: upstream timed out…
user2768537
  • 2,251
  • 2
  • 12
  • 4
171
votes
10 answers

Rails: Address already in use - bind(2) (Errno::EADDRINUSE)

I am trying to deploy Rails app with the Puma web server. When trying to start Puma server with a config file bundle exec puma -C config/puma.rb I get an error that the address is already in use. Does someone know how to fix this? bundle exec puma…
Cornelius Wilson
  • 2,844
  • 4
  • 21
  • 41
142
votes
18 answers

Connecting to WSL2 server via local network

I'm developing a rails app using WSL2/Ubuntu on my Windows 10 machine, which is great! The problem is I can't connect to my server from another computer in the same network. For further clarity, I am running a Puma server on localhost:3000 I have…
Sebastian Rivas
  • 1,700
  • 2
  • 13
  • 15
79
votes
5 answers

What is the difference between Workers and Threads in Puma

What is the difference between a puma worker and a puma thread in context of a heroku dyno? What I know (please correct me if I am wrong): Thin is not concurrent, so a web process can only do one request at a time In unicorn, I know I can have…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
53
votes
6 answers

How to restart puma after deploy?

I'm using Rails, Puma, Capistrano3. I have installed the gem capistrano3-puma as well. I started Puma with Puma Jungle https://github.com/puma/puma/tree/master/tools/jungle/upstart How do I restart Puma during deployment?
mystdeim
  • 4,802
  • 11
  • 49
  • 77
41
votes
14 answers

puma gem - Failed to build gem native extension

I was getting the following error while installing puma gem $ gem install puma Fetching: puma-2.11.2.gem (100%) Building native extensions. This could take a while... ERROR: Error installing puma: ERROR: Failed to build gem…
Amod Pandey
  • 1,336
  • 3
  • 14
  • 22
36
votes
2 answers

Why do I need Nginx with Puma?

I'm deploying a Rails app to production. It seems that Puma is fast and handles many of the things I want in a web server. I'm wondering if I even need to bother with Nginx, and what I'd be missing out on if just used Puma?
gylaz
  • 13,221
  • 8
  • 52
  • 58
34
votes
3 answers

ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)

I have a rails app in production that i deployed some changes to the other day. All of a sudden now I get the error ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds) multiple…
Catfish
  • 18,876
  • 54
  • 209
  • 353
34
votes
3 answers

How can I serve requests concurrently with Rails 4?

I'm trying to serve multiple requests concurrently in Rails 4, something I was able to do very easily with config.threadsafe! and Puma in Rails 3. Say I have this controller class ConcurrentController < ApplicationController def index sleep…
Fredrik
  • 4,161
  • 9
  • 28
  • 31
31
votes
4 answers

How do I get 'puma' to start, automatically, when I run `rails server` (like Thin does)

Normally, when you run rails server it starts Webrick. If you install the 'thin' gem, then 'thin' starts instead. I would like to do the same thing with the 'puma' server. I see that the start command within railties (lib/rails/commands) calls…
Matt Scilipoti
  • 1,091
  • 2
  • 11
  • 15
28
votes
2 answers

What do multi-processes VS multi-threaded servers most benefit from?

Can anyone explain what's the bottleneck of each concurrency method? Servers like Unicorn (process based) an Puma (thread based). Does each method prefer CPU cores? threads? or simply clock speed? or a special combination? How to determine the…
CodeOverload
  • 47,274
  • 54
  • 131
  • 219
27
votes
8 answers

HTTP parse error, malformed request - Ruby on Rails

I see the following error in Terminal when attempting to run a Ruby on Rails app. HTTP parse error, malformed request (): # 2017-03-12 13:10:02 -0400: ENV: {"rack.version"=>[1, 3],…
Nick April
  • 271
  • 1
  • 3
  • 4
27
votes
2 answers

ActionCable no longer working in production environment

I have a Rails 5 app which uses Action Cable for websocket functionality. In my development environment everything works as expected and the browser clients successfully connect to the Action Cable channels. In my production environment Action Cable…
edwardmp
  • 6,339
  • 5
  • 50
  • 77
27
votes
3 answers

How to monitor a puma server?

Is there a way to monitor the status of a puma server? most specifically, how many busy workers it has and how many threads each worker provisioned. best would be something similar to apache's mod_status
Tal
  • 7,827
  • 6
  • 38
  • 61
26
votes
5 answers

Rails server doesn't see code changes and reload files

I noticed that my rails server doesn't reload controllers, models and probably any other files after I change them. I use Vagrant and Rails API, and I found that some people fix this problem by adding below line to the…
mparkitny
  • 1,165
  • 1
  • 9
  • 16
1
2 3
81 82