Skip to content
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

Merged
merged 7 commits into from
Mar 3, 2024

Conversation

HKTRp
Copy link
Contributor

@HKTRp HKTRp commented Feb 18, 2024

Отчет лежит в src/main/java/ru/vk/itmo/test/kislovdanil/report/stage1/report.md

@HKTRp HKTRp changed the title Кислов Данил ИТМО ФИТиП HW5 Кислов Данил ИТМО ФИТиП HW1 Feb 18, 2024
Copy link
Contributor

@AlexeyShik AlexeyShik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first review
После дедлайна назначу финального ревьюера

@Override
public CompletableFuture<Void> stop() throws IOException {
dao.close();
httpServer.stop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что будет, если после закрытия dao придут новые запросы и попытаются обратиться к dao? Возможно, мы не хотим думать про такие случаи и хотим от них обезопаситься

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И это нетривиальный вопрос, в прошлом семестре мы жили с предположением, что после закрытия методы dao никто не вызывает. Зависит от реализации dao, а реализация со временем может меняться. Так что, видимо, UB

Copy link
Contributor

@AlexeyShik AlexeyShik left a 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.
Copy link
Contributor

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
![](putCpu.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вижу в профиле столбец справа "run", есть идеи что это за процесс и откуда он?

![](putCpu.png)

##### Allocations
![](putMemory.png)
Copy link
Contributor

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) {
Copy link
Contributor

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,
Copy link
Contributor

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 {
Copy link
Contributor

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(), они могут дважды закрыть арену, что уже эксепшен.

@AlexeyShik AlexeyShik merged commit b2f0222 into polis-vk:main Mar 3, 2024
2 checks passed
osokindm pushed a commit to osokindm/2024-highload-dht that referenced this pull request Mar 6, 2024
* 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>
axothy pushed a commit to axothy/2024-highload-dht that referenced this pull request Mar 13, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants