From e202fe8c760d8e63a26cbac116dc94d5039fb207 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 28 Dec 2017 21:55:34 +0800 Subject: Warm up the app so it's fast for the 1st request This would make the application considered ready much slower, but when it's ready, then it's really ready. Before this change, it claims to be ready, but it's annoyingly slow for the first request with GDK. It's 100% 502 for me, for the first request. This shouldn't really affect production or so, because if it's really ready, it should be blazingly fast, and it should not slow things down too much. The culprit here is probably `ActionController::Base.helpers.asset_path` but this could make sure that anything else would load first, too. --- config.ru | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config.ru') diff --git a/config.ru b/config.ru index 065ce59932f..de0400f4f67 100644 --- a/config.ru +++ b/config.ru @@ -17,6 +17,11 @@ end require ::File.expand_path('../config/environment', __FILE__) +warmup do |app| + client = Rack::MockRequest.new(app) + client.get('/') +end + map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do run Gitlab::Application end -- cgit v1.2.1