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 #12

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

goshadalbeev
Copy link
Contributor

No description provided.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5266 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5278 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5278 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5753 lines exceeds the maximum allowed for the inline comments feature.

@vladimir-bf vladimir-bf assigned urbanchef and unassigned vladimir-bf Feb 23, 2024

Entry<MemorySegment> entry = new BaseEntry<>(
key,
MemorySegment.ofArray(request.getBody())
Copy link
Contributor

Choose a reason for hiding this comment

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

Ключ провалидировали, но не хватает проверки тела на null. Иначе получается можно записать tombstone, тем самым удалив запись.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Исправил.

return new Response(Response.BAD_REQUEST, Response.EMPTY);
}

Entry<MemorySegment> entry = dao.get(key);
Copy link
Contributor

Choose a reason for hiding this comment

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

Здесь и ниже в delete не обрабатываются возможные исключения DAO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Исправил.


public NewServer(ServiceConfig config) throws IOException {
super(configureServer(config));
dao = new ReferenceDao(new Config(config.workingDir(), FLUSH_THRESHOLD));
Copy link
Contributor

Choose a reason for hiding this comment

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

Лучше всего передавать ReferenceDao в конструктор NewServer и делать все это в NewService.
Так будет более гибко и полезно для юнит тестов, например.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Исправил.


public class NewServer extends HttpServer {

private final ReferenceDao dao;
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.

Исправил.

request = function()
local headers = {}
headers["Host"] = "localhost"
local id = math.random(1, 1000)
Copy link
Contributor

@urbanchef urbanchef Feb 25, 2024

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.

Да, я ошибся нужно было поставить выше чем rps. из-за этого скорее всего джит оптимизировал, и результаты не совсем корректные.

### Профилирование put
#### CPU
Библиотека one-nio затратила 20.81% на работу с запросами.
Операции записи ответа в сокет занимают всего 2.26%.
Copy link
Contributor

Choose a reason for hiding this comment

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

Почему 2.26, а не 14.03? А куда ушли остальные проценты?

Операции записи ответа в сокет занимают всего 2.26%.
Операции сравнения MemorySegment занимают 11.31%.
#### Alloc
На созание MemorySegment затраивается 10.77%.
Copy link
Contributor

Choose a reason for hiding this comment

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

Во время какой операции происходят эти аллокации MemorySegment?

Операции сравнения MemorySegment занимают 11.31%.
#### Alloc
На созание MemorySegment затраивается 10.77%.
Основне аллокации происходят на one-nio.
Copy link
Contributor

Choose a reason for hiding this comment

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

В процентном соотношении, на какие подоперации? парсинг заголовков, запросов и тп...
Хотелось бы увидеть более подробный аналитический отчет.

На созание MemorySegment затраивается 10.77%.
Основне аллокации происходят на one-nio.

### Профилирование get
Copy link
Contributor

Choose a reason for hiding this comment

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

при какой нагрузке - bad или normal, был снят профиль?

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5773 lines exceeds the maximum allowed for the inline comments feature.

@urbanchef
Copy link
Contributor

7/15
Хотелось бы увидеть более подробный отчет и рекомендации по оптимизации производительности

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5773 lines exceeds the maximum allowed for the inline comments feature.

@urbanchef urbanchef merged commit a26d32c into polis-vk:main Mar 5, 2024
2 checks passed
osokindm pushed a commit to osokindm/2024-highload-dht that referenced this pull request Mar 6, 2024
* stage1

* stage1

* stage1

* report stage1

* fix issues

---------

Co-authored-by: georgiidalbeev <[email protected]>
Co-authored-by: Roman Mushchinskii <[email protected]>
axothy pushed a commit to axothy/2024-highload-dht that referenced this pull request Mar 13, 2024
* stage1

* stage1

* stage1

* report stage1

* fix issues

---------

Co-authored-by: georgiidalbeev <[email protected]>
Co-authored-by: Roman Mushchinskii <[email protected]>
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