Hi Ivan,

You can try to set the tcp-nodelay option to be false, so you get some
batching from the TCP driver. You might want to try to tweak the netty
pool-size, too:

 - akka.remote.netty.tcp.server-socket-worker-pool
 - akka.remote.netty.tcp.client-socket-worker-pool

(http://doc.akka.io/docs/akka/2.3.9/general/configuration.html#akka-remote)

On Thu, Apr 2, 2015 at 6:30 PM, Ivan Balashov <ibalas...@gmail.com> wrote:

> Patrik,
>
> 2015-04-01 20:12 GMT+03:00 Patrik Nordwall <patrik.nordw...@gmail.com>:
>
>> Are you sending all messages in one go?
>>
>
> Unfortunately, yes, which is rather unrealistic and creates needless GC
> activity, I fully admit my oversight on this.
>
>
>> You can compare with this benchmark:
>> https://github.com/akka/akka/tree/release-2.3/akka-samples/akka-sample-remote-scala/src/main/scala/sample/remote/benchmark
>>
>
> Finally I managed to run this example in Intellij IDEA. The key to success
> was to take master branch rather than 2.x, which is broken Idea-wise (
> http://goo.gl/uUJdGD)
>
> Here are some results as run on 4 core laptop under OS X:
>
> == It took 38830 ms to deliver 1000000 messages, throughtput 25753 msg/s,
>> max round-trip 62 ms, burst size 100, payload size 100
>> == It took 35742 ms to deliver 1000000 messages, throughtput 27978 msg/s,
>> max round-trip 1000 ms, burst size 1000, payload size 100
>> == It took 34356 ms to deliver 1000000 messages, throughtput 29106 msg/s,
>> max round-trip 804 ms, burst size 10000, payload size 100
>> == It took 21636 ms to deliver 1000000 messages, throughtput 46219 msg/s,
>> max round-trip 2033 ms, burst size 50000, payload size 100
>
>
> The results are somewhat comparable to what was observed in my tests with
> high CPU usage caused particularly by context switching, and partly by Akka
> Remoting.
>
> Running Receiver took 1m 20s CPU time
>
> "Method","Time (ms)","Own Time (ms)"
>
> *"sun.misc.Unsafe.unpark(Object) Unsafe.java (native)","9716","9716"*
>> "sun.nio.ch.KQueueArrayWrapper.kevent0(int, long, int, long)
>> KQueueArrayWrapper.java (native)","3841","3838"
>> "java.lang.ClassLoader.defineClass1(String, byte[], int, int,
>> ProtectionDomain, String) ClassLoader.java (native)","2673","2050"
>> "java.net.URI$Parser.scan(int, int, long, long) URI.java","1420","1420"
>> "com.yourkit.probes.Table.createRow() Table.java","1123","1123"
>> "java.lang.Integer.parseInt(String) Integer.java","1091","1085"
>> "java.net.URLClassLoader$1.run() URLClassLoader.java","4844","906"
>> "scala.collection.AbstractIterable.<init>() Iterable.scala","508","469"
>> "java.lang.Thread.sleep(long) Thread.java (native)","416","416"
>> "akka.remote.WireFormats$ActorRefData.<init>(CodedInputStream,
>> ExtensionRegistryLite) WireFormats.java","419","387"
>> "java.lang.AbstractStringBuilder.expandCapacity(int)
>> AbstractStringBuilder.java","381","371"
>
>
> If we divide 1M messages / 80 Sec CPU Time = 12K rps / Core max, which
> corresponds to what is observed in test.
>
> In case my calculations are correct, doesn't this looks a bit unsettling
> for Akka to be a CPU-bound system, even when the only thing we do is pass
> around chunks of bytes? ;-)
>

To be honest, akka-remote is not the fastest kid on the block (it is ripe
for a redesign), but Patrik and I have seen much better results than you
have here. The unpark method that you highlight up there is not really
relevant though.

-Endre


>
>
>  --
> >>>>>>>>>> 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 http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to