-
Notifications
You must be signed in to change notification settings - Fork 92
[Yaroslavzev] #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yaroslavzev
wants to merge
1
commit into
hardcode-dev:master
Choose a base branch
from
Yaroslavzev:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,220
−14
Open
[Yaroslavzev] #140
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM newrelic/infrastructure:latest | ||
ADD newrelic-infra.yml /etc/newrelic-infra.yml |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.3.1 | ||
3.2.4 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
## Case Study | ||
|
||
## Подготовка | ||
|
||
- Запустил проект `dev.to` локально | ||
- Настроил `NewRelic` для 'development' | ||
- Настроил `local_production` для проекта и подкючил `NewRelic` | ||
- Настроил `rack-mini-profiler` для `local_production` и добавил ключ по которому можно включить профайлер | ||
|
||
## Оптимизация | ||
|
||
Ввиду сложностей запуска, я строго следовал рекомендация из описания. | ||
NewRelic оказался не очень информативен для понимания причины медленной работы ввиду трейсы из коробки не идентифицируют все трейсы. | ||
`rack-mini-profiler` показал, что `single_story` рендерится многократно и это точка для оптимизации. | ||
|
||
 | ||
|
||
Утилита ab показала, что среднее время ответа составляет `675.065 [ms]` | ||
|
||
<details> | ||
<summary>ab -n 100 -c 5 127.0.0.1:3000/</summary> | ||
|
||
``` | ||
This is ApacheBench, Version 2.3 <$Revision: 1903618 $> | ||
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | ||
Licensed to The Apache Software Foundation, http://www.apache.org/ | ||
|
||
Benchmarking 127.0.0.1 (be patient).....done | ||
|
||
|
||
Server Software: | ||
Server Hostname: 127.0.0.1 | ||
Server Port: 3000 | ||
|
||
Document Path: / | ||
Document Length: 143403 bytes | ||
|
||
Concurrency Level: 5 | ||
Time taken for tests: 13.501 seconds | ||
Complete requests: 100 | ||
Failed requests: 0 | ||
Total transferred: 14382600 bytes | ||
HTML transferred: 14340300 bytes | ||
Requests per second: 7.41 [#/sec] (mean) | ||
Time per request: 675.065 [ms] (mean) | ||
Time per request: 135.013 [ms] (mean, across all concurrent requests) | ||
Transfer rate: 1040.31 [Kbytes/sec] received | ||
|
||
Connection Times (ms) | ||
min mean[+/-sd] median max | ||
Connect: 0 0 0.5 0 4 | ||
Processing: 108 631 1067.2 377 5300 | ||
Waiting: 107 624 1066.9 373 5297 | ||
Total: 109 631 1067.2 378 5300 | ||
|
||
Percentage of the requests served within a certain time (ms) | ||
50% 378 | ||
66% 405 | ||
75% 440 | ||
80% 459 | ||
90% 520 | ||
95% 5153 | ||
98% 5285 | ||
99% 5300 | ||
100% 5300 (longest request) | ||
``` | ||
|
||
</details> | ||
|
||
После добавления кэширования в метод `single_story` среднее время ответа составило `133.472 [ms]` | ||
и `rack-mini-profiler` показал, что `single_story` рендерится один раз. | ||
 | ||
|
||
<details> | ||
<summary>ab -n 100 -c 5 127.0.0.1:3000/</summary> | ||
|
||
``` | ||
This is ApacheBench, Version 2.3 <$Revision: 1903618 $> | ||
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | ||
Licensed to The Apache Software Foundation, http://www.apache.org/ | ||
|
||
Benchmarking 127.0.0.1 (be patient).....done | ||
|
||
|
||
Server Software: | ||
Server Hostname: 127.0.0.1 | ||
Server Port: 3000 | ||
|
||
Document Path: / | ||
Document Length: 143451 bytes | ||
|
||
Concurrency Level: 5 | ||
Time taken for tests: 2.669 seconds | ||
Complete requests: 100 | ||
Failed requests: 0 | ||
Total transferred: 14387400 bytes | ||
HTML transferred: 14345100 bytes | ||
Requests per second: 37.46 [#/sec] (mean) | ||
Time per request: 133.472 [ms] (mean) | ||
Time per request: 26.694 [ms] (mean, across all concurrent requests) | ||
Transfer rate: 5263.34 [Kbytes/sec] received | ||
|
||
Connection Times (ms) | ||
min mean[+/-sd] median max | ||
Connect: 0 0 0.2 0 1 | ||
Processing: 68 124 26.5 115 206 | ||
Waiting: 66 122 26.1 112 205 | ||
Total: 68 125 26.5 116 206 | ||
|
||
Percentage of the requests served within a certain time (ms) | ||
50% 116 | ||
66% 135 | ||
75% 143 | ||
80% 146 | ||
90% 157 | ||
95% 175 | ||
98% 198 | ||
99% 206 | ||
100% 206 (longest request) | ||
``` | ||
|
||
</details> | ||
|
||
Таким образом, после оптимизации среднее время ответа уменьшилось в 5 раз. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RMP one love <3