puma

Rails 4 database connection pool error

大憨熊 提交于 2019-12-23 07:58:10
问题 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 5.000 seconds (waited 5.000 seconds) This continues until the app is restarted. I have read that this is because the database connection pool is full, and so there must be threads being created in the rails app that are not closing their connection

rails nginx puma duplicate upstream “puma” in /etc/nginx/sites-enabled

寵の児 提交于 2019-12-22 10:53:41
问题 I've set up my server for this tutorial (https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3) When I used one project, all works, but when I added another project to this VPS, I have error [emerg] 20737#0: duplicate upstream "puma" in /etc/nginx/sites-enabled/vsejalreg:1 My nginx's configure upstream puma { server unix:///home/deployer/apps/vsejalreg/shared/tmp/sockets/vsejalreg-puma.sock; } server { listen 80; server_name wjreg.rubyserv.ru www.wjreg.rubyserv

Configuring Puma and Sidekiq

自闭症网瘾萝莉.ら 提交于 2019-12-22 08:06:06
问题 Might be more of trying to overcome a learning curve + actual code question. I apologize if it seems nubish, currently I get this error within production. Basically I keep recieving this "redis pool is too small" and I'm lost where to start, I'm actually lost on basically understanding how to accurately configure sidekiq with puma or anything that comes after configuration like scaling etc. Below I have my configuration followed my error I recieve . ProcFile web: bundle exec puma -C config

How to know the number of active threads in Puma

偶尔善良 提交于 2019-12-22 03:58:06
问题 I am trying to see the number of active puma threads on my server. I can not see it through ps : $ ps aux | grep puma healthd 2623 0.0 1.8 683168 37700 ? Ssl May02 5:38 puma 2.11.1 (tcp://127.0.0.1:22221) [healthd] root 8029 0.0 0.1 110460 2184 pts/0 S+ 06:34 0:00 grep --color=auto puma root 18084 0.0 0.1 56836 2664 ? Ss May05 0:00 su -s /bin/bash -c puma -C /opt/elasticbeanstalk/support/conf/pumaconf.rb webapp webapp 18113 0.0 0.8 83280 17324 ? Ssl May05 0:04 puma 2.16.0 (unix:///var/run

Rails 5 Action Cable deployment with Nginx, Puma & Redis

為{幸葍}努か 提交于 2019-12-22 03:42:06
问题 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

Foreman/Puma isn't using the specified port in dev env

怎甘沉沦 提交于 2019-12-21 07:18:07
问题 I set the port as 3000 in my application.yml (figaro managing env variables) rails s uses port 3000 but when I run foreman start (as recommended by Heroku) I get the following output 14:53:23 web.1 | started with pid 24425 14:53:23 web.1 | [24425] Puma starting in cluster mode... 14:53:23 web.1 | [24425] * Version 2.11.1 (ruby 2.2.0-p0), codename: Intrepid Squirrel 14:53:23 web.1 | [24425] * Min threads: 5, max threads: 5 14:53:23 web.1 | [24425] * Environment: development 14:53:23 web.1 |

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

爱⌒轻易说出口 提交于 2019-12-21 03:54:12
问题 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 do |n| puts "Streaming: #{n}" response.stream.write "Streaming: #{n+1}" sleep 1 end rescue IOError => e puts 'Connection closed' ensure response.stream.close end When I run puma using tcp://, without nginx, the streaming works perfectly. curl -N http:

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

落爺英雄遲暮 提交于 2019-12-20 10:19:37
问题 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 super, but I can't find what the various options for 'super' are. I have also reviewed many references to Rails within 'thin'. I found a Changelog entry entitled "Added Thin support to script/server. #488 [Bob Klosinski]" from Oct. of 2008, but that

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

自闭症网瘾萝莉.ら 提交于 2019-12-19 05:59:17
问题 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; server_name mydomain; ssl_certificate ***/server.crt; ssl_certificate_key ***/server.key; ssl on; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl

why did gitlab 6 switch back to unicorn?

有些话、适合烂在心里 提交于 2019-12-18 10:54:26
问题 Gitlab 6.0 was released yesterday. I am curious to know why they switched to Unicorn from Puma. Versions prior to 5 were using Unicorn. I thought switch to Puma was for the better. Is there a technical reason for this switch? 回答1: GitLab B.V. CEO here, I agree with Hongli his comment that "If there are issues then they are likely in Gitlab's code.". We tried to fix them but GitLab is one of the largest open source Rails applications and the issues where hard to reproduce. So in the end we