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.

1119 questions
156
votes
12 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
  • 1,561
  • 2
  • 10
  • 4
147
votes
9 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,550
  • 4
  • 17
  • 39
66
votes
3 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
  • 26,414
  • 39
  • 123
  • 214
47
votes
5 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
  • 3,884
  • 7
  • 40
  • 68
45
votes
13 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…
36
votes
13 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,218
  • 3
  • 12
  • 21
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,091
  • 9
  • 25
  • 30
29
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,049
  • 2
  • 11
  • 15
27
votes
4 answers

AWS EB Error: Incorrect application version found on all instances

I am trying to use the EB CLI to deploy an application into an environment but I seem to be getting strange errors. Is there a way to empty out previous application versions so I can upload a fresh application? The message I see after I execute eb…
26
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
  • 17,019
  • 47
  • 183
  • 323
26
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
  • 42,815
  • 48
  • 126
  • 213
25
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
  • 5,933
  • 5
  • 41
  • 74
24
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,075
  • 1
  • 8
  • 15
24
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,136
  • 5
  • 32
  • 58
24
votes
4 answers

How do I use puma's configuration file?

I was following this guide it documents the puma.rb file that is stored inside the app's config directory. The guide is a bit flakey, but here's what I assume the puma.rb file does. Instead of running crazy commands such as this to get puma running…
Starkers
  • 9,083
  • 14
  • 82
  • 143
1
2 3
74 75