与WSO2 ESB中的Iterator Mediator问题

时间:2013-06-17 18:57:15

标签: wso2 esb

我有这样的场景:

  1. ESB中的代理服务会对服务进行调用并接收2.3到4.9MB之间的有效负载。
  2. 此有效负载包含人员列表。
  3. 使用此列表,我使用迭代器介体迭代它,并在每个元素内部调用DBReport介体将值存储在Person元素中。
  4. 当有效载荷有2.3MB时,所有工作都很好,数据会在几分钟内存储在我的数据库中,大约有5000个元素。

    但是有了4.9MB的有效载荷,它真的很慢,因为你可以很快看到RAM占用最大3.0GB的2.7。在那一刻,JMX监控被冻结,并且在3分钟内只有123个10 000个元素的记录被存储在DB

    一段时间后,处理继续并停止一段时间,您可以看到每个DBReport呼叫之间的延迟:

    TID: [0] [ESB] [2013-06-12 16:00:00,480]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:6a11bc08-8e1f-4c37-a031-fe9c84e395da, Direction: response, TEST = 06469 {org.apache.synapse.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:00:09,591]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:439fa810-3333-4cbf-bb68-08eb843ca408, Direction: response, TEST = 06471 {org.apache.synapse.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:00:15,555]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:24b5dacd-53dd-4d78-8f57-24944cdf2a84, Direction: response, TEST = 06475 {org.apache.synapse.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:01:33,420]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:2a8c77a9-ae60-4f84-901d-3b4f76a6b480, Direction: response, TEST = 06477 {org.apache.synapse.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:01:41,489]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:1f0632c3-91ee-4fae-b47e-2c88b73aed69, Direction: response, TEST = 06478 {org.apache.synapse.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:02:04,190]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:02b2b0ae-3d52-48c9-ad09-04e983501e3d, Direction: response, TEST = 06505 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:02:05,620]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:ae2b72d2-124d-4f34-8033-9036a2b0419a, Direction: response, TEST = 06507 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:02:07,411]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:ac951f44-c212-4a4d-93c2-9473677acf32, Direction: response, TEST = 06511 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:02:14,232]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:99e2804e-f70b-449f-9b5f-46f65d81638b, Direction: response, TEST = 06514 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:02:15,757]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:b0f1dfca-2eda-415c-9c11-3ea70168044e, Direction: response, TEST = 06516 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:11:57,247]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:9d92ecc9-3b70-440d-8195-c743da44ccd5, Direction: response, TEST = 06517 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:12:13,862]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:fac67fed-989c-44e2-91cb-c2b3b40460ee, Direction: response, TEST = 06522 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:12:28,531]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:635d74b9-23ae-435f-909e-c2c6ae171407, Direction: response, TEST = 06523 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:12:45,257]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     SOAPAction: , MessageID: urn:uuid:59a006e2-e2ef-4241-9439-10d9db5830c3, Direction: response, TEST = 06524 {org.apache.synapse.mediators.builtin.
    TID: [0] [ESB] [2013-06-12 16:19:46,585]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/an                     onymous, WSAction: , SOAPAction: , MessageID: urn:uuid:5d867db0-3e88-4798-9360-0f9a49b9c5ae, Direction: response, TEST = 06525 {org.apache.synap                     se.mediators.builtin.LogMediator}
    TID: [0] [ESB] [2013-06-12 16:20:06,866]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:ad48e642-eeb0-49ef-a25f-63f2f10534c0, Direction: response, TEST = 06530 {org.apache.synapse.mediators.builtin.LogMediator}
    

    有什么想法吗?

1 个答案:

答案 0 :(得分:1)

在WSO2 ESB中同步执行DBReport介体,这意味着执行此DBReport介体的线程将一直停留,直到数据库操作完成。这意味着性能低于异步执行时的性能。

因此,要获得最高性能,请使用WSO2数据服务服务器并使用DSS执行插入数据库操作。这样你就可以获得最大的性能。

最好是添加配置文件。这将有助于确定此问题的根本原因。