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

Коротких Виктор / ИТМО DWS / Stage 1 #4

Merged
merged 19 commits into from
Mar 1, 2024

Conversation

vitekkor
Copy link
Contributor

@vitekkor vitekkor commented Feb 18, 2024

Отчёт находится тут и тут.

Второй отчёт - новый отчёт с использованием новых скриптов для создания запросов. Оказалось, что прошлая версия не могла обеспечить большой RPS из-за долгой генерации тела запроса. То есть wrk физически не мог пропихнуть нужное количество запросов, потому что большую часть времени тратил на луа скрипт 🤕

Copy link
Contributor

@atimofeyev atimofeyev left a comment

Choose a reason for hiding this comment

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

Здорово воспользовались результатами профилирования чтобы затюнить респонсы на put/delete


server.incRequestsProcessed();

String connection = handling.getHeader("Connection:");
Copy link
Contributor

Choose a reason for hiding this comment

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

тут явно прослеживается копипаст с методом в Response

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Заменил на вызов статического метода из LSMConstantResponse

}

public void startServer() {
createLSMDao();
Copy link
Contributor

Choose a reason for hiding this comment

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

вызовы методов которые что-то делают внутри с состоянием тяжелы для понимания, да и кто-то может случайно поменять местами вызов методов, в итоге все поломается.

Лучше чтобы метод createLSMDao() возвращал дао, и его уже надо было бы передать как агрумент в start()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Создаю теперь дао в LSMServiceImpl вместе с LSMServerImpl, в конструктор которого и передаю дао. При остановке стопаю сервер и закрываю дао также в LSMServiceImpl.

return;
}

Response response = switch (request.getMethod()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

не хватает обработки ошибки неожиданной

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Добавил локальную обработку exception в самих методах обработки запроса и глобальный try-catch в переопределённом методе handleRequest


@Override
public CompletableFuture<Void> start() throws IOException {
if (isRunning.getAndSet(true)) return CompletableFuture.completedFuture(null);
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 synchronized, а то все равно получилось не безопасно, если будут долюить параллельно

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Сделал методы start/stop synchronized

Copy link
Contributor

@atimofeyev atimofeyev left a comment

Choose a reason for hiding this comment

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

15 баллов

@atimofeyev atimofeyev merged commit 5841ede into polis-vk:main Mar 1, 2024
2 checks passed
osokindm pushed a commit to osokindm/2024-highload-dht that referenced this pull request Mar 6, 2024
* state-1: add dao impl

* state-1: first implementation of httpserver

* state-1: fix flushing after stress failure

* state-1: refactoring

* state-1: add scripts

* state-1: wrk reports

* state-1: fix codestyle

* state-1: fix codestyle 2

* state-1: add report

* state-1: fix getting id parameter

* state-1: new report

* state-1: fix new report

* state-1: memory allocations fix

* state-1: fix codeclimate

* stage-1: fix review comments

* stage-1: codeclimate fix

* stage-1: add global exception handler
axothy pushed a commit to axothy/2024-highload-dht that referenced this pull request Mar 13, 2024
* state-1: add dao impl

* state-1: first implementation of httpserver

* state-1: fix flushing after stress failure

* state-1: refactoring

* state-1: add scripts

* state-1: wrk reports

* state-1: fix codestyle

* state-1: fix codestyle 2

* state-1: add report

* state-1: fix getting id parameter

* state-1: new report

* state-1: fix new report

* state-1: memory allocations fix

* state-1: fix codeclimate

* stage-1: fix review comments

* stage-1: codeclimate fix

* stage-1: add global exception handler
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.

3 participants