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

Rails 4 database connection pool error

I have a rails app hosted with NGINX and Puma. Every 10 hours or so, the app becomes unusable. Whenever a user tries to connect, the following error message is displayed: Error during failsafe response: could not obtain a database connection within…
user3868925
  • 91
  • 1
  • 2
9
votes
1 answer

Rack middleware and thread-safety

I have a custom rack middleware used by my Rails 4 application. The middleware itself is just here to default Accept and Content-Type headers to application/json if the client did not provide a valid information (I'm working on an API). So before…
Mich
  • 729
  • 1
  • 7
  • 14
9
votes
1 answer

`rails server puma` vs. `puma`

Some guides (example) recommend this to start one's webserver bundle exec rails server puma But I've always just started the server with puma directly bundle exec puma Does something special happening when firing up puma (or any other server) via…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
9
votes
2 answers

Best tuning practices, experiences with Puma + Heroku + Rails 4 + Ruby 2.0

I been reading nearly all articles covering Puma tuning on Heroku, yet I'm not being able to find the sweet spot here. I have a site with around 100k / daily visits. I tried using 2x Dynos. The app is an average Rails app that performs mostly…
Martin
  • 11,216
  • 23
  • 83
  • 140
9
votes
1 answer

Sinatra streaming with Puma?

I'm trying to leverage Server-Sent Events in my application. I am using Sinatra and the sinatra-sse gem. This gem wraps the Sinatra stream :keep_alive call. When running my application on Thin, I have absolutely no problems, and my event stream…
Ilya O.
  • 1,500
  • 13
  • 19
8
votes
1 answer

Address already in use for puma-dev

Problem Whenever I try to run bundle exec puma -C config/puma.rb --port 5000 I keep getting bundler: failed to load command: puma (/Users/ogirginc/.asdf/installs/ruby/2.7.2/bin/puma) Errno::EADDRINUSE: Address already in use - bind(2) for "0.0.0.0"…
ogirginc
  • 4,948
  • 3
  • 31
  • 45
8
votes
1 answer

How to force Puma start in single mode on Rails?

I m working on a Ruby app. My versions always started locally with Puma in single mode. For one week, Puma has automatically launched in cluster mode, it generates bugs, broadcasts don't launch anymore ... How can I force Puma to start in single…
pierrecode
  • 192
  • 2
  • 15
8
votes
1 answer

How to fix issue with bundler requiring latest version of gem when I need to require a different version?

I've been scratching my head with this one for close to 2 weeks. I have an Ubuntu 14.04 server with rbenv installed running a number of different Rails websites, some of them on older versions of Rails, some of them on the latest version. I have 2…
Arran Scott
  • 175
  • 5
  • 16
8
votes
1 answer

SignalException in at_exit on AWS ECS

We're running a Rails 5.1 app on ECS using a docker image based on the official ruby:2.4.2 image. On many deploys we receive this exception, from what I understand from the old process: SignalException: SIGTERM - SignalException in…
iGEL
  • 16,540
  • 11
  • 60
  • 74
8
votes
2 answers

Table name corruption errors in ActiveRecord

Sporadically we get PG::UndefinedTable errors while using ActiveRecord. The association table name is some how corrupted and I quite often see Cancelled appended to the end of the table name. E.g: ActiveRecord::StatementInvalid: PG::UndefinedTable:…
Harish Shetty
  • 64,083
  • 21
  • 152
  • 198
8
votes
1 answer

puma: puma.sock No such file or directory

I used ansible script for server setup: playbook.yml Gemfile And when I deployed my application to server, I see this in nginx/error.log: 2016/09/30 20:43:07 [crit] 1352#0: *1 connect() to…
Pavel
  • 2,103
  • 4
  • 23
  • 41
8
votes
2 answers

how to have puma send logs to stdout

i want my RoR/puma logs to just go to stdout instead of a log file. is it as simple as removing the stdout_redirect line from my puma configs (aka, puma.rb)?
hiroprotagonist
  • 902
  • 1
  • 11
  • 24
8
votes
3 answers

RoR 5.0.0 ActionCable wss WebSocket handshake: Unexpected response code: 301

Hello I'm trying to serve a simple chat using ror 5.0.0 beta (with puma) working on production mode (in localhost there are no problems). This is my Nginx configuration: upstream websocket { server 127.0.0.1:28080; } server { listen 443; …
Jim Tebstone
  • 552
  • 6
  • 13
8
votes
1 answer

How to set Rails dev server to webbrick instead of Puma

I'm using Puma on Heroku for my server. When i have the Puma gem installed my dev environment boots up with Puma as the server. I don't seem to be able to shut that off without pulling the pum gem from my gemfile. I like the idea of using the…
bobbdelsol
  • 996
  • 6
  • 21
8
votes
1 answer

Puma / missing logs

Why I don't see any Rails specific entries in the logs ? I'm using Puma 2.7.1 with Nginx proxy, on a normal Debian box, nothing fancy, ruby 1.9.3 via RVM. My puma config: #!/usr/bin/env puma environment 'sandbox' bind…
astropanic
  • 10,800
  • 19
  • 72
  • 132