Skip to content

Optimize usage of the Netty's and MsgPack's buffers#438

Merged
akudiyar merged 4 commits into
masterfrom
optimize-netty-handlers-tmp
Dec 28, 2023
Merged

Optimize usage of the Netty's and MsgPack's buffers#438
akudiyar merged 4 commits into
masterfrom
optimize-netty-handlers-tmp

Conversation

@akudiyar

@akudiyar akudiyar commented Nov 9, 2023

Copy link
Copy Markdown
Collaborator

Previously we were creating a new buffer and MsgPack packer on each request. This resulted in dramatic overload of GC with short-lived byte arrays. The new approach tries to maximize reusing of these byte arrays.

@akudiyar akudiyar requested a review from ArtDu November 12, 2023 12:13
@akudiyar akudiyar changed the title Optimize usage of the Netty and MsgPack buffers Optimize usage of the Netty's and MsgPack's buffers Nov 12, 2023
@akudiyar akudiyar marked this pull request as ready for review November 16, 2023 22:15
@akudiyar akudiyar requested a review from ArtDu November 27, 2023 22:08
ArtDu
ArtDu previously requested changes Dec 6, 2023
Previously we were creating a new buffer and MsgPack packer on each
request. This resulted in dramatic overload of GC with short-lived
byte arrays. The new approach tries to maximize reusing of these byte
arrays.
Previously the outbound requests were not flushed at all, causing
memory overload as Netty does not flush the requests automatically as
of version 4.1.x. But flushing each request will also affect the
performance significantly, so the built-in batch flushing handler is
added to the connection pipeline together with a config option for
tuning the request batch size.
@akudiyar akudiyar force-pushed the optimize-netty-handlers-tmp branch from 86cc79a to f7e1267 Compare December 27, 2023 02:36
Any Java exceptions that prevented connecting to the server
were swallowed and only the exception name was printed.
This patch adds logging of full stacktrace on connection exceptions.
@akudiyar akudiyar force-pushed the optimize-netty-handlers-tmp branch from f7e1267 to 42185ef Compare December 27, 2023 03:11

@ArtDu ArtDu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see where is "long value" test?

@akudiyar

Copy link
Copy Markdown
Collaborator Author

The test changes were rewritten by subsequent updates unfortunately, will be added back in the upcoming PRs

@akudiyar akudiyar added this pull request to the merge queue Dec 28, 2023
Merged via the queue into master with commit 14e051a Dec 28, 2023
@akudiyar akudiyar deleted the optimize-netty-handlers-tmp branch December 28, 2023 10:06
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