puma

How to run rails puma server with config file using 'rails s puma'

余生长醉 提交于 2019-12-05 11:45:05
问题 I am able to run a puma server in rails using either rails s puma or just puma . According to this answer, running rails s puma makes the server aware of the rails environment. It shows server errors etc that running puma alone does not. I want to set a config file like so: config/puma.rb workers Integer(ENV['PUMA_WORKERS'] || 3) threads Integer(ENV['MIN_THREADS'] || 1), Integer(ENV['MAX_THREADS'] || 16) rackup DefaultRackup port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development

Rails application deployed on Elastic Beanstalk with Puma fails - 502 errors on every request

≡放荡痞女 提交于 2019-12-05 11:31:15
问题 I just deployed a Rails app to Elastic Beanstalk, and every request is giving me a 502 error. Here's the contents of /var/logs/nginx/error.log 2015/05/20 16:24:25 [warn] 1535#0: conflicting server name "localhost" on 0.0.0.0:80, ignored 2015/05/20 16:27:12 [crit] 1537#0: *20 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.51.94, server: _, request: "POST /get HTTP/1.1", upstream: "http://unix:///var/run/puma/my

nginx error: (13: Permission denied) while connecting to upstream)

自闭症网瘾萝莉.ら 提交于 2019-12-05 11:05:02
I am running rails app with puma, capistrano, and nginx on a google compute engine VM with ubuntu 14.04 LTS. I have the nginx running on the external IP. And when I visit it I get two nginx errors in the log: 2016/02/03 11:58:07 [info] 19754#0: *73 client closed connection while waiting for request, client: ###.##.##.###, server: 0.0.0.0:443 2016/02/03 11:58:07 [crit] 19754#0: *74 connect() to unix:///home/my-user-name/apps/my-web-app/shared/tmp/sockets/my-web-app-puma.sock failed (13: Permission denied) while connecting to upstream, client: ###.##.##.###, server: , request: "GET / HTTP/1.1",

Rails 4 API deployment example to Amazon EC2 using Capistrano 3, Nginx, Puma, GitHub, and RVM?

[亡魂溺海] 提交于 2019-12-05 03:19:55
I have a Rails 4 API project on GitHub, and I'm trying to deploy it from my MacBook Pro using Capistrano 3 to two Amazon AWS EC2 Ubuntu instances using SSH keys - one is the app/web server, and the other is the PostgreSQL database server. The app/web server has the latest Ruby 2 via RVM, and will serve the API with Nginx / Puma . Nginx will host multiple sites, one of which is this API. These are the relevant gems I'm using: gem 'capistrano', '~> 3.0.0' gem 'capistrano-rails' gem 'capistrano-bundler' gem 'capistrano-rvm', '~> 0.0.2' gem 'capistrano-puma', github: "seuros/capistrano-puma" So

Rails 5 Action Cable deployment with Nginx, Puma & Redis

浪子不回头ぞ 提交于 2019-12-05 02:23:51
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 in-process /cable URL. But, when I try deploying it to the VPS, I keep getting these two errors in the JS-log: Establishing connection to host ws://{server-ip}/cable failed. Connection to host ws://{server-ip}/cable was interrupted while loading the page. And in my app-specific nginx.error.log I'm getting these messages: 2016/03/10 16:40:34 [info] 14473

Rails 4, Live Streaming, stays open, blocking requests

梦想与她 提交于 2019-12-04 21:00:51
问题 I'm trying to use Rails 4 Live Streaming component. It all works except that it seems like the stream stays open and blocks new request. How can I ensure that the connection close down properly when closing down or clicking on a new link within the application? This is my live event controller. def events response.headers["Content-Type"] = "text/event-stream" redis = Redis.new redis.psubscribe("participants.*") do |on| on.pmessage do |pattern, event, data| response.stream.write("event: #

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

☆樱花仙子☆ 提交于 2019-12-04 20:31:57
问题 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 reveals how many cores a performance-M or performance-L dyno has. In this article, Heroku hinted at an approach: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server I think they're suggesting to set the threads to

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

柔情痞子 提交于 2019-12-04 19:03:59
问题 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 Gateway" EDIT The error message now --> "We're sorry, but something went wrong." But Nginx error output is the same, I check puma error messages but they just log when it start and when it stop gracefully. Rails logs which is under app_directory/log does

Server Sent Events and Rails Streaming

旧时模样 提交于 2019-12-04 18:05:23
问题 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 without keeping all response streams running. Puma manages multiple connections using threads, and I imagine there is a limit to the number of cuncurrent connections. What if I want to support a real-world scenario with thousands of clients registering

Deploying Ruby on Rails app to Heroku while using Action Cable (Puma port listening)

笑着哭i 提交于 2019-12-04 14:02:41
I have got Action Cable working in a local host environment and in this situation I start the Puma server using a simple file containing # /bin/bash bundle exec puma -p 28080 cable/config.ru Once this happens the puma server starts and is listening to this 28080 port and the port the local server is running on. Through hunting online I couldn't find a place that would tell me a way to emulate this on heroku or a way to have my server always start on the same port (though I don't know if that would give me the desired result either) I have a javascript file set up to create a consumer related