Медленное развертывание AWS Opsworks при длительной работе сервера
После запуска сервера в AWS Opsworks в течение 2/3 недель процесс развертывания очень медленный, при первоначальном создании сервера развертывание занимает 1-2 минуты, а через 3 недели процесс развертывания занимает +10 минут. Этот процесс является инкрементным, поэтому через 2 недели он занимает +5 минут и усугубляется, если сервер работает дольше.
Просматривая файлы журналов, я заметил, что set user to deploy
занимает +1 минуту каждый раз, когда он выполняется, когда сервер работает в течение 3 недель, первоначально set user to deploy
было завершено за 10/20 секунд.
Журнал развертывания при создании сервера - (set user to deploy
завершено за 10/20 секунд)
...
[2019-02-20T11:55:28-06:00] INFO: deploy[appname] updated to revision d3a2c74eb1299f57f4393f2910974bab3e61830d
[2019-02-20T11:55:38-06:00] INFO: deploy[appname] set user to deploy
[2019-02-20T11:55:38-06:00] INFO: deploy[appname] set group to www-data
[2019-02-20T11:55:39-06:00] INFO: deploy[appname] copied the cached checkout to /srv/www/appname/releases/20190220175526
[2019-02-20T11:55:58-06:00] INFO: deploy[appname] set user to deploy
[2019-02-20T11:55:58-06:00] INFO: deploy[appname] set group to www-data
[2019-02-20T11:55:58-06:00] INFO: deploy[appname] running callback before_migrate
[2019-02-20T11:55:58-06:00] INFO: deploy[appname] queueing checkdeploy hook /srv/www/appname/releases/20190220175526/deploy/before_migrate.rb
[2019-02-20T11:55:58-06:00] INFO: Processing execute[bundle_install] action run (/var/chef/runs/fc475635-f399-426c-bb86-a7493b9e13cc/local-mode-cache/cache/cookbooks/opsworks_ruby/libraries/helpers.rb line 97)
[2019-02-20T11:55:59-06:00] INFO: execute[bundle_install] ran successfully
[2019-02-20T11:55:59-06:00] INFO: deploy[appname] made pre-migration symlinks
[2019-02-20T11:56:09-06:00] INFO: deploy[appname] set user to deploy
[2019-02-20T11:56:09-06:00] INFO: deploy[appname] set group to www-data
[2019-02-20T11:56:09-06:00] INFO: deploy[appname] migrating deploy with environment ...
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] running callback before_symlink
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] queueing checkdeploy hook /srv/www/appname/releases/20190220175526/deploy/before_symlink.rb
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] purged directories in checkout log, tmp/cache, tmp/pids, public/system, public/assets
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] created directories before symlinking: tmp,public,config,../../shared/cache,../../shared/assets
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] linked shared paths into current release: system => public/system, assets => public/assets, cache => tmp/cache, pids => tmp/pids, log => log, config/application.yml => config/application.yml
[2019-02-20T11:56:24-06:00] INFO: deploy[appname] made pre-migration symlinks
[2019-02-20T11:56:34-06:00] INFO: deploy[appname] set user to deploy
[2019-02-20T11:56:34-06:00] INFO: deploy[appname] set group to www-data
[2019-02-20T11:56:34-06:00] INFO: deploy[appname] linked release /srv/www/appname/releases/20190220175526 into production at /srv/www/appname/current
[2019-02-20T11:56:44-06:00] INFO: deploy[appname] set user to deploy
[2019-02-20T11:56:44-06:00] INFO: deploy[appname] set group to www-data
[2019-02-20T11:56:44-06:00] INFO: deploy[appname] updated symlinks
...
Журнал развертывания после 3 недель работы - (настройка пользователя на развертывание завершена за +1 минуту)
...
[2019-03-05T16:40:02-06:00] INFO: deploy[appname] updated to revision a35ad9d17389f0a287c5edcd062ce5271a506e92
[2019-03-05T16:41:07-06:00] INFO: deploy[appname] set user to deploy
[2019-03-05T16:41:07-06:00] INFO: deploy[appname] set group to www-data
[2019-03-05T16:41:14-06:00] INFO: deploy[appname] copied the cached checkout to /srv/www/appname/releases/20190305224000
[2019-03-05T16:42:20-06:00] INFO: deploy[appname] set user to deploy
[2019-03-05T16:42:20-06:00] INFO: deploy[appname] set group to www-data
[2019-03-05T16:42:20-06:00] INFO: deploy[appname] running callback before_migrate
[2019-03-05T16:42:20-06:00] INFO: deploy[appname] queueing checkdeploy hook /srv/www/appname/releases/20190305224000/deploy/before_migrate.rb
[2019-03-05T16:42:20-06:00] INFO: Processing execute[bundle_install] action run (/var/chef/runs/447f4193-8063-4abd-a867-f4f78d8990d8/local-mode-cache/cache/cookbooks/opsworks_ruby/libraries/helpers.rb line 97)
[2019-03-05T16:42:20-06:00] INFO: execute[bundle_install] ran successfully
[2019-03-05T16:42:20-06:00] INFO: deploy[appname] made pre-migration symlinks
[2019-03-05T16:43:25-06:00] INFO: deploy[appname] set user to deploy
[2019-03-05T16:43:25-06:00] INFO: deploy[appname] set group to www-data
[2019-03-05T16:43:25-06:00] INFO: deploy[appname] migrating deploy with environment ...
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] running callback before_symlink
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] queueing checkdeploy hook /srv/www/appname/releases/20190305224000/deploy/before_symlink.rb
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] purged directories in checkout log, tmp/cache, tmp/pids, public/system, public/assets
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] created directories before symlinking: tmp,public,config,../../shared/cache,../../shared/assets
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] linked shared paths into current release: system => public/system, assets => public/assets, cache => tmp/cache, pids => tmp/pids, log => log, config/application.yml => config/application.yml
[2019-03-05T16:43:41-06:00] INFO: deploy[appname] made pre-migration symlinks
[2019-03-05T16:44:45-06:00] INFO: deploy[appname] set user to deploy
[2019-03-05T16:44:45-06:00] INFO: deploy[appname] set group to www-data
[2019-03-05T16:44:45-06:00] INFO: deploy[appname] linked release /srv/www/appname/releases/20190305224000 into production at /srv/www/appname/current
[2019-03-05T16:45:50-06:00] INFO: deploy[appname] set user to deploy
[2019-03-05T16:45:50-06:00] INFO: deploy[appname] set group to www-data
[2019-03-05T16:45:50-06:00] INFO: deploy[appname] updated symlinks
...
Любая идея / причина, почему set user to deploy
так долго будет выполняться каждый раз, когда он выполняется после запуска сервера в течение +3 недель?