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

Error trying to create 5000 actors #51

Closed
danielchiovitti opened this issue Sep 16, 2022 · 4 comments · Fixed by #53
Closed

Error trying to create 5000 actors #51

danielchiovitti opened this issue Sep 16, 2022 · 4 comments · Fixed by #53
Assignees
Labels
bug Something isn't working proxy
Milestone

Comments

@danielchiovitti
Copy link

When I try to create 5000 actors I'm getting the error "Killed" in the proxy.
With the help of @sleipnir I found this error:
Out of memory: Killed process 21551 (beam.smp) total-vm:29151740kB, anon-rss:16088396kB, file-rss:0kB, shmem-rss:66344kB, UID:1000 pgtables:48292kB oom_score_adj:0

Before the error the proxy created around 1000 actors

@sleipnir sleipnir added bug Something isn't working proxy labels Sep 16, 2022
@sleipnir sleipnir added this to the v1.0.0 milestone Sep 16, 2022
@sleipnir sleipnir moved this to In Progress in Spawn v1.0.0 Sep 16, 2022
@sleipnir
Copy link
Member

Some likely causes for actors to be so expensive could be the ActorRegistry stack or even the actor state...

ActorRegistry.register(actors)

def lookup_or_create_actor(actor_system, %Actor{} = actor) do

I don't remember creating many atoms in the code, so maybe they don't help with that. Anyway, we will have to inspect the processes to find out the cause of the bootleg.

@danielchiovitti Please when starting the proxy, before making any request, type the following command in iex:

:observer_cli.start()

@sleipnir
Copy link
Member

sleipnir commented Sep 16, 2022

It seems to me that the state of each actor is too big for a start without any request.
6mb is a lot, we will have to rethink this

big-heap

Also as I suspected the atoms are under control. We will have to decrease the initial state of the actors and probably the Actors.Registry.ActorRegistry too

@danielchiovitti
Copy link
Author

image

@sleipnir
Copy link
Member

We have to lower the state of the actors and that will lower the pressure on the supervisor as well.

Just for the sake of knowledge I opened a call on Horde to investigate if it is possible to use the new Elixir feature for partitioned supervisors derekkraan/horde#255. This does not have a direct relationship with the bug, but it does have an indirect one as the supervisor can be overwhelmed with the current architecture.

sleipnir added a commit that referenced this issue Sep 16, 2022
Repository owner moved this from In Progress to Done in Spawn v1.0.0 Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working proxy
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants