Skip to content

Commit a42b6fd

Browse files
committed
optimization
1 parent 9ed4225 commit a42b6fd

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

case-study.md

+33-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Использование CPU и памяти
1515
- Включил кеширование на локальном окружении
1616
- Использование `benchmark` с помощью `ab` (`ab -n 100 -c 5 http://localhost:3000/`)
17+
- Добавил local_production окружение
1718

1819
## Feedback-Loop
1920
Построен быстрый цикл обратной связи:
@@ -30,7 +31,36 @@
3031

3132
## Результаты оптимизации:
3233

33-
### 1. Многократный рендеринг partial-ов _single_story.html.erb
34-
- rack-mini-profilier
35-
-
34+
### 1. Отсутствие кеширования partial-ов _single_story.html.erb
35+
- Readme задания и rack-mini-profiler
36+
- Добавил кеширование partial'а, учел, что в него входят счётчики лайков и комментариев.
37+
### Замеры до добавления кеширования:
38+
```
39+
Concurrency Level: 5
40+
Time taken for tests: 14.988 seconds
41+
Complete requests: 100
42+
Failed requests: 0
43+
Total transferred: 13161800 bytes
44+
HTML transferred: 13115100 bytes
45+
Requests per second: 6.67 [#/sec] (mean)
46+
Time per request: 749.387 [ms] (mean)
47+
Time per request: 149.877 [ms] (mean, across all concurrent requests)
48+
Transfer rate: 857.59 [Kbytes/sec] received
49+
```
50+
51+
### Замеры после добавления кеширования:
52+
```
53+
Concurrency Level: 5
54+
Time taken for tests: 7.179 seconds
55+
Complete requests: 100
56+
Failed requests: 0
57+
Total transferred: 13028000 bytes
58+
HTML transferred: 12981300 bytes
59+
Requests per second: 13.93 [#/sec] (mean)
60+
Time per request: 358.953 [ms] (mean)
61+
Time per request: 71.791 [ms] (mean, across all concurrent requests)
62+
Transfer rate: 1772.19 [Kbytes/sec] received
63+
```
64+
- Время обработки запросов сократилось в два раза
65+
3666

0 commit comments

Comments
 (0)