Netty on OSv and Local loopback latency

63 views
Skip to first unread message

Jestan Nirojan

unread,
Sep 24, 2013, 2:55:58 PM9/24/13
to osv...@googlegroups.com
Hi all,

I have got a Netty application working on OSv https://github.com/jestan/netty-osv-perf.

Starting the application is very fast :) and it completed the task faster than my host PC (sending 8 byte messages from client to server in ping pong fashion 100000 times)
and its great, keep up the good work guys.

but I have got following histogram results for the latency, i was hoping that it would be close to few nano seconds, any idea why the latency is like this?

[/tmp]% cat netty-perf6167611028991339554.tmp
************************************************
********** Running NioTcpLatencyTest **********
Histogram {
 min=430000,  max=12099000,  mean=3315416.45,  99%=11500000,  99.99%=12100000
 intervals = [
  50000=0,
  100000=0,
  150000=0,
  200000=0,
  250000=0,
  300000=0,
  350000=0,
  400000=0,
  450000=35,
  500000=35,
  550000=105,
  600000=152,
  650000=71,
  700000=105,
  750000=199,
  800000=216,
  850000=543,
  900000=342,
  950000=239,
  1000000=686,
  1050000=685,
  1100000=393,
  1150000=0,
  1200000=319,
  1250000=183,
  1300000=641,
  1350000=283,
  1400000=1193,
  1450000=1109,
  1500000=1333,
  1550000=881,
  1600000=947,
  1650000=1429,
  1700000=1834,
  1750000=2114,
  1800000=2607,
  1850000=1874,
  1900000=1340,
  1950000=1961,
  2000000=1774,
  2050000=916,
  2100000=1016,
  2150000=1976,
  2200000=1243,
  2250000=1150,
  2300000=686,
  2350000=884,
  2400000=171,
  2450000=265,
  2500000=139,
  2550000=290,
  2600000=177,
  2650000=110,
  2700000=658,
  2750000=580,
  2800000=108,
  2850000=236,
  2900000=693,
  2950000=870,
  3000000=737,
  3050000=1415,
  3100000=1494,
  3150000=1535,
  3200000=1277,
  3250000=1073,
  3300000=1179,
  3350000=1617,
  3400000=2014,
  3450000=1734,
  3500000=1702,
  3550000=1557,
  3600000=1628,
  3650000=1392,
  3700000=1039,
  3750000=691,
  3800000=687,
  3850000=699,
  3900000=563,
  3950000=365,
  4000000=267,
  4050000=149,
  4100000=86,
  4150000=86,
  4200000=74,
  4250000=70,
  4300000=104,
  4350000=353,
  4400000=527,
  4450000=517,
  4500000=66,
  4550000=66,
  4600000=343,
  4650000=225,
  4700000=25,
  4750000=24,
  4800000=25,
  4850000=25,
  4900000=28,
  4950000=27,
  5000000=19,
  5050000=186,
  5100000=306,
  5150000=113,
  5200000=0,
  5250000=0,
  5300000=12,
  5350000=96,
  5400000=239,
  5450000=440,
  5500000=30,
  5550000=27,
  5600000=37,
  5650000=200,
  5700000=91,
  5750000=62,
  5800000=38,
  5850000=19,
  5900000=19,
  5950000=228,
  6000000=348,
  6050000=332,
  6100000=123,
  6150000=17,
  6200000=17,
  6250000=290,
  6300000=331,
  6350000=28,
  6400000=17,
  6450000=16,
  6500000=29,
  6550000=39,
  6600000=47,
  6650000=66,
  6700000=64,
  6750000=81,
  6800000=82,
  6850000=84,
  6900000=64,
  6950000=59,
  7000000=59,
  7050000=56,
  7100000=61,
  7150000=62,
  7200000=54,
  7250000=40,
  7300000=33,
  7350000=31,
  7400000=38,
  7450000=58,
  7500000=99,
  7550000=72,
  7600000=64,
  7650000=228,
  7700000=170,
  7750000=69,
  7800000=437,
  7850000=535,
  7900000=140,
  7950000=269,
  8000000=113,
  8050000=68,
  8100000=75,
  8150000=52,
  8200000=55,
  8250000=26,
  8300000=51,
  8350000=18,
  8400000=32,
  8450000=50,
  8500000=51,
  8550000=26,
  8600000=18,
  8650000=17,
  8700000=17,
  8750000=363,
  8800000=26,
  8850000=31,
  8900000=29,
  8950000=22,
  9000000=18,
  9050000=14,
  9100000=1,
  9150000=0,
  9200000=0,
  9250000=0,
  9300000=0,
  9350000=0,
  9400000=0,
  9450000=0,
  9500000=0,
  9550000=0,
  9600000=0,
  9650000=0,
  9700000=0,
  9750000=0,
  9800000=0,
  9850000=0,
  9900000=0,
  9950000=0,
  10000000=0,
  10050000=8,
  10100000=13,
  10150000=13,
  10200000=12,
  10250000=14,
  10300000=47,
  10350000=13,
  10400000=47,
  10450000=13,
  10500000=13,
  10550000=13,
  10600000=48,
  10650000=13,
  10700000=48,
  10750000=16,
  10800000=33,
  10850000=29,
  10900000=68,
  10950000=34,
  11000000=29,
  11050000=14,
  11100000=26,
  11150000=220,
  11200000=219,
  11250000=245,
  11300000=95,
  11350000=272,
  11400000=264,
  11450000=181,
  11500000=138,
  11550000=10,
  11600000=14,
  11650000=109,
  11700000=148,
  11750000=132,
  11800000=170,
  11850000=93,
  11900000=0,
  11950000=0,
  12000000=0,
  12050000=0,
  12100000=35,
  12150000=0,
  12200000=0,
  12250000=0,
  12300000=0,
  12350000=0,
  12400000=0,
  12450000=0,
  12500000=0,
  12550000=0,
  12600000=0,
  12650000=0,
  12700000=0,
  12750000=0]
}
************************************************

-Jestan





Pekka Enberg

unread,
Sep 26, 2013, 3:49:24 AM9/26/13
to Jestan Nirojan, Osv Dev
Hi Jestan,

On Tue, Sep 24, 2013 at 9:55 PM, Jestan Nirojan <jestan...@gmail.com> wrote:
> I have got a Netty application working on OSv
> https://github.com/jestan/netty-osv-perf.
>
> Starting the application is very fast :) and it completed the task faster
> than my host PC (sending 8 byte messages from client to server in ping pong
> fashion 100000 times)
> and its great, keep up the good work guys.
>
> but I have got following histogram results for the latency, i was hoping
> that it would be close to few nano seconds, any idea why the latency is like
> this?

What exactly are you trying to measure here? OSv loopback latency? The
test case runs such a short amount of time, you're also measuring
Hotspot JIT compilation...

Microbenchmarks are very hard to get right on the JVM. I strongly
recommend porting the test to JMH before continuing with the
experiment:

http://openjdk.java.net/projects/code-tools/jmh/

Pekka

Jestan Nirojan

unread,
Sep 26, 2013, 9:51:15 AM9/26/13
to osv...@googlegroups.com, Jestan Nirojan
Hi Pekka,

I will port the test to JMH and see. thank you for suggesting JMH.
I was not trying to measure the OSv loopback latency. I was trying to compare with the numbers I got with host OS since OSv has low overhead.
The application I wrote has some resource leak and there are thousands of exceptions thrown (some resource leak detection exception from Netty), so I have to fix it before starting JMH port. (The resource leak exception has nothing to do with OSv)

thanks
-Jestan
Reply all
Reply to author
Forward
0 new messages