ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-5843) Improve storeOrder service performance and reliability
Date Thu, 30 Oct 2014 18:13:34 GMT

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

Jacques Le Roux commented on OFBIZ-5843:
----------------------------------------

At revision: 1635567, I have put back the service call since it did not make any differences
with the direct method call. Using the same load test I got no timeout like before with the
Minilang implementation.

Scott suggested:
# The service should be executed in separate transaction after the order submission transaction
is committed.
# Or as an alternative it could be run in the same transaction right before committing, to
reduce the amount of time the lock is held.

It must be run in the same transaction (else another thread might change the context) so Scott's
last proposition seems to be the right solution. I did not implement it though since I did
not need it.

Jacques


Le 30/10/2014 08:40, Scott Gray a écrit :
> Or as an alternative it could be run in the same transaction right before committing,
to reduce the amount of time the lock is held.


> Improve storeOrder service performance and reliability
> ------------------------------------------------------
>
>                 Key: OFBIZ-5843
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5843
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: Trunk
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Upcoming Branch
>
>
> The storeOrder service, implemented by the OrderService.createOrder() method, synchronously
calls the countProductQuantityOrdered service implemented in Minilang. OOTB, the countProductQuantityOrdered
service is only called by the storeOrder service implementation. It's called inside a loop
on orderItems.
> While intentionally load testing a custom project with JMeter on a weak m1.small AWS
machine, I noticed the overhead of the service call for each order item iteration was significant
on this slow machine. With only 30 concurrent users the process was blocked by  a timeout
on the countProductQuantityOrdered service.
> I then decided to transform the Minilang code into an OrderService.countProductQuantityOrdered()
method that can be directly called inside OrderService.createOrder() and also implements the
countProductQuantityOrdered service. Hence it avoids the overhead of the  Minilang service
calls in loop while still providing a countProductQuantityOrdered service for possible external
uses. For that I moved the definition from Product component to Order component to avoid the
hard coded dependency of Order to Product. I then did not cross issues with the same load
test.
> I also added a test for the countProductQuantityOrdered service by adding an order item
of a virtual product (GZ-1006-1) in SalesOrderTest.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message