max number of actors per host in akka

2019-04-29 18:47发布

问题:

How many max actors can we have on one box in akka?

public void MyActor extends AkkaActor{

  receive(Objet obj){
    // so something
  } 

}

1)Is there some limit on max number of actors instances?I am planning to created around 10K actors on one box. I will have 50 such boxes so that i can scale horizontally
2)IS there some performance problems with this?

回答1:

It is just a matter of having enough memory: the overhead of one actor is roughly 400 bytes (plus whatever state you keep within it). This means that on typical systems you can have millions of actors. The performance does not depend on the number of actors you create, it depends on how many messages you send between them. You should not worry if that number is up to a few million per second, beyond that you will have to benchmark your program against your chosen hardware to see if it works out.