Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast response/partition-queue #8009

Conversation

Projects
None yet
4 participants
@pveentjer
Copy link
Member

commented Apr 25, 2016

The response queue and partition queue make use of the MPSCQueue. This queue relies on LockSupport and gives a performance improvement.

Performance numbers:

3.7 master

INFO  13:06:56 Total performance       100.00%    405,179,823 ops   675,203.21 ops/s
INFO  13:06:56   Agent C_A1             25.78%    104,472,288 ops   174,095.24 ops/s
INFO  13:06:56   Agent C_A2             24.38%     98,786,949 ops   164,620.77 ops/s
INFO  13:06:56   Agent C_A3             25.43%    103,041,609 ops   171,711.98 ops/s
INFO  13:06:56   Agent C_A4             24.40%     98,878,977 ops   164,775.23 ops/s
INFO  13:06:57 AtomicLongTest Results of probe workerProbe:
       Value     Percentile TotalCount 1/(1-Percentile)

     98.0000 0.000000000000          1           1.00
    186.0000 0.100000000000   40640278           1.11
    199.0000 0.200000000000   83560785           1.25
    209.0000 0.300000000000  124080288           1.43
    218.0000 0.400000000000  162619645           1.67
    228.0000 0.500000000000  205418082           2.00
    233.0000 0.550000000000  226200850           2.22
    238.0000 0.600000000000  246315147           2.50
    243.0000 0.650000000000  265682779           2.86
    248.0000 0.700000000000  283668955           3.33
    255.0000 0.750000000000  305205468           4.00
    259.0000 0.775000000000  315793413           4.44
    263.0000 0.800000000000  325266361           5.00
    268.0000 0.825000000000  335722591           5.71
    273.0000 0.850000000000  344809996           6.67
    280.0000 0.875000000000  355558298           8.00
    284.0000 0.887500000000  360835611           8.89
    288.0000 0.900000000000  365577653          10.00
    292.0000 0.912500000000  369880643          11.43
    298.0000 0.925000000000  375427362          13.33
    304.0000 0.937500000000  379882682          16.00
    309.0000 0.943750000000  382954964          17.78
    313.0000 0.950000000000  385075396          20.00
    319.0000 0.956250000000  387819067          22.86
    325.0000 0.962500000000  390140787          26.67
    333.0000 0.968750000000  392748131          32.00
    337.0000 0.971875000000  393887754          35.56
    342.0000 0.975000000000  395194100          40.00
    347.0000 0.978125000000  396338738          45.71
    354.0000 0.981250000000  397662091          53.33
    362.0000 0.984375000000  398870430          64.00
    367.0000 0.985937500000  399502052          71.11
    373.0000 0.987500000000  400167672          80.00
    379.0000 0.989062500000  400751689          91.43
    387.0000 0.990625000000  401430055         106.67
    395.0000 0.992187500000  402012847         128.00
    401.0000 0.992968750000  402370135         142.22
    407.0000 0.993750000000  402670668         160.00
    414.0000 0.994531250000  402964709         182.86
    423.0000 0.995312500000  403275116         213.33
    435.0000 0.996093750000  403609344         256.00
    441.0000 0.996484375000  403751495         284.44
    449.0000 0.996875000000  403909817         320.00
    460.0000 0.997265625000  404078407         365.71
    473.0000 0.997656250000  404227421         426.67
    491.0000 0.998046875000  404382834         512.00
    504.0000 0.998242187500  404464232         568.89
    522.0000 0.998437500000  404543558         640.00
    547.0000 0.998632812500  404620240         731.43
    591.0000 0.998828125000  404699070         853.33
    668.0000 0.999023437500  404777896        1024.00
    723.0000 0.999121093750  404817378        1137.78
    790.0000 0.999218750000  404856706        1280.00
    867.0000 0.999316406250  404896237        1462.86
    972.0000 0.999414062500  404935765        1706.67
   1149.0000 0.999511718750  404975333        2048.00
   1270.0000 0.999560546875  404995080        2275.56
   1486.0000 0.999609375000  405014848        2560.00
   1845.0000 0.999658203125  405034632        2925.71
   2105.0000 0.999707031250  405054404        3413.33
   2388.0000 0.999755859375  405074195        4096.00
   2619.0000 0.999780273438  405084063        4551.11
   2895.0000 0.999804687500  405093969        5120.00
   3219.0000 0.999829101563  405103841        5851.43
   3876.0000 0.999853515625  405113724        6826.67
   4374.0000 0.999877929688  405123620        8192.00
   4564.0000 0.999890136719  405128575        9102.22
   4764.0000 0.999902343750  405133515       10240.00
   5013.0000 0.999914550781  405138459       11702.86
   5297.0000 0.999926757813  405143407       13653.33
   5652.0000 0.999938964844  405148347       16384.00
   5906.0000 0.999945068359  405150821       18204.44
   6280.0000 0.999951171875  405153300       20480.00
   6781.0000 0.999957275391  405155767       23405.71
   7764.0000 0.999963378906  405158237       27306.67
  11552.0000 0.999969482422  405160710       32768.00
  12810.0000 0.999972534180  405161946       36408.89
  15420.0000 0.999975585938  405163183       40960.00
  17105.0000 0.999978637695  405164419       46811.43
  18012.0000 0.999981689453  405165657       54613.33
  18533.0000 0.999984741211  405166893       65536.00
  18863.0000 0.999986267090  405167516       72817.78
  19209.0000 0.999987792969  405168129       81920.00
  19531.0000 0.999989318848  405168747       93622.86
  19932.0000 0.999990844727  405169366      109226.67
  20572.0000 0.999992370605  405169984      131072.00
  21156.0000 0.999993133545  405170292      145635.56
  26486.0000 0.999993896484  405170602      163840.00
  27435.0000 0.999994659424  405170911      187245.71
  28190.0000 0.999995422363  405171221      218453.33
  28952.0000 0.999996185303  405171529      262144.00
  30262.0000 0.999996566772  405171683      291271.11
  32486.0000 0.999996948242  405171838      327680.00
  33565.0000 0.999997329712  405171993      374491.43
  34597.0000 0.999997711182  405172147      436906.67
  34963.0000 0.999998092651  405172302      524288.00
  35135.0000 0.999998283386  405172379      582542.22
  38941.0000 0.999998474121  405172456      655360.00
  39661.0000 0.999998664856  405172534      748982.86
  40277.0000 0.999998855591  405172611      873813.33
  40457.0000 0.999999046326  405172688     1048576.00
  40537.0000 0.999999141693  405172727     1165084.44
  42181.0000 0.999999237061  405172765     1310720.00
  42665.0000 0.999999332428  405172804     1497965.71
  42935.0000 0.999999427795  405172844     1747626.67
  43273.0000 0.999999523163  405172881     2097152.00
  43401.0000 0.999999570847  405172901     2330168.89
  43823.0000 0.999999618530  405172920     2621440.00
  44707.0000 0.999999666214  405172939     2995931.43
  44987.0000 0.999999713898  405172959     3495253.33
  45263.0000 0.999999761581  405172978     4194304.00
  45299.0000 0.999999785423  405172988     4660337.78
  45335.0000 0.999999809265  405172998     5242880.00
  45373.0000 0.999999833107  405173007     5991862.86
  45411.0000 0.999999856949  405173017     6990506.67
  45449.0000 0.999999880791  405173026     8388608.00
  45459.0000 0.999999892712  405173031     9320675.55
  45473.0000 0.999999904633  405173036    10485760.00
  45493.0000 0.999999916553  405173041    11983725.71
  45507.0000 0.999999928474  405173046    13981013.34
  45535.0000 0.999999940395  405173050    16777216.00
  45559.0000 0.999999946356  405173053    18641351.10
  45567.0000 0.999999952316  405173055    20971519.98
  45581.0000 0.999999958277  405173059    23967451.45
  45591.0000 0.999999964237  405173061    27962026.68
  45595.0000 0.999999970198  405173062    33554432.00
  45611.0000 0.999999973178  405173065    37282702.28
  45611.0000 0.999999976158  405173065    41943039.96
  45619.0000 0.999999979138  405173066    47934902.91
  45641.0000 0.999999982119  405173067    55924053.19
  45667.0000 0.999999985099  405173068    67108864.00
  45681.0000 0.999999986589  405173069    74565404.57
  45701.0000 0.999999988079  405173070    83886080.31
  45701.0000 0.999999989569  405173070    95869805.31
  45705.0000 0.999999991059  405173071   111848106.39
  45705.0000 0.999999992549  405173071   134217728.00
  45775.0000 0.999999993294  405173072   149130807.90
  45775.0000 0.999999994040  405173072   167772160.63
  45775.0000 0.999999994785  405173072   191739610.61
  45809.0000 0.999999995530  405173073   223696215.56
  45809.0000 0.999999996275  405173073   268435456.00
  45809.0000 0.999999996647  405173073   298261615.80
  45809.0000 0.999999997020  405173073   335544315.00
  45809.0000 0.999999997392  405173073   383479229.39
  45815.0000 0.999999997765  405173074   447392431.11
  45815.0000 1.000000000000  405173074
#[Mean    =     235.9786, StdDeviation   =     143.9009]
#[Max     =   45815.0000, Total count    =    405173074]
#[Buckets =           12, SubBuckets     =        32768]

3.7 fast queue server no spin

INFO  13:21:06 Total performance       100.00%    433,332,935 ops   722,127.35 ops/s
INFO  13:21:06   Agent C_A2             25.08%    108,675,936 ops   181,103.62 ops/s
INFO  13:21:06   Agent C_A1             25.07%    108,649,382 ops   181,055.75 ops/s
INFO  13:21:06   Agent C_A4             25.99%    112,611,225 ops   187,661.92 ops/s
INFO  13:21:06   Agent C_A3             23.86%    103,396,392 ops   172,306.07 ops/s
INFO  13:21:06 AtomicLongTest Results of probe workerProbe:
       Value     Percentile TotalCount 1/(1-Percentile)

     99.0000 0.000000000000          1           1.00
    180.0000 0.100000000000   46288805           1.11
    191.0000 0.200000000000   90811814           1.25
    199.0000 0.300000000000  132957272           1.43
    207.0000 0.400000000000  176954406           1.67
    215.0000 0.500000000000  219825847           2.00
    219.0000 0.550000000000  240224245           2.22
    224.0000 0.600000000000  264399245           2.50
    228.0000 0.650000000000  282552416           2.86
    233.0000 0.700000000000  303706830           3.33
    239.0000 0.750000000000  326795155           4.00
    242.0000 0.775000000000  337463974           4.44
    245.0000 0.800000000000  347549056           5.00
    249.0000 0.825000000000  359576822           5.71
    253.0000 0.850000000000  370050837           6.67
    257.0000 0.875000000000  379170464           8.00
    260.0000 0.887500000000  385203922           8.89
    263.0000 0.900000000000  390626125          10.00
    266.0000 0.912500000000  395493408          11.43
    270.0000 0.925000000000  401210955          13.33
    275.0000 0.937500000000  407264422          16.00
    277.0000 0.943750000000  409386903          17.78
    280.0000 0.950000000000  412284109          20.00
    283.0000 0.956250000000  414872494          22.86
    286.0000 0.962500000000  417185116          26.67
    290.0000 0.968750000000  419893757          32.00
    293.0000 0.971875000000  421679296          35.56
    295.0000 0.975000000000  422744320          40.00
    298.0000 0.978125000000  424146105          45.71
    301.0000 0.981250000000  425345469          53.33
    305.0000 0.984375000000  426685509          64.00
    307.0000 0.985937500000  427260244          71.11
    310.0000 0.987500000000  428020566          80.00
    313.0000 0.989062500000  428678153          91.43
    317.0000 0.990625000000  429420178         106.67
    321.0000 0.992187500000  430035710         128.00
    323.0000 0.992968750000  430303279         142.22
    326.0000 0.993750000000  430660065         160.00
    329.0000 0.994531250000  430970701         182.86
    333.0000 0.995312500000  431321752         213.33
    338.0000 0.996093750000  431676402         256.00
    341.0000 0.996484375000  431852822         284.44
    344.0000 0.996875000000  432004280         320.00
    348.0000 0.997265625000  432167970         365.71
    353.0000 0.997656250000  432325287         426.67
    360.0000 0.998046875000  432484245         512.00
    365.0000 0.998242187500  432567775         568.89
    372.0000 0.998437500000  432655964         640.00
    381.0000 0.998632812500  432737193         731.43
    396.0000 0.998828125000  432820761         853.33
    432.0000 0.999023437500  432905152        1024.00
    475.0000 0.999121093750  432946332        1137.78
    569.0000 0.999218750000  432988581        1280.00
    699.0000 0.999316406250  433030772        1462.86
    836.0000 0.999414062500  433073237        1706.67
    991.0000 0.999511718750  433115576        2048.00
   1106.0000 0.999560546875  433136605        2275.56
   1232.0000 0.999609375000  433157773        2560.00
   1460.0000 0.999658203125  433178930        2925.71
   1975.0000 0.999707031250  433200062        3413.33
   2433.0000 0.999755859375  433221227        4096.00
   2755.0000 0.999780273438  433231802        4551.11
   2994.0000 0.999804687500  433242378        5120.00
   3214.0000 0.999829101563  433252963        5851.43
   3535.0000 0.999853515625  433263515        6826.67
   4041.0000 0.999877929688  433274110        8192.00
   4258.0000 0.999890136719  433279385        9102.22
   4428.0000 0.999902343750  433284703       10240.00
   4607.0000 0.999914550781  433289985       11702.86
   4867.0000 0.999926757813  433295261       13653.33
   5199.0000 0.999938964844  433300553       16384.00
   5381.0000 0.999945068359  433303190       18204.44
   5599.0000 0.999951171875  433305835       20480.00
   5946.0000 0.999957275391  433308480       23405.71
   6440.0000 0.999963378906  433311125       27306.67
   8167.0000 0.999969482422  433313766       32768.00
  10819.0000 0.999972534180  433315089       36408.89
  13832.0000 0.999975585938  433316412       40960.00
  16636.0000 0.999978637695  433317734       46811.43
  17655.0000 0.999981689453  433319057       54613.33
  18508.0000 0.999984741211  433320378       65536.00
  18850.0000 0.999986267090  433321042       72817.78
  19151.0000 0.999987792969  433321701       81920.00
  19426.0000 0.999989318848  433322362       93622.86
  20148.0000 0.999990844727  433323023      109226.67
  20975.0000 0.999992370605  433323684      131072.00
  22126.0000 0.999993133545  433324015      145635.56
  24390.0000 0.999993896484  433324346      163840.00
  25852.0000 0.999994659424  433324676      187245.71
  26513.0000 0.999995422363  433325007      218453.33
  27318.0000 0.999996185303  433325337      262144.00
  27658.0000 0.999996566772  433325503      291271.11
  28336.0000 0.999996948242  433325668      327680.00
  28662.0000 0.999997329712  433325833      374491.43
  29020.0000 0.999997711182  433325999      436906.67
  29639.0000 0.999998092651  433326164      524288.00
  31149.0000 0.999998283386  433326247      582542.22
  31575.0000 0.999998474121  433326329      655360.00
  35515.0000 0.999998664856  433326412      748982.86
  35751.0000 0.999998855591  433326495      873813.33
  36189.0000 0.999999046326  433326578     1048576.00
  36325.0000 0.999999141693  433326619     1165084.44
  36629.0000 0.999999237061  433326660     1310720.00
  36727.0000 0.999999332428  433326703     1497965.71
  36953.0000 0.999999427795  433326743     1747626.67
  37411.0000 0.999999523163  433326784     2097152.00
  37555.0000 0.999999570847  433326806     2330168.89
  39963.0000 0.999999618530  433326825     2621440.00
  42833.0000 0.999999666214  433326846     2995931.43
  43071.0000 0.999999713898  433326867     3495253.33
  43181.0000 0.999999761581  433326887     4194304.00
  43261.0000 0.999999785423  433326898     4660337.78
  43549.0000 0.999999809265  433326908     5242880.00
  43893.0000 0.999999833107  433326918     5991862.86
  44155.0000 0.999999856949  433326929     6990506.67
  44193.0000 0.999999880791  433326939     8388608.00
  44227.0000 0.999999892712  433326944     9320675.55
  44263.0000 0.999999904633  433326949    10485760.00
  44287.0000 0.999999916553  433326954    11983725.71
  44317.0000 0.999999928474  433326960    13981013.34
  44363.0000 0.999999940395  433326965    16777216.00
  44391.0000 0.999999946356  433326967    18641351.10
  44423.0000 0.999999952316  433326970    20971519.98
  44455.0000 0.999999958277  433326972    23967451.45
  44555.0000 0.999999964237  433326975    27962026.68
  44583.0000 0.999999970198  433326978    33554432.00
  44585.0000 0.999999973178  433326979    37282702.28
  44609.0000 0.999999976158  433326980    41943039.96
  44619.0000 0.999999979138  433326981    47934902.91
  44633.0000 0.999999982119  433326983    55924053.19
  44637.0000 0.999999985099  433326984    67108864.00
  44663.0000 0.999999986589  433326986    74565404.57
  44663.0000 0.999999988079  433326986    83886080.31
  44663.0000 0.999999989569  433326986    95869805.31
  44675.0000 0.999999991059  433326987   111848106.39
  44675.0000 0.999999992549  433326987   134217728.00
  44715.0000 0.999999993294  433326988   149130807.90
  44715.0000 0.999999994040  433326988   167772160.63
  44715.0000 0.999999994785  433326988   191739610.61
  44783.0000 0.999999995530  433326989   223696215.56
  44783.0000 0.999999996275  433326989   268435456.00
  44783.0000 0.999999996647  433326989   298261615.80
  44783.0000 0.999999997020  433326989   335544315.00
  44783.0000 0.999999997392  433326989   383479229.39
  44831.0000 0.999999997765  433326990   447392431.11
  44831.0000 1.000000000000  433326990
#[Mean    =     220.6241, StdDeviation   =     131.5701]
#[Max     =   44831.0000, Total count    =    433326990]
#[Buckets =           12, SubBuckets     =        32768]

round 2

INFO  14:08:39 Total performance       100.00%    425,558,216 ops   709,167.43 ops/s
INFO  14:08:39   Agent C_A1             25.73%    109,488,048 ops   182,453.62 ops/s
INFO  14:08:39   Agent C_A2             25.48%    108,443,656 ops   180,713.22 ops/s
INFO  14:08:39   Agent C_A3             23.63%    100,555,539 ops   167,572.46 ops/s
INFO  14:08:39   Agent C_A4             25.16%    107,070,973 ops   178,428.13 ops/s
INFO  14:08:40 AtomicLongTest Results of probe workerProbe:
       Value     Percentile TotalCount 1/(1-Percentile)

     95.0000 0.000000000000          1           1.00
    178.0000 0.100000000000   44422509           1.11
    190.0000 0.200000000000   89194329           1.25
    198.0000 0.300000000000  128047848           1.43
    207.0000 0.400000000000  173370771           1.67
    216.0000 0.500000000000  216726861           2.00
    220.0000 0.550000000000  234945451           2.22
    225.0000 0.600000000000  256466232           2.50
    231.0000 0.650000000000  280270086           2.86
    236.0000 0.700000000000  298471944           3.33
    243.0000 0.750000000000  321721688           4.00
    246.0000 0.775000000000  330812247           4.44
    250.0000 0.800000000000  341657354           5.00
    254.0000 0.825000000000  351134526           5.71
    260.0000 0.850000000000  363150819           6.67
    266.0000 0.875000000000  372987656           8.00
    270.0000 0.887500000000  378542257           8.89
    274.0000 0.900000000000  383415706          10.00
    279.0000 0.912500000000  388720265          11.43
    285.0000 0.925000000000  394209174          13.33
    291.0000 0.937500000000  399029595          16.00
    295.0000 0.943750000000  401926278          17.78
    299.0000 0.950000000000  404412668          20.00
    304.0000 0.956250000000  406983710          22.86
    311.0000 0.962500000000  409805690          26.67
    319.0000 0.968750000000  412262194          32.00
    325.0000 0.971875000000  413758752          35.56
    331.0000 0.975000000000  415070712          40.00
    337.0000 0.978125000000  416264752          45.71
    345.0000 0.981250000000  417720598          53.33
    354.0000 0.984375000000  418977582          64.00
    360.0000 0.985937500000  419627779          71.11
    367.0000 0.987500000000  420263499          80.00
    375.0000 0.989062500000  420897756          91.43
    384.0000 0.990625000000  421566500         106.67
    393.0000 0.992187500000  422234568         128.00
    398.0000 0.992968750000  422567594         142.22
    404.0000 0.993750000000  422913934         160.00
    411.0000 0.994531250000  423252899         182.86
    419.0000 0.995312500000  423574400         213.33
    429.0000 0.996093750000  423914193         256.00
    434.0000 0.996484375000  424067205         284.44
    440.0000 0.996875000000  424240069         320.00
    446.0000 0.997265625000  424390829         365.71
    455.0000 0.997656250000  424562350         426.67
    467.0000 0.998046875000  424726959         512.00
    475.0000 0.998242187500  424811188         568.89
    484.0000 0.998437500000  424890835         640.00
    496.0000 0.998632812500  424975419         731.43
    515.0000 0.998828125000  425053901         853.33
    556.0000 0.999023437500  425136686        1024.00
    602.0000 0.999121093750  425178037        1137.78
    672.0000 0.999218750000  425219262        1280.00
    768.0000 0.999316406250  425260795        1462.86
    874.0000 0.999414062500  425302562        1706.67
   1031.0000 0.999511718750  425344049        2048.00
   1148.0000 0.999560546875  425364696        2275.56
   1296.0000 0.999609375000  425385481        2560.00
   1627.0000 0.999658203125  425406226        2925.71
   2083.0000 0.999707031250  425427020        3413.33
   2545.0000 0.999755859375  425447777        4096.00
   2931.0000 0.999780273438  425458185        4551.11
   3194.0000 0.999804687500  425468558        5120.00
   3458.0000 0.999829101563  425478951        5851.43
   3840.0000 0.999853515625  425489325        6826.67
   4260.0000 0.999877929688  425499714        8192.00
   4424.0000 0.999890136719  425504947        9102.22
   4590.0000 0.999902343750  425510104       10240.00
   4784.0000 0.999914550781  425515310       11702.86
   5050.0000 0.999926757813  425520503       13653.33
   5362.0000 0.999938964844  425525700       16384.00
   5538.0000 0.999945068359  425528289       18204.44
   5798.0000 0.999951171875  425530885       20480.00
   6191.0000 0.999957275391  425533479       23405.71
   6835.0000 0.999963378906  425536076       27306.67
   8038.0000 0.999969482422  425538676       32768.00
   9224.0000 0.999972534180  425539972       36408.89
  11450.0000 0.999975585938  425541271       40960.00
  17090.0000 0.999978637695  425542571       46811.43
  18027.0000 0.999981689453  425543868       54613.33
  18773.0000 0.999984741211  425545167       65536.00
  19137.0000 0.999986267090  425545817       72817.78
  19653.0000 0.999987792969  425546466       81920.00
  20308.0000 0.999989318848  425547115       93622.86
  20916.0000 0.999990844727  425547764      109226.67
  21681.0000 0.999992370605  425548414      131072.00
  22875.0000 0.999993133545  425548738      145635.56
  24394.0000 0.999993896484  425549064      163840.00
  25738.0000 0.999994659424  425549388      187245.71
  26578.0000 0.999995422363  425549712      218453.33
  27176.0000 0.999996185303  425550039      262144.00
  27390.0000 0.999996566772  425550200      291271.11
  27683.0000 0.999996948242  425550362      327680.00
  28176.0000 0.999997329712  425550524      374491.43
  28846.0000 0.999997711182  425550686      436906.67
  29537.0000 0.999998092651  425550850      524288.00
  32700.0000 0.999998283386  425550930      582542.22
  35827.0000 0.999998474121  425551011      655360.00
  36981.0000 0.999998664856  425551092      748982.86
  37295.0000 0.999998855591  425551173      873813.33
  37551.0000 0.999999046326  425551255     1048576.00
  37775.0000 0.999999141693  425551295     1165084.44
  39425.0000 0.999999237061  425551336     1310720.00
  40047.0000 0.999999332428  425551376     1497965.71
  40233.0000 0.999999427795  425551417     1747626.67
  40435.0000 0.999999523163  425551458     2097152.00
  41011.0000 0.999999570847  425551478     2330168.89
  41871.0000 0.999999618530  425551498     2621440.00
  42131.0000 0.999999666214  425551518     2995931.43
  42953.0000 0.999999713898  425551539     3495253.33
  43293.0000 0.999999761581  425551559     4194304.00
  43415.0000 0.999999785423  425551569     4660337.78
  43525.0000 0.999999809265  425551579     5242880.00
  43603.0000 0.999999833107  425551589     5991862.86
  43677.0000 0.999999856949  425551600     6990506.67
  43723.0000 0.999999880791  425551610     8388608.00
  43757.0000 0.999999892712  425551615     9320675.55
  43787.0000 0.999999904633  425551620    10485760.00
  43817.0000 0.999999916553  425551625    11983725.71
  43883.0000 0.999999928474  425551630    13981013.34
  43971.0000 0.999999940395  425551635    16777216.00
  57639.0000 0.999999946356  425551638    18641351.10
  57907.0000 0.999999952316  425551640    20971519.98
  58315.0000 0.999999958277  425551644    23967451.45
  58333.0000 0.999999964237  425551645    27962026.68
  58363.0000 0.999999970198  425551648    33554432.00
  58379.0000 0.999999973178  425551649    37282702.28
  58413.0000 0.999999976158  425551650    41943039.96
  58431.0000 0.999999979138  425551652    47934902.91
  58433.0000 0.999999982119  425551653    55924053.19
  58441.0000 0.999999985099  425551654    67108864.00
  58443.0000 0.999999986589  425551656    74565404.57
  58443.0000 0.999999988079  425551656    83886080.31
  58443.0000 0.999999989569  425551656    95869805.31
  58447.0000 0.999999991059  425551657   111848106.39
  58447.0000 0.999999992549  425551657   134217728.00
  58479.0000 0.999999993294  425551658   149130807.90
  58479.0000 0.999999994040  425551658   167772160.63
  58479.0000 0.999999994785  425551658   191739610.61
  58535.0000 0.999999995530  425551659   223696215.56
  58535.0000 0.999999996275  425551659   268435456.00
  58535.0000 0.999999996647  425551659   298261615.80
  58535.0000 0.999999997020  425551659   335544315.00
  58535.0000 0.999999997392  425551659   383479229.39
  58665.0000 0.999999997765  425551660   447392431.11
  58665.0000 1.000000000000  425551660
#[Mean    =     224.6187, StdDeviation   =     136.9612]
#[Max     =   58665.0000, Total count    =    425551660]
#[Buckets =           12, SubBuckets     =        32768]

3.7 fast queue + spinning

INFO  13:55:42 Total performance       100.00%    430,820,904 ops   730,100.36 ops/s
INFO  13:55:42   Agent C_A2             25.21%    108,596,039 ops   184,034.26 ops/s
INFO  13:55:42   Agent C_A1             24.23%    104,402,416 ops   176,927.46 ops/s
INFO  13:55:42   Agent C_A4             25.62%    110,388,054 ops   187,071.45 ops/s
INFO  13:55:42   Agent C_A3             24.94%    107,434,395 ops   182,067.20 ops/s
INFO  13:55:43 AtomicLongTest Results of probe workerProbe:
       Value     Percentile TotalCount 1/(1-Percentile)

     97.0000 0.000000000000          1           1.00
    177.0000 0.100000000000   45216972           1.11
    188.0000 0.200000000000   86223754           1.25
    197.0000 0.300000000000  130895361           1.43
    205.0000 0.400000000000  173808407           1.67
    213.0000 0.500000000000  216111406           2.00
    218.0000 0.550000000000  241484529           2.22
    222.0000 0.600000000000  260945827           2.50
    227.0000 0.650000000000  283996915           2.86
    232.0000 0.700000000000  305520667           3.33
    237.0000 0.750000000000  325401665           4.00
    240.0000 0.775000000000  336487383           4.44
    243.0000 0.800000000000  346969739           5.00
    246.0000 0.825000000000  356697529           5.71
    250.0000 0.850000000000  368076259           6.67
    254.0000 0.875000000000  377845389           8.00
    257.0000 0.887500000000  384250604           8.89
    259.0000 0.900000000000  388116808          10.00
    262.0000 0.912500000000  393372118          11.43
    266.0000 0.925000000000  399484456          13.33
    270.0000 0.937500000000  404686915          16.00
    272.0000 0.943750000000  406981124          17.78
    275.0000 0.950000000000  410081718          20.00
    278.0000 0.956250000000  412812981          22.86
    281.0000 0.962500000000  415218464          26.67
    284.0000 0.968750000000  417335278          32.00
    287.0000 0.971875000000  419193315          35.56
    289.0000 0.975000000000  420304851          40.00
    292.0000 0.978125000000  421803990          45.71
    295.0000 0.981250000000  423102318          53.33
    298.0000 0.984375000000  424187839          64.00
    300.0000 0.985937500000  424815580          71.11
    303.0000 0.987500000000  425629378          80.00
    305.0000 0.989062500000  426100778          91.43
    309.0000 0.990625000000  426898939         106.67
    313.0000 0.992187500000  427543225         128.00
    315.0000 0.992968750000  427817784         142.22
    318.0000 0.993750000000  428180351         160.00
    321.0000 0.994531250000  428493351         182.86
    325.0000 0.995312500000  428841768         213.33
    329.0000 0.996093750000  429127305         256.00
    332.0000 0.996484375000  429307610         284.44
    335.0000 0.996875000000  429463303         320.00
    339.0000 0.997265625000  429639927         365.71
    344.0000 0.997656250000  429817358         426.67
    350.0000 0.998046875000  429972637         512.00
    354.0000 0.998242187500  430050262         568.89
    359.0000 0.998437500000  430126258         640.00
    367.0000 0.998632812500  430216882         731.43
    377.0000 0.998828125000  430295702         853.33
    394.0000 0.999023437500  430379828        1024.00
    409.0000 0.999121093750  430419815        1137.78
    438.0000 0.999218750000  430461312        1280.00
    511.0000 0.999316406250  430502697        1462.86
    657.0000 0.999414062500  430544987        1706.67
    818.0000 0.999511718750  430586813        2048.00
    906.0000 0.999560546875  430607983        2275.56
   1048.0000 0.999609375000  430628956        2560.00
   1253.0000 0.999658203125  430649993        2925.71
   1505.0000 0.999707031250  430670969        3413.33
   2422.0000 0.999755859375  430691995        4096.00
   2991.0000 0.999780273438  430702513        4551.11
   3258.0000 0.999804687500  430713026        5120.00
   3561.0000 0.999829101563  430723567        5851.43
   3910.0000 0.999853515625  430734069        6826.67
   4291.0000 0.999877929688  430744594        8192.00
   4494.0000 0.999890136719  430749832        9102.22
   4703.0000 0.999902343750  430755094       10240.00
   4996.0000 0.999914550781  430760350       11702.86
   5344.0000 0.999926757813  430765607       13653.33
   5883.0000 0.999938964844  430770869       16384.00
   6285.0000 0.999945068359  430773500       18204.44
   6944.0000 0.999951171875  430776127       20480.00
   8251.0000 0.999957275391  430778755       23405.71
  10284.0000 0.999963378906  430781384       27306.67
  11873.0000 0.999969482422  430784013       32768.00
  12384.0000 0.999972534180  430785330       36408.89
  13130.0000 0.999975585938  430786644       40960.00
  17064.0000 0.999978637695  430787957       46811.43
  17794.0000 0.999981689453  430789272       54613.33
  18400.0000 0.999984741211  430790586       65536.00
  18701.0000 0.999986267090  430791243       72817.78
  19099.0000 0.999987792969  430791902       81920.00
  19437.0000 0.999989318848  430792559       93622.86
  20652.0000 0.999990844727  430793215      109226.67
  21706.0000 0.999992370605  430793873      131072.00
  22510.0000 0.999993133545  430794201      145635.56
  23730.0000 0.999993896484  430794531      163840.00
  26208.0000 0.999994659424  430794859      187245.71
  27682.0000 0.999995422363  430795187      218453.33
  28785.0000 0.999996185303  430795516      262144.00
  29284.0000 0.999996566772  430795680      291271.11
  29558.0000 0.999996948242  430795845      327680.00
  29884.0000 0.999997329712  430796009      374491.43
  30387.0000 0.999997711182  430796173      436906.67
  33371.0000 0.999998092651  430796338      524288.00
  33925.0000 0.999998283386  430796420      582542.22
  34559.0000 0.999998474121  430796504      655360.00
  36477.0000 0.999998664856  430796584      748982.86
  37263.0000 0.999998855591  430796667      873813.33
  37417.0000 0.999999046326  430796751     1048576.00
  37533.0000 0.999999141693  430796790     1165084.44
  37975.0000 0.999999237061  430796831     1310720.00
  38865.0000 0.999999332428  430796872     1497965.71
  39123.0000 0.999999427795  430796913     1747626.67
  39335.0000 0.999999523163  430796954     2097152.00
  39423.0000 0.999999570847  430796975     2330168.89
  40855.0000 0.999999618530  430796995     2621440.00
  42179.0000 0.999999666214  430797016     2995931.43
  42473.0000 0.999999713898  430797036     3495253.33
  42693.0000 0.999999761581  430797057     4194304.00
  42787.0000 0.999999785423  430797067     4660337.78
  42971.0000 0.999999809265  430797077     5242880.00
  43167.0000 0.999999833107  430797088     5991862.86
  43367.0000 0.999999856949  430797098     6990506.67
  43489.0000 0.999999880791  430797108     8388608.00
  43527.0000 0.999999892712  430797113     9320675.55
  43547.0000 0.999999904633  430797118    10485760.00
  43563.0000 0.999999916553  430797128    11983725.71
  43565.0000 0.999999928474  430797129    13981013.34
  43589.0000 0.999999940395  430797135    16777216.00
  43591.0000 0.999999946356  430797136    18641351.10
  43595.0000 0.999999952316  430797139    20971519.98
  43613.0000 0.999999958277  430797142    23967451.45
  43625.0000 0.999999964237  430797144    27962026.68
  43635.0000 0.999999970198  430797147    33554432.00
  43643.0000 0.999999973178  430797148    37282702.28
  43647.0000 0.999999976158  430797149    41943039.96
  43657.0000 0.999999979138  430797151    47934902.91
  43667.0000 0.999999982119  430797152    55924053.19
  43677.0000 0.999999985099  430797153    67108864.00
  48799.0000 0.999999986589  430797154    74565404.57
  48799.0000 0.999999988079  430797154    83886080.31
  48875.0000 0.999999989569  430797155    95869805.31
  49053.0000 0.999999991059  430797156   111848106.39
  49053.0000 0.999999992549  430797156   134217728.00
  49231.0000 0.999999993294  430797157   149130807.90
  49231.0000 0.999999994040  430797157   167772160.63
  49231.0000 0.999999994785  430797157   191739610.61
  49337.0000 0.999999995530  430797158   223696215.56
  49337.0000 0.999999996275  430797158   268435456.00
  49337.0000 0.999999996647  430797158   298261615.80
  49337.0000 0.999999997020  430797158   335544315.00
  49337.0000 0.999999997392  430797158   383479229.39
  49379.0000 0.999999997765  430797159   447392431.11
  49379.0000 1.000000000000  430797159
#[Mean    =     218.1754, StdDeviation   =     138.7358]
#[Max     =   49379.0000, Total count    =    430797159]
#[Buckets =           12, SubBuckets     =        32768]

@pveentjer pveentjer added this to the 3.7 milestone Apr 25, 2016

@pveentjer pveentjer force-pushed the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch 2 times, most recently from d16c23a to 8d199ad Apr 25, 2016

@pveentjer pveentjer changed the title [DONT MERGE] Fastqueue responsethread partititionthread Fast respone/partition-queue Apr 26, 2016

@pveentjer pveentjer changed the title Fast respone/partition-queue Fast response/partition-queue Apr 26, 2016

@pveentjer pveentjer force-pushed the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch 6 times, most recently from 7621cf5 to 2570353 Apr 28, 2016


IdleStrategy idleStrategy = client.getProperties().getBoolean(FAST)
? new BackoffIdleStrategy(IDLE_MAX_SPINS, IDLE_MAX_YIELDS, IDLE_MIN_PARK_NS, IDLE_MAX_PARK_NS)
: new NoOpIdleStrategy();

This comment has been minimized.

Copy link
@mtopolnik

mtopolnik May 4, 2016

Contributor

A FAST response queue uses the backoff strategy, and the "regular" one uses busy spinning. What's the reasoning behind this choice?

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 5, 2016

Author Member

the regular one immediately blocks; no spinning at all. When the NoOpIdleStrategy returns true, the taker will immediately block.

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 6, 2016

Author Member

I made a change in the approach. I can't rely on the return value of the IdlePolicy to determine if I should block or not.

So if no IdlePolicy is set, the consumer will block.

If an IdlePolicy is set, the consumer will not block and relies on the idle policy for idling.

There will be 3 idle options available, that can be configured through a HazelcastProperty
1: block (default)
2: backoff
3: busyspin

for (; ; ) {
if (consumerThread.isInterrupted()) {
putStack.compareAndSet(BLOCKED, null);
throw new InterruptedException("bla");

This comment has been minimized.

Copy link
@mtopolnik

mtopolnik May 4, 2016

Contributor

bla?

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 5, 2016

Author Member

oops.. remainder.. I was looking at some interrupt issues and trying to figure out what happened to mine. Later on I figured out it was caused by the unit test framework.



abstract class ClientInvocationServiceSupport implements ClientInvocationService {
public static final HazelcastProperty FAST

This comment has been minimized.

Copy link
@Donnerbart

Donnerbart May 4, 2016

Contributor

For a public field the name FAST is a bit ambiguous. Maybe QUEUE_FAST (which is still quite bad)?. Can this field be private?

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 5, 2016

Author Member

Let me think about a more sensible name.

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 5, 2016

Author Member

I have changed it so a policy can be configured.

The property is called 'idle strategy' and can be configured with block, backoff, busyspin and will default to block. I'll change this on the client side as well.

This comment has been minimized.

Copy link
@Donnerbart

Donnerbart May 5, 2016

Contributor

Maybe an enum then?

public enum QUEUE_STRATEGY {
  BLOCKING,
  TEMP_SPINNING,
  SPINNING
}

EDIT: Ah forget it, there is no enum value for properties any more :(

This comment has been minimized.

Copy link
@mtopolnik

mtopolnik May 5, 2016

Contributor

Keep in mind that spinning blocks other threads from making progress. Single-threaded testing doesn't show the full pictur. For example, i measured better performance in Hot Restart reloading when i parked the thread sooner.

* on the stack, the owning thread can take them all using a single cas. Once this is done, the owning thread can process them
* one by one and doesn't need to content with the putting threads; reducing contention.
*
* @param <E>

This comment has been minimized.

Copy link
@Donnerbart

Donnerbart May 4, 2016

Contributor

This is for @param <E>, taken from the original JavaDoc: the type of elements held in this collection

This comment has been minimized.

Copy link
@pveentjer

pveentjer May 6, 2016

Author Member

Fixed

@@ -26,6 +26,7 @@
import com.hazelcast.internal.metrics.Probe;
import com.hazelcast.internal.partition.InternalPartitionService;
import com.hazelcast.internal.serialization.InternalSerializationService;
import com.hazelcast.internal.util.collection.MPSCQueue;

This comment has been minimized.

Copy link
@Donnerbart

Donnerbart May 4, 2016

Contributor

Unused import -> CheckStyle failure.

@pveentjer pveentjer force-pushed the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch from 2570353 to 6ad4942 May 5, 2016

@mtopolnik

This comment has been minimized.

Copy link
Contributor

commented May 5, 2016

Since I've studied Peter's MPSCQueue many times before, I'm giving 👍 as soon as it's green.

@pveentjer pveentjer force-pushed the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch from d375e38 to 3f9938c May 5, 2016

@pveentjer pveentjer force-pushed the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch from 0ad3376 to 48a6363 May 6, 2016

@hasancelik

This comment has been minimized.

Copy link
Contributor

commented May 6, 2016

👍

@pveentjer pveentjer merged commit 26fde86 into hazelcast:master May 6, 2016

1 check passed

default 9410 tests run, 33 skipped, 0 failed.
Details

@pveentjer pveentjer deleted the pveentjer:performance/3.x/fastqueue-responsethread-partititionthread branch May 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.