mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:59:50 +08:00
enough with the malloc limit, not needed
This commit is contained in:
parent
99b95f1fc9
commit
a19e43fd3b
|
@ -91,7 +91,7 @@ class AdminDashboardData
|
||||||
]
|
]
|
||||||
|
|
||||||
add_problem_check :rails_env_check, :ruby_version_check, :host_names_check,
|
add_problem_check :rails_env_check, :ruby_version_check, :host_names_check,
|
||||||
:gc_checks, :ram_check, :google_oauth2_config_check,
|
:ram_check, :google_oauth2_config_check,
|
||||||
:facebook_config_check, :twitter_config_check,
|
:facebook_config_check, :twitter_config_check,
|
||||||
:github_config_check, :s3_config_check, :image_magick_check,
|
:github_config_check, :s3_config_check, :image_magick_check,
|
||||||
:failing_emails_check, :default_logo_check, :contact_email_check,
|
:failing_emails_check, :default_logo_check, :contact_email_check,
|
||||||
|
@ -169,10 +169,6 @@ class AdminDashboardData
|
||||||
I18n.t("dashboard.host_names_warning") if ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
I18n.t("dashboard.host_names_warning") if ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
||||||
end
|
end
|
||||||
|
|
||||||
def gc_checks
|
|
||||||
I18n.t("dashboard.gc_warning") if ENV['RUBY_GC_MALLOC_LIMIT'].nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def sidekiq_check
|
def sidekiq_check
|
||||||
last_job_performed_at = Jobs.last_job_performed_at
|
last_job_performed_at = Jobs.last_job_performed_at
|
||||||
I18n.t('dashboard.sidekiq_warning') if Jobs.queued > 0 and (last_job_performed_at.nil? or last_job_performed_at < 2.minutes.ago)
|
I18n.t('dashboard.sidekiq_warning') if Jobs.queued > 0 and (last_job_performed_at.nil? or last_job_performed_at < 2.minutes.ago)
|
||||||
|
|
|
@ -43,7 +43,7 @@ end
|
||||||
namespace :deploy do
|
namespace :deploy do
|
||||||
desc 'Start thin servers'
|
desc 'Start thin servers'
|
||||||
task :start, :roles => :app, :except => { :no_release => true } do
|
task :start, :roles => :app, :except => { :no_release => true } do
|
||||||
run "cd #{current_path} && RUBY_GC_MALLOC_LIMIT=90000000 bundle exec thin -C config/thin.yml start", :pty => false
|
run "cd #{current_path} && bundle exec thin -C config/thin.yml start", :pty => false
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Stop thin servers'
|
desc 'Stop thin servers'
|
||||||
|
@ -53,7 +53,7 @@ namespace :deploy do
|
||||||
|
|
||||||
desc 'Restart thin servers'
|
desc 'Restart thin servers'
|
||||||
task :restart, :roles => :app, :except => { :no_release => true } do
|
task :restart, :roles => :app, :except => { :no_release => true } do
|
||||||
run "cd #{current_path} && RUBY_GC_MALLOC_LIMIT=90000000 bundle exec thin -C config/thin.yml restart"
|
run "cd #{current_path} && bundle exec thin -C config/thin.yml restart"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ respawn limit 3 30
|
||||||
start on runlevel [2345]
|
start on runlevel [2345]
|
||||||
stop on runlevel [06]
|
stop on runlevel [06]
|
||||||
|
|
||||||
env RUBY_GC_MALLOC_LIMIT=90000000
|
|
||||||
env RAILS_ROOT=/var/www/discourse
|
env RAILS_ROOT=/var/www/discourse
|
||||||
env RAILS_ENV=production
|
env RAILS_ENV=production
|
||||||
env NUM_WEBS=4
|
env NUM_WEBS=4
|
||||||
|
|
|
@ -23,7 +23,6 @@ exec /bin/bash <<'EOT'
|
||||||
# set HOME to the setuid user's home, there doesn't seem to be a better, portable way
|
# set HOME to the setuid user's home, there doesn't seem to be a better, portable way
|
||||||
export HOME="$(eval echo ~$(id -un))"
|
export HOME="$(eval echo ~$(id -un))"
|
||||||
export RAILS_ENV=production
|
export RAILS_ENV=production
|
||||||
export RUBY_GC_MALLOC_LIMIT=90000000
|
|
||||||
|
|
||||||
cd /var/www/discourse
|
cd /var/www/discourse
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,6 @@ discourse_env_vars = %w(DISCOURSE_DUMP_HEAP RUBY_GC_HEAP_INIT_SLOTS RUBY_GC_HEAP
|
||||||
|
|
||||||
if @include_env
|
if @include_env
|
||||||
puts "Running with tuned environment"
|
puts "Running with tuned environment"
|
||||||
ENV["RUBY_GC_MALLOC_LIMIT"] = "50_000_000"
|
|
||||||
discourse_env_vars - %w(RUBY_GC_MALLOC_LIMIT).each do |v|
|
discourse_env_vars - %w(RUBY_GC_MALLOC_LIMIT).each do |v|
|
||||||
ENV.delete v
|
ENV.delete v
|
||||||
end
|
end
|
||||||
|
|
|
@ -70,20 +70,6 @@ describe AdminDashboardData do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'gc_checks' do
|
|
||||||
subject { described_class.new.gc_checks }
|
|
||||||
|
|
||||||
it 'returns nil when gc params are set' do
|
|
||||||
ENV.stubs(:[]).with('RUBY_GC_MALLOC_LIMIT').returns(90000000)
|
|
||||||
expect(subject).to be_nil
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns a string when gc params are not set' do
|
|
||||||
ENV.stubs(:[]).with('RUBY_GC_MALLOC_LIMIT').returns(nil)
|
|
||||||
expect(subject).to_not be_nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'sidekiq_check' do
|
describe 'sidekiq_check' do
|
||||||
subject { described_class.new.sidekiq_check }
|
subject { described_class.new.sidekiq_check }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user