[ 
https://issues.apache.org/jira/browse/QPID-3079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050485#comment-13050485
 ] 

Ken Giusti commented on QPID-3079:
----------------------------------

I've done some performance tuning using qpid-cpp-benchmark with various values 
for --ack-frequency.  Both durable and non-durable performance was tested.  
After some tuning, I've got the following results, with baselines to compare 
against:

----------------------------------------------------
---------------------- NON-DURABLE -----------------
----------------------------------------------------


r1124895
--------
qpid-cpp-benchmark --ack-frequency=100 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
31579           30824   0.33    79.82   6.02
31574           31543   0.39    35.47   6.47
31264           31248   0.42    45.53   5.20
30924           30882   0.36    47.00   5.91
31341           30941   0.34    41.58   7.09
31451           31041   0.34    74.01   10.80
31267           30873   0.34    47.16   6.12
31405           31376   0.34    45.09   5.27
31475           31384   0.40    31.62   7.30
31807           31400   0.38    41.03   6.04
31591           31567   0.33    43.63   7.22
30833           30104   0.37    78.80   7.59
30001           29633   0.33    129.94  51.55
31465           31435   0.35    22.21   5.30
32054           31633   0.41    41.82   5.63
30917           30535   0.36    49.37   6.00
31657           31607   0.34    26.91   5.81
30983           30242   0.34    79.37   6.60
31302           31223   0.39    64.31   11.39
30897           30496   0.48    76.67   9.52
20 runs:  stp=31289.349609 rtp=30999.349609 lmin=0.367000 lmax=55.066998 
lavg=9.141500

qpid-cpp-benchmark --ack-frequency=10 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
27617           27599   0.37    47.48   6.62
28662           25858   0.33    475.21  308.42
28486           28164   0.36    199.83  51.70
28910           27407   0.34    286.74  115.51
28311           28295   0.39    114.41  18.16
28272           27452   0.51    138.65  26.97
29066           27801   0.39    334.59  130.22
28872           25572   0.34    498.66  297.83
29657           26966   0.35    427.10  148.45
28235           28225   0.36    34.79   7.49
28800           28467   0.40    43.37   5.48
29142           28158   0.27    157.72  34.48
29466           26616   0.39    412.66  174.74
29470           28732   0.38    96.42   14.24
29384           28706   0.37    101.08  10.33
28221           27580   0.35    165.00  58.94
28743           28087   0.33    89.09   20.49
28316           28295   0.37    113.48  21.90
29420           29342   0.34    49.45   7.67
28442           28014   0.39    96.83   10.81
20 runs:  stp=28774.599609 rtp=27766.800781 lmin=0.366500 lmax=194.128021 
lavg=73.522491

qpid-cpp-benchmark --ack-frequency=1 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
24052           19697   1.79    1611.97 945.29
24245           19730   0.60    1622.14 1018.01
22659           19505   0.36    1541.25 958.42
23262           19665   0.43    1354.04 728.93
24574           20347   0.41    1406.91 692.94
25078           20051   0.34    1624.63 980.73
23622           19594   0.40    1444.34 828.41
22150           19778   0.35    1036.81 529.26
23041           19903   0.43    1319.29 795.41
23851           19780   0.33    1477.10 848.00
25947           20146   0.45    1753.31 1122.03
23218           19653   0.40    1361.62 817.18
22808           19721   0.34    1226.58 634.30
22528           19809   0.34    1045.04 425.75
23528           19878   0.36    1376.19 771.57
26537           20370   0.44    1891.97 1281.50
23858           19822   0.36    1571.48 968.33
23362           19867   0.34    1405.03 775.50
24934           20013   0.41    1628.51 1029.71
23728           19856   1.38    1450.68 832.09
20 runs:  stp=23849.099609 rtp=19859.250000 lmin=0.513000 lmax=1457.444336 
lavg=849.168091


QPID-3079
---------

qpid-cpp-benchmark --ack-frequency=100 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
31953           31932   0.47    33.19   7.37
32743           32676   0.39    22.82   5.72
32115           31313   0.35    80.06   5.29
32317           31506   0.34    79.88   5.30
32508           32037   0.33    45.48   6.12
32021           31604   0.42    45.56   5.17
31616           31590   0.40    85.72   21.08
32276           31873   0.37    47.40   5.23
32177           31637   0.39    53.38   5.75
32258           32251   0.34    41.31   5.24
32597           32549   0.39    39.13   7.92
32712           32703   0.39    25.52   5.38
32291           32261   0.41    41.70   4.76
32136           32125   0.32    41.13   7.37
32194           32144   0.34    43.94   7.06
32225           31792   0.35    50.12   5.77
31997           31578   0.33    46.27   5.43
31576           31184   0.33    44.37   5.58
30006           29667   0.35    57.80   7.66
32432           32009   0.37    39.90   5.39
20 runs:  stp=32107.500000 rtp=31821.550781 lmin=0.369000 lmax=48.234001 
lavg=6.729500

qpid-cpp-benchmark --ack-frequency=10 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
28512           27935   0.49    82.42   11.19
28717           26828   0.41    256.74  73.33
28813           28008   0.48    185.39  88.03
28695           28406   0.36    49.09   6.39
28710           28693   0.38    45.50   6.74
30472           26592   0.48    492.31  210.66
27940           26694   0.44    212.87  96.01
29988           28089   0.44    312.33  89.02
28959           28947   0.25    29.68   7.31
29849           28581   0.40    169.31  31.96
28977           28645   0.34    45.96   5.42
29546           28969   0.26    139.20  21.31
30389           28722   0.45    244.09  32.60
28805           28768   0.44    47.38   6.92
29686           27502   0.48    269.69  50.58
28521           28186   0.33    43.66   7.27
29568           29549   0.34    44.37   7.84
29330           29275   0.41    52.31   6.62
29219           28437   0.41    182.32  29.60
29043           27681   0.59    254.53  107.95
20 runs:  stp=29186.949219 rtp=28225.349609 lmin=0.409000 lmax=157.957489 
lavg=44.837502

qpid-cpp-benchmark --ack-frequency=1 --repeat=20 --summarize
send-tp         recv-tp l-min   l-max   l-avg
24875           19858   1.90    1574.27 1010.82
23875           19983   0.61    1348.91 782.06
24746           20338   0.33    1461.11 858.63
25028           19772   0.33    1580.16 1012.99
24411           19942   0.71    1419.09 814.73
24491           19938   0.35    1556.91 969.29
24583           19769   0.39    1547.57 916.28
24072           19743   0.48    1506.17 967.11
25066           19923   0.34    1578.53 968.34
23066           19507   0.46    1268.92 765.32
25352           20048   0.54    1606.01 963.86
25022           20129   0.33    1450.66 878.87
25487           19685   0.44    1783.87 1164.04
24456           19939   1.12    1552.61 897.63
24954           19818   0.41    1569.96 982.57
25829           19948   0.45    1682.67 1089.05
25199           19803   0.34    1601.31 994.90
25782           19855   0.37    1760.06 1136.86
24370           19899   0.32    1420.49 819.97
24370           20193   0.39    1371.76 849.36
20 runs:  stp=24751.699219 rtp=19904.500000 lmin=0.530500 lmax=1532.052002 
lavg=942.134094

------------------------------------------------
---------------------- DURABLE -----------------
------------------------------------------------

trunk @ Revision: 1132723
-------------------------

qpid-cpp-benchmark --ack-frequency=100 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
15899           15743   0.65    92.14   23.52
15699           15576   0.43    102.80  22.35
16130           15983   0.50    92.26   23.44
15694           15539   0.53    91.80   23.73
16371           16215   0.56    93.96   23.63
15722           15531   0.70    102.11  22.45
15821           15612   0.47    115.80  23.19
15606           15428   0.46    117.99  23.01
15144           14959   0.48    97.05   22.06
15705           15523   0.53    257.59  23.10
16139           16095   0.49    97.50   23.06
15912           15750   0.43    86.18   23.55
15412           15278   0.45    104.61  23.22
15882           15695   0.43    103.86  23.85
16219           16036   0.55    110.41  23.04
15508           15335   0.44    102.05  24.41
16389           16232   0.71    86.28   23.19
15451           15287   0.47    102.58  24.43
15913           15744   0.48    98.34   22.04
15296           15100   0.52    99.87   23.85
20 runs:  stp=15795.599609 rtp=15633.049805 lmin=0.514000 lmax=107.759010 
lavg=23.256001

qpid-cpp-benchmark --ack-frequency=10 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
15118           15055   0.70    89.44   24.50
15200           15083   0.47    92.84   24.22
15184           15032   0.47    104.75  24.66
15224           15055   0.50    89.92   24.95
15349           15137   0.45    93.43   25.12
15483           15474   0.65    106.42  26.08
15214           15143   0.51    94.34   23.86
14881           14709   0.46    91.34   24.78
15302           15216   0.47    114.84  23.36
15100           15025   0.44    104.88  24.09
14627           14621   0.51    111.37  24.66
15189           15005   0.64    98.40   24.85
15062           15033   0.41    102.93  24.19
12592           12562   0.52    240.69  34.90
14386           14207   0.46    300.08  28.05
15186           15167   0.43    111.80  26.09
15244           15125   0.43    77.41   24.72
15163           15125   0.45    99.12   25.50
15219           15026   0.44    115.26  24.70
15421           15221   0.46    92.91   23.94
20 runs:  stp=15007.200195 rtp=14901.049805 lmin=0.493500 lmax=116.608505 
lavg=25.361000

qpid-cpp-benchmark --ack-frequency=1 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
13765           13708   0.39    114.79  31.51
14378           14320   0.44    126.31  30.49
14478           14391   0.40    108.83  31.32
14321           14303   0.51    98.72   30.96
14313           14265   0.46    145.08  30.60
14256           14232   0.46    116.09  30.60
13971           13891   0.45    123.98  31.33
14321           14159   0.31    139.35  33.64
14411           14258   0.46    104.88  29.99
14304           14283   0.43    147.28  32.88
14282           14206   0.49    137.49  31.29
14493           14403   0.57    130.80  36.02
14480           14365   0.43    106.60  31.03
14777           14686   0.44    103.52  31.27
14579           14524   0.48    139.90  32.18
13770           13756   0.37    126.11  31.64
14421           14353   0.35    127.26  34.37
13931           13894   0.49    141.51  38.05
14427           14358   0.46    138.94  31.57
14205           14177   0.44    113.04  30.53
20 runs:  stp=14294.150391 rtp=14226.599609 lmin=0.441500 lmax=124.524002 
lavg=32.063499


QPID-3079
---------

qpid-cpp-benchmark --ack-frequency=100 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
17576           17549   0.51    93.64   24.28
17810           17605   0.43    109.52  24.40
18113           18046   0.43    78.95   24.16
17423           17317   0.53    102.32  24.75
17183           16999   0.46    162.80  24.95
17150           16947   0.45    167.36  25.55
17610           17450   0.54    91.94   24.50
17372           17177   0.52    94.34   25.56
17175           17015   0.46    91.29   24.52
17773           17570   0.46    94.71   24.34
17256           17109   0.37    96.66   24.82
17938           17682   0.47    80.89   24.05
17726           17543   0.37    69.07   24.75
17550           17418   0.42    85.21   24.98
16782           16606   0.45    105.39  25.84
17933           17716   0.41    98.26   24.26
17435           17229   0.44    101.07  25.16
17257           17204   0.47    151.21  25.41
17945           17766   0.36    72.48   24.30
17215           17062   0.57    102.04  25.28
20 runs:  stp=17511.099609 rtp=17350.500000 lmin=0.456000 lmax=102.457497 
lavg=24.792999

qpid-cpp-benchmark --ack-frequency=10 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
16797           16642   0.48    97.74   26.70
16791           16759   0.51    110.59  27.27
16845           16804   0.45    188.09  26.58
17097           16920   0.53    107.23  26.17
17155           17036   0.46    115.11  26.81
17021           16877   0.42    94.74   26.18
16936           16840   0.42    119.15  27.54
17100           16919   0.48    112.22  26.95
17019           16827   0.45    86.21   27.08
16958           16799   0.53    85.97   26.43
16615           16403   0.55    84.88   26.70
17011           16848   0.37    89.07   26.97
17122           17038   0.43    72.09   25.87
16982           16790   0.51    91.30   26.49
17228           17145   0.51    94.67   25.85
16708           16643   0.52    125.16  26.34
17021           16928   0.45    97.59   26.21
17001           16936   0.45    111.58  27.11
16857           16703   0.44    90.49   27.39
17169           16988   0.50    94.70   26.68
20 runs:  stp=16971.650391 rtp=16842.250000 lmin=0.473000 lmax=103.428993 
lavg=26.666000

qpid-cpp-benchmark --ack-frequency=1 --repeat=20 --summarize --durable
send-tp         recv-tp l-min   l-max   l-avg
16247           16196   0.64    138.00  36.24
16114           16044   0.38    187.43  43.97
15879           15734   0.38    144.90  42.36
16122           15778   0.47    139.47  43.86
16496           16440   0.43    123.99  33.80
15938           15902   0.49    143.67  44.34
16243           16157   0.46    126.73  41.84
16044           15977   0.35    137.03  39.71
14658           14597   0.44    338.71  48.27
16165           16088   0.39    131.34  37.82
15987           15887   0.45    113.31  41.46
16147           16111   0.32    107.42  35.44
13908           13887   0.74    704.67  40.71
15617           15522   0.41    232.08  37.36
16271           16178   0.34    124.93  38.72
15976           15876   0.53    130.18  39.24
16051           15982   0.29    108.90  38.23
16125           16059   0.37    210.25  45.12
16098           16022   0.52    134.17  40.02
16147           16022   0.46    119.03  40.49
20 runs:  stp=15911.650391 rtp=15822.950195 lmin=0.443000 lmax=179.810486 
lavg=40.450001


> message.accept command should be completed on a per-dequeue basis
> -----------------------------------------------------------------
>
>                 Key: QPID-3079
>                 URL: https://issues.apache.org/jira/browse/QPID-3079
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.8, 0.9
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>             Fix For: 0.11
>
>         Attachments: proposal.txt
>
>
> ** Overview
> Asynchronous completion means that command execution is initiated in one 
> thread
> (a client connection thread) and completed in a different thread.
> When the async store is loaded, message.transfer commands are
> completed by a store thread that does the async write.
> ** Issues with asynchronous completion code as of revision r1029686
> *** Not really asynchronous
> IncompleteMessageList::process blocks the connection thread till all
> outstanding async commands (messages) for the session are complete.
> With the new cluster, this could deadlock since it is blocking a Poller 
> thread.
> *** Race condition for message.transfer
>     
> Sketch of the current code:
> // Called in connection thread 
> PersistableMessage::enqueueAsync { ++counter; } 
> // Called in store thread once message is written.
> PersistableMessage::enqueueComplete { if (--counter == 0) notifyCompleted(); }
> The intent is that notify be called once per message, after the
> message has been written to each queue it was routed to.
> However of a message is routed to N queues, it's possible for
> notifyCompleted to be called up to N times. The store thread could
> call notifyCompleted for the first queue before the connection thread
> has called enqueueAsync for the second queue, and so on.
> *** No asynchronous completion for message.accept
> We do not currently delay completion of message.accept until the
> message is deleted from the async store. This could cause duplicate
> delivery if the broker crashes after completing the message but 
> before it is removed from store.
> There is code in PersistableMessage to maintain a counter for dequeues
> analogous to to the async enqueue code but this is incorrect. 
> Completion of transfer is triggered when all enqueues for a message are 
> complete.
> Completion of accept is triggered for *each* dequeue from a queue 
> independently.
> Furthermore a single accept can reference many messages, so it can't be 
> associated with a message.
> ** New requirements
> The new cluster design will need to participate in async completion, e.g.
> an accept cannot be comlpeted until the message is 
> - removed from store (if present) AND
> - replicated to the cluster (if present) as dequeued
> The new cluster also needs to asynchronously complete binding commands
> (declare, bind, delete) when they are replicated to the cluster.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to