puma

What does Early termination of worker puma log mean and why is it happening?

て烟熏妆下的殇ゞ 提交于 2021-02-07 13:30:37
问题 For my Elastic Beanstalk instance, I am getting a 504 status code response whenever I visit it. When I tail the logs I see the following log on the puma app server: ==> /var/log/puma/puma.log <== [27240] Early termination of worker [27245] Early termination of worker [27249] Early termination of worker [27253] Early termination of worker [27257] Early termination of worker [27261] Early termination of worker [27265] Early termination of worker [27269] Early termination of worker [27273] Early

What does Early termination of worker puma log mean and why is it happening?

白昼怎懂夜的黑 提交于 2021-02-07 13:29:15
问题 For my Elastic Beanstalk instance, I am getting a 504 status code response whenever I visit it. When I tail the logs I see the following log on the puma app server: ==> /var/log/puma/puma.log <== [27240] Early termination of worker [27245] Early termination of worker [27249] Early termination of worker [27253] Early termination of worker [27257] Early termination of worker [27261] Early termination of worker [27265] Early termination of worker [27269] Early termination of worker [27273] Early

ActiveStorage::FileNotFoundError but the file actually exists

北城余情 提交于 2021-01-27 07:17:24
问题 I am working on this Rails 6.0.21 application (ruby 2.5.5) and using puma 3.12.2 as development web server and ActiveStorage with local disk service. Every now and then my application errors out with ActiveStorage::FileNotFoundError . The actual file exists on disk. The model responds properly to .attached?. Restarting puma solves the issue which then pops up again later apparently at random...some days more often than others. This is happening on Apache with mod_passenger in the same way. Am

Rails app hangs when there's a server sent event (SSE) that requires database actions

大兔子大兔子 提交于 2020-12-07 06:40:26
问题 I'm learning & doing SSE for the first time in rails! My controller code: def update response.headers['Content-Type'] = 'text/event-stream' sse = SSE.new(response.stream, event: 'notice') begin User.listen_to_creation do |user_id| sse.write({id: user_id}) end rescue ClientDisconnected ensure sse.close end end Front end: var source = new EventSource('/site_update'); source.addEventListener('notice', function(event) { var data = JSON.parse(event.data) console.log(data) }); Model pub/sub class

Rails app hangs when there's a server sent event (SSE) that requires database actions

半世苍凉 提交于 2020-12-07 06:40:06
问题 I'm learning & doing SSE for the first time in rails! My controller code: def update response.headers['Content-Type'] = 'text/event-stream' sse = SSE.new(response.stream, event: 'notice') begin User.listen_to_creation do |user_id| sse.write({id: user_id}) end rescue ClientDisconnected ensure sse.close end end Front end: var source = new EventSource('/site_update'); source.addEventListener('notice', function(event) { var data = JSON.parse(event.data) console.log(data) }); Model pub/sub class

puma(5300✨) Rails的一个多线程,高并发处理的web server

僤鯓⒐⒋嵵緔 提交于 2020-10-28 10:36:36
https://github.com/puma/puma 在开发和产品环境下,Puma是一个简单,快速,多线程,并高并发highly concurrent HTTP1.1server for Ruby/Rack程序。 什么是多线程? multithreading 指从软件或者硬件上实现多个线程并发执行的技术。从而整体提升处理效能。 软件多线程:即使处理器只能运行一个线程,但操作系统可以通过快速在不同线程之间进行切换,由于间隔时间很小,给用户造成一种多个线程同时运行的假象。这样的程序运行机制被称为软件多线程。 多任务可以由多进程完成,也可以由一个进程内的多线程完成。 进程是由若干线程组成的,一个进程至少有一个线程。 单进程单线程:一个人在一个桌子上吃菜; 单进程多线程:多个人在一个桌子上吃菜;容易发生争抢,即资源共享就会发生冲突争抢。 多进程单线程:多个人在各自的桌子上吃菜; gem 'puma', '~> 3.11' gem 'mina-puma', '~> 1.1.0', require: false ⚠️require: false的选项是什么用途? 答案: 具体见:stackoverflow 把这个gem安装了,但不加载load。 你bundler时,不会调用require 'mina-puma'命令。什么时候需要用到这个library,手动加载这个命令。

nginx + puma 部署 redmine2.6

人走茶凉 提交于 2020-10-28 10:10:13
#1.安装puma $ gem install puma 因为文件是从amazon云上下载,所以经常是连不上去,重试几次就好了。 安装好以后的gems路径一般为:/usr/local/share/gems/gems/puma-2.9.2 #2.配置puma 在redmine的config目录下创建文件 puma.rb,如 $ vim /usr/local/redmine-2.6.0/config/puma.rb application_path = '/usr/local/redmine-2.6.0' directory application_path environment 'production' daemonize true pidfile "#{application_path}/tmp/pids/puma.pid" state_path "#{application_path}/tmp/pids/puma.state" stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/ puma.stderr.log" bind "unix://#{application_path}/tmp/sockets/redmine.sock" ##3.安装gems $ echo

Rails + Webpacker + Puma + Nginx 部署

别来无恙 提交于 2020-10-28 09:46:39
准备 ssh 登录 首先 ssh 登录服务器,免密码登录可以参考 ssh 免密码登录服务器 创建部署用户 $ sudo adduser deploy 安装依赖 Ruby 这里使用 RVM 安装和管理 Ruby $ gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB $ curl -sSL https://get.rvm.io | bash 等待安装完成 # 显示可用的 Ruby 版本 $ rvm list known # 安装 $ rvm install 2.5.3 更换 Gem 源(使用 ruby-china 源) $ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ $ gem sources -l $ bundle config mirror.https://rubygems.org https://gems.ruby-china.com Node $ curl -sL https://deb.nodesource.com/setup_9.x |