I can't figure out how I can get my unicorns to accept only connections when they are really βreadyβ to process the request. I find that the first few queries are slow, then they speed up dramatically (from a few seconds to a hundred or so). This problem seems to be compounded by the fact that the unicorn seems to be killing workers after a certain time, which means that I constantly run into the performance hit of the slow first request. Has anyone else seen this or had an idea of ββwhat I can do?
It turns out that our iML yml files, which are lazily loaded in views on first request, cause performance issues. Just adding the following to my config / unicorn.rb seems to fix the problem:
before_fork do |server, worker| # The following is highly recomended for Rails + "preload_app true" as # there no need for the master process to hold a connection. defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! # No need to disconnect from Redis servers--they are connected to lazily. # Force translations to be loaded into memory. I18n.t('activerecord') end
Source: https://habr.com/ru/post/1443588/More articles:Creating a unique identifier forwhen using the form nested form form form_for Rails - cssResource ID # 4 Why am I getting this? - phpThe nested rails form assigns a unique identifier to the created field - ruby-on-railsHow to draw horizontal and vertical line in the layout of the table - androidModel binder does not fill items in nested lists - c #location determination in a web browser - html5Will the call be called several times if I connect the same slots several times? - qtHow to handle IOExceptions? - javaHow UnitTest WCF.SVC Files - unit-testinghttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1443593/treemaps-in-r-alternatives-to-the-portfolio-package&usg=ALkJrhg2i-PcT_Ihidu7tVYNZ6A2utD76wAll Articles