Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#56 BillingProcess perf hardly depends of invoice quantity

Server
open
nobody
7
2010-01-25
2010-01-25
No

It was observed, that performance of the Billing Cycle (number of invoices, created during a minute) suffers from the total number of invoices created in the system:

- during the test there were created 10000 users and 1 order (with one item in it) for each user;
- the Billing Process was started;

The initial peformance of the Billing Process was ~300 invoices a minute, but after 10 minutes (when default ehcache caches expires) it shortly came down to 2-3 invoices a minute. (The same slowdown can be observed if restart jbilling after 5-6 minutes of billing processing.)

--- Found solution ---

After a brief investigation, the following code was found in BillingProcessDTO.java:

private Set<InvoiceDTO> invoices = new HashSet<InvoiceDTO>(0);

...

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "billingProcess")
@Fetch( FetchMode.JOIN)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Set<InvoiceDTO> getInvoices() {
return this.invoices;
}

public void setInvoices(Set<InvoiceDTO> invoices) {
this.invoices = invoices;
}

As long as no accessors of invoices collection (and no reasons to hold cascading between 'billing_process' and 'invoice' tables on hibernate level) were found, it was tried get rid of this collection.

This worked out: described slowdown disappeared. Nevertheless, there it is still the possibility of side effects and this fix is to be verified.

Discussion

    • priority: 5 --> 7
     
  • Patched BillingProcessDTO.java attached.