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
13
votes
2 answers

How do I determine the right number of Puma workers and threads to run on a Heroku Performance dyno?

I've read all of the articles I can find on Heroku about Puma and dyno types and I can't get a straight answer. I see some mentions that the number of Puma workers should be determined by the number of cores. I can't find anywhere that Heroku…
Keith Schacht
  • 1,998
  • 15
  • 23
13
votes
4 answers

Cannot build puma gem on OS X Yosemite

(Revised) question: What does it take install puma gem on my OS X Yosemite (10.10.1) system? I've exhausted a bunch of avenues (I have XCode tools, I have OpenSSL), but it still fails while trying to build the native extensions. The Problem On my…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
12
votes
3 answers

How do I make Rails.cache (in-memory cache) work with Puma?

I'm using Rails 5.1. I have application-wide memory_store caching happening with Rails. This is set up in my config/environments/development.rb file £ Enable/disable caching. By default caching is disabled. if…
Dave
  • 15,639
  • 133
  • 442
  • 830
12
votes
1 answer

Worker, Threads & Pool size using Puma

If I have a server with 1 core, how many puma workers, threads and what database pool size is appropriate? What's the general thumb here?
SandeliusME
  • 802
  • 1
  • 10
  • 19
12
votes
3 answers

nginx redirects POST requests to GET request

I have Rails 4.1 application with runs on puma web server. I use nginx as a proxy server. Several days ago everything worked very well. I updated my application, and suddenly some POST requests started to redirected to same url but as GET request.…
Zhomart
  • 702
  • 1
  • 7
  • 19
11
votes
2 answers

Unable to run Puma as daemon OptionParser::AmbiguousOption: ambiguous option: -d

I upgraded to Puma 5.0.2 and started my rails app as usual with: bundle exec puma -d -e production -b unix:///home/user/app/tmp/puma.sock Now I get the error: OptionParser::AmbiguousOption: ambiguous option: -d What is the proper way to run puma…
Jun Dalisay
  • 1,165
  • 2
  • 12
  • 26
11
votes
1 answer

RuntimeError: can't add a new key into hash during iteration in Rack

I built a pretty small Rails 5.1.4 (Ruby 2.3.1) application. Once I've deployed it to production, I'm getting this particular error from time to time: RuntimeError: can't add a new key into hash during iteration Pointing here: # rack/request.rb,…
nattfodd
  • 1,790
  • 1
  • 17
  • 35
11
votes
3 answers

Cannot create systemd script for Puma

I created a service script named "puma.service" in /etc/systemd/system/ with the following contents: [Unit] Description=Puma HTTP…
Gowtham
  • 11,853
  • 12
  • 43
  • 64
11
votes
2 answers

Puma and Nginx 502 Bad Gateway error (Ubuntu Server 14.04)

I need to deploy my rails application,So I have followed all step from here, https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04 But end of the tutorial, I get this error --> "502 Bad…
Hakan Kara
  • 225
  • 1
  • 2
  • 13
11
votes
1 answer

Rails 5 Action Cable deployment with Nginx, Puma & Redis

I am trying to deploy an Action Cable -enabled-application to a VPS using Capistrano. I am using Puma, Nginx, and Redis (for Cable). After a couple hurdles, I was able to get it working in a local developement environment. I'm using the default…
ollpu
  • 1,783
  • 15
  • 26
11
votes
1 answer

Can I restart Puma workers after a maximum number of requests?

Phusion Passenger offers the ability to restart worker processes after N requests to handle memory issues, and I was wondering does Puma have a similar setting? I've not been able to find anything appropriate in the documentation or code, but I've…
seddy
  • 801
  • 8
  • 16
11
votes
1 answer

Server sent events, Puma, Rails and max dedicated threads for each client

I am using Redis for my rails project to subscribe to channels and publishing to those channels when an event occurs. On the client side, I am registering to EventSource that correspond to these channels. Whenever an event occurs for the subscribed…
random
  • 10,238
  • 8
  • 57
  • 101
11
votes
1 answer

Rails 4, Puma, Nginx - ActionController::Live Streaming dies after first chunk sent

Here's a bare-bones Rails 4 project I've set up to troubleshoot my problem: https://github.com/rejacobson/rails4-streamtest I have a route set up at /home/stream that should stream a line of text 5 times in 1 second intervals. def stream 5.times…
ooog
  • 448
  • 3
  • 8
11
votes
2 answers

Error while starting Puma server with workers

I am new to Rails and Puma, so the issue might be too silly with simple solutions, also please guide me if you think i am doing something wrong. I am trying to start the Puma server for my rails with the worker. If i set workers to 0 with puma…
hadzy
  • 113
  • 1
  • 5
11
votes
1 answer

Server Sent Events and Rails Streaming

I'm experimenting with Rails 4 ActionController::Live and Server Sent Events. I'm using MRI 2.0.0 and Puma. For what I can see, each connected client keeps an active connection to the server. I was wondering if it is possible to leverage SSEs…
tompave
  • 11,952
  • 7
  • 37
  • 63