【发布时间】:2016-03-01 20:39:22
【问题描述】:
我想将我的 heroku 数据库更改为允许并发连接的东西,因为我的网站正在获得一些流量,并且在多个用户尝试访问该网站时似乎崩溃了。我已经考虑将我的数据库更改为独角兽,但不确定这是否是我真正需要的。我是初学者,对我需要做什么的任何见解都将非常有用!
我的宝石文件:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bootstrap-sass'
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :development, :test do
gem 'sqlite3'
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
【问题讨论】:
-
Unicorn 不是数据库,而是应用服务器。问题不太可能出在您的数据库上。运行 heroku logs -t 并尝试重现崩溃作为开始调试问题的地方。是什么让你相信数据库是问题所在。如果您正在考虑更改应用服务器,puma 是一个不错的选择,并且通常会比 unicorn 为您提供更好的性能。 Heroku 现在推荐 puma。
-
啊哈,是的,糟糕的措辞!我想将我的应用服务器更改为 puma。有没有办法做到这不是太糟糕的技术?我的github是github.com/westche/drinkPGH
-
移至下面的答案。
标签: postgresql heroku unicorn pg