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

Detaching CPU intensive operations from main actor threads #12945

Open
Tracked by #103
stedfn opened this issue Feb 18, 2025 · 0 comments
Open
Tracked by #103

Detaching CPU intensive operations from main actor threads #12945

stedfn opened this issue Feb 18, 2025 · 0 comments

Comments

@stedfn
Copy link
Contributor

stedfn commented Feb 18, 2025

Actix actors are single threaded, which means they get blocked by CPU intensive operations and delay the handling of other messages. Moving these operations on separate OS level threads will allow the actors to remain responsive and continue processing incoming messages concurrently while heavy computations run in parallel.

One way to detect such issues is using flame graphs. An example can be viewed here, in the PeerManagerActor thread in a forknet experiment with a padded state witness size:

Image

Here we can notice that the handle_msg_network_request calls send_message_to_account which spends most of the time in the sign_message function, which is a CPU intensive operation since it serializes the PartialEncodedStateWitness so it should be detached from the main thread.

An example PR for the PartialWitnessActor can be found here: #12656

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

No branches or pull requests

1 participant