Messages can be slow when being sent remotely from node A to node B,
current Akka remote will give you a top of 100k msg/sec best scenario and 
that depending on the message size,
there is a new Akka remote (Akka artery which is a rewrite of Akka remote) 
on the way so that shouldn't discourage you.

Serialization is important, make sure you are not using the default Java 
serialization, I suggest you to use Kryo for example.

The fact that you are using actors doesn't really mean you are using 
concurrency right, books like "Java concurrency in Practice" still apply, 
you need to know how dispatchers work in Akka
and how to spread your actors among dispatcher for specialized tasks, also, 
you need to learn how to create several instances of the same actor so that 
they act as workers,
hence activating a proper level of concurrency.

I think the main problem is that *-it is a common mistake by new Akka 
users-* is to try to just throw actors at the problem and expect that it 
will magically solve concurrency issues.
You need to read the documentation and understand how actors, routers and 
dispatchers can work together and how to combine them.

If you are simply sending messages to one actor in a node you still have a 
single threaded kind processor,

I have tackled this kind of problem by creating several instances *-say N x 
CPUs depending on the problem they are solving-*,
send such list to a remote node and there create a dumb round-robin router 
and use such router to send messages to such pool of actors,
and then you will have some decent concurrency in that node, make sure you 
use more than one dispatcher or else everything will be executed by the 
same dispatcher,
which translates to having a single thread pool executor doing everything.

http://doc.akka.io/docs/akka/2.4.10/java/dispatchers.html
http://doc.akka.io/docs/akka/2.4.10/java/routing.html

HTH,

Guido.

On Monday, September 5, 2016 at 11:58:47 AM UTC+1, silvio poma wrote:
>
> Dear Konrad,
> Thanks for your answer, our Actors didn't do anything that blocks the 
> system.
> One possible cause for our performance problem is that in our 
> "cluster-metrics-adaptive-group" router have just one routees associated to 
> one actor (We have one actor for microsistem right now). We think to 
> increase the number of actor for each microsistem and consequencialy the 
> routees lists, is this a possible solution?
> If it is right to do so, there is a way to increase and decrease the group 
> without going directly inside the code, and leaves akka do so ?
> Thanks Silvio 
>
> Il giorno lunedì 5 settembre 2016 11:26:58 UTC+2, Konrad Malawski ha 
> scritto:
>>
>> This is not really enough information to say where or what the 
>> bottlenecks are. If you need a full architecture overview that's a 
>> commercial thing we can offer.
>>
>> Having that said, you did not mention what HTTP server you're using.
>> Actors are simply multiplexed onto threads, so if you're doing blocking 
>> in your actors you'll end up blocking the entire system - this could be one 
>> of the reasons you're seeing bad perf and no parallelism.
>> Another reason could be that you do all inside one actor or synchronously 
>> in a thread, creating a bottleneck.
>>
>> Please explain a bit more on your setup and we could provide some more 
>> helpful hints.
>>
>> Please also refer to the documentation when in doubt :)
>>
>> -- 
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 5 September 2016 at 11:22:26, silvio poma (silvio...@gmail.com) wrote:
>>
>> Hi All,  
>> Working on a project for a big client that want to switch from a 
>> monolithic infrastructure to a microservice one we are getting stuck in a 
>> big doubt.
>> We are making an infrastructure where each microservice are deployed in a 
>> different container on an ECS instance, than we have the first microservice 
>> that receive a message from the client via HTTP and this message triggers 
>> all the actors that start to send message one to each others.
>> We've created an Akka-Cluster and each microservice is a node of the 
>> cluster. Every Actor send a message to a Router 
>> (cluster-metrics-adaptive-group) that has his  routees.paths that points to 
>> the specific node.
>> Testing the performances of our system we realize that everything is too 
>> slow and there is not any multithreading.
>> How does multithreading work? Is our infrastructure too complex? Is there 
>> any best-practice we can implement to improve our system? 
>> Thanks all! 
>> Silvio
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com.
>> To post to this group, send email to akka...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to