-
Notifications
You must be signed in to change notification settings - Fork 47
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
Кислов Данил ИТМО ФИТиП HW1 #3
Conversation
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseServiceFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/dao/iterators/MergeIterator.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/dao/PersistentDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Outdated
Show resolved
Hide resolved
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.
first review
После дедлайна назначу финального ревьюера
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseServiceFactory.java
Show resolved
Hide resolved
@Override | ||
public CompletableFuture<Void> stop() throws IOException { | ||
dao.close(); | ||
httpServer.stop(); |
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.
Что будет, если после закрытия dao придут новые запросы и попытаются обратиться к dao? Возможно, мы не хотим думать про такие случаи и хотим от них обезопаситься
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.
И это нетривиальный вопрос, в прошлом семестре мы жили с предположением, что после закрытия методы dao никто не вызывает. Зависит от реализации dao, а реализация со временем может меняться. Так что, видимо, UB
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/service/DatabaseHttpServer.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/report/stage1/get11000full
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/kislovdanil/report/stage1/report.md
Outdated
Show resolved
Hide resolved
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.
Сниму 2 балла за замечания по коду и 2 за вопросы к профилированию.
Пока поставлю 11 баллов.
# Отчёт о нагрузочном тестировании | ||
## Этап 1 | ||
|
||
Опытным путём установлена *точка разладки* ~5.000 RPS. |
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.
Это точка разладки конкретно get запросов или для put тоже? Учитывая специфику lsm, put запросы должны держать больший rps.
|
||
#### Флеймграфы для PUT запросов | ||
##### CPU | ||
 |
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.
Вижу в профиле столбец справа "run", есть идеи что это за процесс и откуда он?
 | ||
|
||
##### Allocations | ||
 |
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.
Довольно много аллокаций происходят вне SelectorThread. Есть идеи, откуда они?
|
||
/* Binary search in summary and index files. Returns index of least record greater than key or equal. | ||
Returns -1 if no such key */ | ||
long findByKey(MemorySegment key) { |
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.
В этом методе происходит ~70-80% аллокаций вашего кода. Как можно уменьшить их число?
И было бы очень круто применить эту оптимизацию, чтобы при выполнении следующих alloc профиль был почище.
} | ||
|
||
@Path(ENTITY_ACCESS_URL) | ||
public Response handleEntityRequest(Request request, |
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.
Еще, как говорил Вадим на паре, стоит добавить обработку непредвиденных исключений на случай серверных ошибок
} | ||
|
||
@Override | ||
public CompletableFuture<Void> stop() throws IOException { |
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.
Думаю start, stop методы стоит сделать synchoronized, например, если два потока зайдут в stop и dao.close(), они могут дважды закрыть арену, что уже эксепшен.
* Stage 1 * linter fixes * linter fixes * Правки в отчёте после ревью --------- Co-authored-by: kislovda <kislovda@mos-team.ru> Co-authored-by: Alexey Shik <58121508+AlexeyShik@users.noreply.github.com>
* Stage 1 * linter fixes * linter fixes * Правки в отчёте после ревью --------- Co-authored-by: kislovda <kislovda@mos-team.ru> Co-authored-by: Alexey Shik <58121508+AlexeyShik@users.noreply.github.com>
Отчет лежит в src/main/java/ru/vk/itmo/test/kislovdanil/report/stage1/report.md