-
Notifications
You must be signed in to change notification settings - Fork 48
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
Conversation
(cherry picked from commit ea6b417)
if handled succesfully - send errorcode if handling failed - close connection
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/DistributedDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/shishiginstepan/server/Server.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.
Нужно зарезолвить конфликты.
# 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
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.
Есть ряд вопросов и замечаний.
Я дуамю что если бы изначально выбрал java http клиент то мог бы провести более качественное сравнение. <br> | ||
В общем я считаю что задержка запросов могла бы уменьшиться, но ценой большого количества вспомогательных потоков, так что в принципе <br> | ||
это хороший способ ускорить приложение и утилизировать ресурсы. Но проблемы с синхронизацией потоков могут повлиять <br> | ||
( и сильно повлияли) на работоспособность системы, так как увеличилось количество блокировок. |
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.
Что за проблемы с синхронизацией потоков? Где видно влияние "на работоспособность системы"? Звучит очень абстрактно.
В итоге throughput упал, а latency не изменились?
### 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) |
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.
Профили нужны интерактивные в .html
.
## Выводы | ||
|
||
Я дуамю что если бы изначально выбрал java http клиент то мог бы провести более качественное сравнение. <br> | ||
В общем я считаю что задержка запросов могла бы уменьшиться, но ценой большого количества вспомогательных потоков, так что в принципе <br> |
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.
А вы пробовали увеличить количество потоков? Если становится только лучше, то почему бы и нет.
(e1, e2) -> -e1.timestamp().compareTo(e2.timestamp()) | ||
); | ||
|
||
var resultHandler = new MergeResultHandler(shouldAck, requestFrom, session); |
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.
Этот внезапный var
заметно выбивается из общего стиля...
Integer shouldAck = ack == null ? quorum : ack; | ||
Integer requestFrom = from == null ? totalNodes : from; |
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.
Почему здесь Integer
, а не int
? Даже IDEA подсказывает.
processors + 1, | ||
processors + 1, |
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.
Почему +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; |
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.
Все эти Runtime.getRuntime().availableProcessors() / 2
должны стать константами с говорящими именами.
} | ||
}); | ||
|
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.
Long timestamp = Long.parseLong(request.getHeader(TIMESTAMP_HEADER)); | ||
EntryWithTimestamp<MemorySegment> entry = new EntryWithTimestamp<>( | ||
key, | ||
MemorySegment.ofArray(request.getBody()), timestamp |
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.
MemorySegment.ofArray(request.getBody()), timestamp | |
MemorySegment.ofArray(request.getBody()), | |
timestamp |
session.sendResponse( | ||
response | ||
); |
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.
session.sendResponse( | |
response | |
); | |
session.sendResponse(response); |
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.
10 баллов.
No description provided.