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

HW 5 Шишигин Степан DWS ИТМО #197

Merged
merged 91 commits into from
May 11, 2024

Conversation

sshishigin
Copy link
Contributor

No description provided.

Степан added 2 commits April 17, 2024 22:04
Copy link
Member

@incubos incubos left a comment

Choose a reason for hiding this comment

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

Нужно зарезолвить конфликты.

# Conflicts:
#	src/main/java/ru/vk/itmo/test/shishiginstepan/lua_scripts/random_rw_requests.lua
#	src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
#	src/main/java/ru/vk/itmo/test/shishiginstepan/server/RemoteDaoNode.java
#	src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
#	src/main/java/ru/vk/itmo/test/shishiginstepan/service/DatabaseService.java
@vladimir-bf vladimir-bf assigned incubos and unassigned vladimir-bf Apr 24, 2024
@incubos incubos requested review from incubos and removed request for vladimir-bf May 1, 2024 18:51
Copy link
Member

@incubos incubos left a comment

Choose a reason for hiding this comment

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

Есть ряд вопросов и замечаний.

Я дуамю что если бы изначально выбрал java http клиент то мог бы провести более качественное сравнение. <br>
В общем я считаю что задержка запросов могла бы уменьшиться, но ценой большого количества вспомогательных потоков, так что в принципе <br>
это хороший способ ускорить приложение и утилизировать ресурсы. Но проблемы с синхронизацией потоков могут повлиять <br>
( и сильно повлияли) на работоспособность системы, так как увеличилось количество блокировок.
Copy link
Member

Choose a reason for hiding this comment

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

Что за проблемы с синхронизацией потоков? Где видно влияние "на работоспособность системы"? Звучит очень абстрактно.
В итоге throughput упал, а latency не изменились?

Comment on lines +47 to +60
### PUT запросы
##### СPU
![](profiling_artifacts_5/putCPU.png)

##### ALLOC
![](profiling_artifacts_5/putAlloc.png)


### GET запросы
##### СPU
![](profiling_artifacts_5/getCpu.png)

##### ALLOC
![](profiling_artifacts_5/getAlloc.png)
Copy link
Member

Choose a reason for hiding this comment

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

Профили нужны интерактивные в .html.

## Выводы

Я дуамю что если бы изначально выбрал java http клиент то мог бы провести более качественное сравнение. <br>
В общем я считаю что задержка запросов могла бы уменьшиться, но ценой большого количества вспомогательных потоков, так что в принципе <br>
Copy link
Member

Choose a reason for hiding this comment

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

А вы пробовали увеличить количество потоков? Если становится только лучше, то почему бы и нет.

(e1, e2) -> -e1.timestamp().compareTo(e2.timestamp())
);

var resultHandler = new MergeResultHandler(shouldAck, requestFrom, session);
Copy link
Member

Choose a reason for hiding this comment

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

Этот внезапный var заметно выбивается из общего стиля...

Comment on lines +126 to +127
Integer shouldAck = ack == null ? quorum : ack;
Integer requestFrom = from == null ? totalNodes : from;
Copy link
Member

Choose a reason for hiding this comment

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

Почему здесь Integer, а не int? Даже IDEA подсказывает.

Comment on lines +48 to +49
processors + 1,
processors + 1,
Copy link
Member

Choose a reason for hiding this comment

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

Почему +1?

@@ -74,6 +59,7 @@ private static HttpServerConfig configFromServiceConfig(ServiceConfig serviceCon
AcceptorConfig acceptorConfig = new AcceptorConfig();
acceptorConfig.reusePort = true;
acceptorConfig.port = serviceConfig.selfPort();
serverConfig.selectors = Runtime.getRuntime().availableProcessors() / 2;
Copy link
Member

Choose a reason for hiding this comment

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

Все эти Runtime.getRuntime().availableProcessors() / 2 должны стать константами с говорящими именами.

}
});

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Long timestamp = Long.parseLong(request.getHeader(TIMESTAMP_HEADER));
EntryWithTimestamp<MemorySegment> entry = new EntryWithTimestamp<>(
key,
MemorySegment.ofArray(request.getBody()), timestamp
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
MemorySegment.ofArray(request.getBody()), timestamp
MemorySegment.ofArray(request.getBody()),
timestamp

Comment on lines +202 to +204
session.sendResponse(
response
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
session.sendResponse(
response
);
session.sendResponse(response);

Copy link
Member

@incubos incubos left a comment

Choose a reason for hiding this comment

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

10 баллов.

@incubos incubos merged commit 8046881 into polis-vk:main May 11, 2024
2 checks passed
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