Tag: 美洲狮

Rails Puma用完了Redis连接

我已经在SO上查看了其他类似的问题但是不能很好地将事情拼凑在一起。 我有一个Rails应用程序(在Heroku上),它使用Puma同时具有多个进程和多个线程。 我的应用程序还使用Redis作为辅助数据存储(除了SQL数据库),直接查询Redis(通过connection_pool gem)。 这是我的Puma配置文件: workers Integer(ENV[“WEB_CONCURRENCY”] || 4) threads_count = Integer(ENV[“MAX_THREADS”] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV[“PORT”] || 3000 environment ENV[“RACK_ENV”] || “development” on_worker_boot do # Worker specific setup for Rails 4.1+ ActiveRecord::Base.establish_connection redis_connections_per_process = Integer(ENV[“REDIS_CONNS_PER_PROCESS”] || 5) $redis = ConnectionPool.new(size: redis_connections_per_process) do Redis.new(url: ENV[“REDIS_URL”] || “redis://localhost:6379/0”) end end 我的Redis实例的连接限制为20,我发现自己经常超过这个限制,尽管应该是(据我所知)每个进程只有5个连接分布在4个工作进程中。 […]

Rails Elastic Beanstalk连接超时 – 美洲狮服务器

我搜索过网络和stackoverflow,但无法做到这一点。 我有一个rails应用程序并部署到弹性beanstalk。 健康状况良好且绿色,但url不起作用。 它等了一会儿,页面说连接超时了。 当我输入eb open出错; ERROR: OSError :: [Errno 10] No child processes 无法弄清楚为什么会这样。 当我eb deploy INFO: Environment update is starting. INFO: Deploying new version to instance(s). INFO: Environment health has transitioned from Ok to Info. Application update in progress on 1 instance. 0 out of 1 instance completed (running for 4 seconds). INFO: […]

Elastic Beanstalk:自定义Puma配置

Ruby + Puma的当前Beanstalk解决方案堆栈使用/opt/elasticbeanstalk/support/conf/pumaconf.rb的配置文件,并忽略Rails应用程序目录中的config/puma.rb 我可以通过自定义的文件覆盖上面的文件.ebextensions但我犹豫不决,因为我想避免破坏,以防PID路径 – 或者更重要的是 – unix套接字文件在即将推出的解决方案堆栈版本中发生变化。 在Beanstalk上自定义Puma配置的最佳实践是什么?

将Rails + Puma + Postgres应用程序部署到Elastic beanstalk的正确方法?

我有一个Rails 5 API,我试图在Elastic Beanstalk上正确部署。 这是我使用的初始config/puma.rb文件: threads_count = ENV.fetch(“RAILS_MAX_THREADS”) { 5 }.to_i threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests, default is 3000. port ENV.fetch(“PORT”) { 3000 } # Specifies the `environment` that Puma will run in. environment ENV.fetch(“RAILS_ENV”) { “development” } # Allow puma to be restarted by […]

使用EC2 + Rails + Nginx + Capistrano重启后Puma重启失败

我已成功使用capistrano将我的rails应用程序部署到Ubuntu EC2。 一切都在部署上很有效。 Rails应用程序名称是deseov12我的问题是Puma没有启动,这将是必要的,因为生产EC2实例将按需实例化。 Puma将在通过Capistrano部署时启动,它也将在运行时启动 cap production puma:start 在本地机器上。 如果我运行以下命令,它也会在重启后在服务器上启动: su – deploy [enter password] cd /home/deploy/deseov12/current && ( export RACK_ENV=”production” ; ~/.rvm/bin/rvm ruby-2.2.4 do bundle exec puma -C /home/deploy/deseov12/shared/puma.rb –daemon ) 我按照Puma丛林工具的指示,使用upstart启动Puma启动,如下所示: /etc/puma.conf的内容 /home/deploy/deseov12/current /etc/init/puma.conf和/home/deploy/puma.conf的内容 # /etc/init/puma.conf – Puma config # This example config should work with Ubuntu 12.04+. It # allows you to […]

如何在运行Capybara时配置puma?

我想在运行Capybara测试时调整puma配置。 更改.env,.env.test(我使用dotenv )或config / puma.rb中的设置无效。 我在哪里可以更改配置? Rails 5.1,poltergeist 1.15.0,capybara 2.14.0,puma 2.8.2

是puma唯一的multithreading导轨4 http服务器?

我已经将我们的堆栈转换为Rails 4(是的!) 我希望利用线程安全的代码。 Puma工作起床,停止它似乎是一个不同的问题:( Puma是唯一的multithreading导轨吗? Thin -> EventMachine Unicorn -> Forking Puma -> multi-threaded Mongrel -> don’t care Webbrick -> don’t care

在OS X El Capitan 10.11上安装puma ruby​​ gem的问题

当试图在OS X El Capitan上安装puma“任何版本”时,它仍然失败。 值得庆幸的是, / user / dennis-best能够获得一些亮点,值得为此付出一切荣誉。

无法在Windows 8.1上安装Puma gem(ruby 2.1.5)

我已经尝试了几天现在为ruby安装puma gem(2.1.5)。 我已经更新了rubygems,我安装并成功运行了devkit,下载了最新的ssl头文件并将它们送到了安装但是都没有成功这个解决方案已经选择了,我已经看过其他几个来自Luis Lavena或从http采购: //rubygems.org而不是https://但它们似乎都不适合我: https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows 我一直收到这个错误: $ gem install puma -v 2.9.2 — –with-opt-dir=c:\openssl Temporarily enhancing PATH to include DevKit… Building native extensions with: ‘–with-opt-dir=c:openssl’ This could take a while… ERROR: Error installing puma: ERROR: Failed to build gem native extension. c:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150126-4428-1lhbkfi.rb extconf.rb –with-opt-dir=c:openssl checking for SSL_CTX_new() in -lssl… no checking for […]

Foreman / Puma没有在dev env中使用指定的端口

我在我的application.yml中设置端口为3000(figaro管理env变量) rails s使用端口3000但是当我运行foreman start (按照Heroku的推荐)我得到以下输出 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 | [24425] […]