2016-09-03 5 views
0

나는 heroku에서 레일 앱을 실행 중이며 두 개의 웹 dynos가 있습니다. 어떻게 제거 할 수 있습니까? 경고 : 감지 된 1 개의 스레드가 앱 부팅에서 시작되었습니다 : 경고?rufus + puma + heroku warning

내 puma.rb 파일 :

workers Integer(ENV['WEB_CONCURRENCY'] || 2) 
threads_count = Integer(ENV['RAILS_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_number| 
    # Worker specific setup for Rails 4.1+ 
    # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot 
    ActiveRecord::Base.establish_connection 
end 

로그는 :

2016-09-03T14:21:24.742960+00:00 app[web.1]: [3] * Listening on tcp://0.0.0.0:53786 
2016-09-03T14:21:24.743135+00:00 app[web.1]: [3] ! WARNING: Detected 1 Thread(s) started in app boot: 
2016-09-03T14:21:24.743181+00:00 app[web.1]: [3] ! #<Thread:[email protected]/app/vendor/bundle/ruby/2.2.0/gems/rufus-scheduler-3.2.2/lib/rufus/scheduler.rb:563 sleep> - /app/vendor/bundle/ruby/2.2.0/gems/rufus-scheduler-3.2.2/lib/rufus/scheduler.rb:571:in `sleep' 
2016-09-03T14:21:24.743257+00:00 app[web.1]: [3] Use Ctrl-C to stop 
2016-09-03T14:21:24.754941+00:00 app[web.1]: [3] - Worker 0 (pid: 7) booted, phase: 0 
2016-09-03T14:21:24.756269+00:00 app[web.1]: [3] - Worker 1 (pid: 20) booted, phase: 0 
2016-09-03T14:21:25.525174+00:00 app[web.2]: ** [NewRelic][2016-09-03 14:21:25 +0000 web.2 (18)] INFO : Doing deferred dependency-detection before Rack startup 

답변

1

그것은 매우 간단합니다. rufus-scheduler 사용을 중단하십시오. 그것은 쓰레드를 사용하고 있습니다. 이것이 당신의 경고의 원인입니다. 에서

봐 :

2016-09-03T14:21:24.743181+00:00 app[web.1]: [3] ! 
<Thread:[email protected] 
/app/vendor/bundle/ruby/2.2.0/gems/rufus-scheduler-3.2.2/lib/rufus/scheduler.rb:563 
sleep> - 
/app/vendor/bundle/ruby/2.2.0/gems/rufus-scheduler-3.2.2/lib/rufus/scheduler.rb:571 
:in `sleep' 

루퍼스 - 스케줄러는 명확하게 경고의 원인이다.

Cf를이 https://github.com/jmettraux/rufus-scheduler/issues/213

이제 일을 보는 또 다른 방법이있다 : 경고가 루퍼스 - 스케줄러에 의해 방출되지 않으며, 그것은 푸마에 의해 방출합니다. 아마도 경고를 사용하지 못하게하는 방법이있을 수 있지만 푸마를 아는 사람들에게는 이것이 문제입니다.