針對Redmine 2.6回應緩慢的調整

Redmine 2.6一上線馬上就感受到反應速度緩慢的狀況,總是會有卡卡、頓頓的感覺,有時存筆資料就要等好幾秒,在等待存檔時觀察主機卻都很正常,沒有任何CPU佔用等情形... 最後做了下列兩項調整,狀況稍有改善,還要再持續監測是否解決了回應忽快忽慢的問題。

1. 取消反查名稱設定

簡單說就是Ruby的Web server會反查連線的電腦名稱,因而造成回應緩慢,細節請參考【茶包射手日記】Redmine卡卡奇案 - 黑暗執行緒一文。

將設定檔 \redmine-2.6.0-2\ruby\lib\ruby\2.0.0\webrick\config.rb內的 :DoNotReverseLookup設為true以取消反查功能。

# for GenericServer
    General = {
      :ServerName     => Utils::getservername,
      :BindAddress    => nil,   # "0.0.0.0" or "::" or nil
      :Port           => nil,   # users MUST specify this!!
      :MaxClients     => 100,   # maximum number of the concurrent connections
      :ServerType     => nil,   # default: WEBrick::SimpleServer
      :Logger         => nil,   # default: WEBrick::Log.new
      :ServerSoftware => "WEBrick/#{WEBrick::VERSION} " +
                         "(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})",
      :TempDir        => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',
      :DoNotListen    => false,
      :StartCallback  => nil,
      :StopCallback   => nil,
      :AcceptCallback => nil,
      :DoNotReverseLookup => true,
      :ShutdownSocketWithoutClose => false,
    }

2. 變更寄信方法

預設的電子郵件通知是採用同步的SMTP寄送,因此反應單儲存後Redmine就要等待Mail server的回應,如果Mail server回應較慢就會造成等待存檔的狀況。將 \redmine-2.6.0-2\apps\redmine\htdocs\config\configuration.yml 設定檔內的 :smtp改成非同步的 :async_smtp,同時把smtp_settings改成async_smtp_settings

# default configuration options for all environments
default:
  # Outgoing emails configuration
  # See the examples below and the Rails guide for more configuration options:
  # http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
  email_delivery:
    delivery_method: :async_smtp
    async_smtp_settings:
      address: 電子郵件主機
      port: 25
      domain: 網域
      authentication: :login
      user_name: 帳號
      password: 密碼

##

您可能也會有興趣的類似文章

簡睿

服務於軟體業的資訊老兵。興趣廣泛,學習力佳,樂於分享所知所學。

您可能也會喜歡…

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *