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

High CPU Usage after switching to CompatibleFieldSerializer #976

Closed
ankit-harness opened this issue May 10, 2023 · 9 comments
Closed

High CPU Usage after switching to CompatibleFieldSerializer #976

ankit-harness opened this issue May 10, 2023 · 9 comments
Labels

Comments

@ankit-harness
Copy link

ankit-harness commented May 10, 2023

Describe the bug

We recently switched to CompatibleFieldSerializer in our codebase. After that we have had few instances where a thread ends up consuming very high CPU in our service. We have to restart our service instance to fix that. Here's the stacktrace for the thread -

main-app-pool-97571" #4516363 prio=5 os_prio=0 cpu=1058305.52ms elapsed=1212.28s tid=0x00007f6620d90400 nid=0x57dd8 runnable  [0x00007f6611c19000]
   java.lang.Thread.State: RUNNABLE
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:64)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:186)
   Locked ownable synchronizers:
<0x000000043f002148> (a java.util.concurrent.ThreadPoolExecutor$Worker)

I think this issue is same as #838. We wanted to try out the fix done for this issue. But, it's not available in 4.0.2 which is the version we are using. Upgrading to 5.x.x is going to be a huge effort as it has breaking changes.

Can we release 4.0.3 with this fix?

@theigl
Copy link
Collaborator

theigl commented May 10, 2023

Hi @ankit-harness. Please create a PR that applies the fix to the kryo-4 branch.

I had no plans to release another 4.x version, but I will consider it in this case.

@ankit-harness
Copy link
Author

Thanks a lot @theigl . I have created the PR - #978

@theigl
Copy link
Collaborator

theigl commented May 10, 2023

Thank you @ankit-harness! I will try to release a new Kryo 4 version next week. First I have to look through all improvements that were made to Kryo 5 that could potentially be backported.

I have not done a release of 4.x since I took over as maintainer of this project. I hope the release process still works after 4 years ;)

@ankit-harness
Copy link
Author

Eagerly waiting for the release with extra goodness. 😀

@ankit-harness
Copy link
Author

Hi @theigl , any update on this?

@theigl
Copy link
Collaborator

theigl commented May 17, 2023

Not yet. I need a couple of hours of spare time to get the 4.x branch into a releasable state again. I'll let you know when I cut the release.

@theigl
Copy link
Collaborator

theigl commented May 19, 2023

@ankit-harness: I have just released 4.0.3.

I cherry picked and applied two additional fixes concerning InputChunked and OutputChunked.

Please verify that this release works for you.

@theigl theigl closed this as completed May 19, 2023
@ankit-harness
Copy link
Author

Thanks a lot @theigl . I will try it out. Is artifact uploaded to maven central repo too?

@theigl
Copy link
Collaborator

theigl commented May 19, 2023

Yes. It should make it to central in the next hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants