Open
Conversation
added 2 commits
April 5, 2023 12:16
spajic
reviewed
Apr 10, 2023
| Rails.application.configure do | ||
| # Verifies that versions and hashed value of the package contents in the project's package.json | ||
| config.webpacker.check_yarn_integrity = yarn_integrity_enabled? | ||
| config.webpacker.check_yarn_integrity = false |
Collaborator
There was a problem hiding this comment.
Лучше не выключать. Если падает, значит что-то не совсем так
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Цели
Попрактиковаться в настройке мониторинга
Попрактиковаться в поиске возможностей для оптимизации
Попрактиковаться в проверке гипотез и обосновании предложений по оптимизации
Познакомиться с интересным живым Rails open-source проектом
Настройка систем профилирования
Подключил NewRelic
Подключил Skylight
Подключил Prometheus + Grafana
Настроил rack-mini-profiler
Настроил rails-panel
Настройка local_production окружения
Добавил новый environment profile - для профилирования в среде максимально приближенной к Production
Нагрузочное тестирование
Для проверки гипотиз и выстраивания максимально эффективного фидбэк лупа benchmark осуществлял при помощи утилиты ApacheBench.
Оптимизация
Все инструменты мониторинга показывают, что самой горячей точкой является главная страница, StoriesController#index.
В частности, заметное время занимает рендеринг partial-ов _single_story.html.erb.
Статистика 200 запросов в ab:
Скрин NewRelic до оптимизации: https://disk.yandex.ru/i/ocwtqArpKiEQbQ
Рассмотрел гипотезу о том, что можно закешировать <%= render "articles/single_story", story: story %> в _main_stories_feed.html.erb и это даст заметный эффект.
Статистика 200 запросов в ab после отимизации:
Изменение графика в NewRelic помле оптимизации https://disk.yandex.ru/i/d40doyOEVx7P2Q
Время ответа для 200 запросов уменьшилось с 10.545 до 6.603 секунд