Hi Vitaly,

After some performance benchmarks, I realized that my current design
> affects processing time between Publishings and Subscriptions for the
> reasons that:
>
>    1. My EventBus actually is a singleton
>
> You can put it behind a router. Routers are not backed by an actual actor,
but with a much more performant lightweight entity.

You have to be aware though that this would only help with performance if
something is actually CPU bound there. If you experience no performance
increase with a routed bus, then it is more likely that the bottleneck is
even further downstream, it just propagates up to this point.

If this is still not enough, you might want to try the LMAX Disruptor which
is a highly specialized multi-consumer ring buffer. If that is not fast
enough, then you have to go back to the drawing board :(


>
>    1. It is caused a huge queue of processing load for it
>
> *How can I distribute* (parallelize) workload for my event bus
> implementation? Is the current solution good to fit akka-cluster?
>
Yes, cluster can do it, but don't forget that going distributed has extra
costs like the added networking overhead. Also clustering can only help
when there is parallelism to be exploited. If everything relies on a
central entity (pub-sub) too much then it can actually make your system
slower.

-Endre


> Currently, I'm thinking about routing
> <http://doc.akka.io/docs/akka/snapshot/scala/routing.html> through
> several instances of Bus as the following:
>
> val paths = (1 to 5).map(x => {
>   system.actorOf(Props[EventBusActor], name = "event-bus-" + 
> x).path.toString})
> val bus_publisher = system.actorOf(RoundRobinGroup(paths).props())val 
> bus_manager = system.actorOf(BroadcastGroup(paths).props())
>
> Where:
>
>    - *bus_publisher* will be responsible for getting Publish,
>    - *bus_manager* will be responsible for getting Subscribe /
>    Unsubscribe.
>
> And as the following it will replicate state across all the buses and
> reduce queue per actor with the distribution of the load.
>
> --
> >>>>>>>>>> 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.
>



-- 
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      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