[
https://issues.apache.org/jira/browse/FINERACT-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949480#comment-17949480
]
Adam Saghy commented on FINERACT-2234:
--------------------------------------
[~pwargulak] Sorry for the delay.
I have updated the story with my measurements and also attached a dump of the
database I was using for testing.
You will find 1 loan product, 1 client and 1000 loans in it. These loans are 2
years interest bearing, interest recalculation, progressive loans.
In the measurements you can find as the time passes it getting slower and
slower... The main reason is the increasing number of loan transactions, but
also there are repetitive data fetches.
Hopefully this gives you a good starting point.
Also i will create subtask where I will list some of the idea how we can
improve the performance.
> Loan COB (Close of business day) performance improvements
> ---------------------------------------------------------
>
> Key: FINERACT-2234
> URL: https://issues.apache.org/jira/browse/FINERACT-2234
> Project: Apache Fineract
> Issue Type: Improvement
> Reporter: Adam Saghy
> Priority: Major
> Attachments: test_db.zip
>
>
> This story is aiming to review, analyse and improve the performance of the
> Loan COB job, including its business steps!
> *Loan account*
> 24 months loan, 1 repayment every month, daily interest recognition → 700 +
> Accrual transactions at the end of the loan lifecycle!
> *Some numbers*
> Machine
> CPU: Apple M4 Pro
> Total Number of Cores: 14 (10 performance and 4 efficiency)
> Memory: 48 GB
> DB
> Postgres
> 2 CPU
> 8GB + 1GB swap
> *Use cases*
> Fetch loan details (including transactions) on Day 1: 50ms
> Fetch loan details (including transactions) on Day 30: 50ms
> Fetch loan details (including transactions) on Day 100: 55ms
> Fetch loan details (including transactions) on Day 300: 64ms
> Fetch loan details (including transactions) on Day 700: 161ms
> *COB use cases*
> 1000 loans, interest recalculation, daily accrual, etc.
> COB on Day 1: 16.910778 seconds
> COB on Day 30: 20.510786 seconds
> COB on Day 100: 19.157299 seconds
> COB on Day 300: 32.773403 seconds
> COB on Day 700: 62.642021 seconds
>
> *Major issues*
> - Unnecessary data fetching during Loan Close of Business job (business
> steps) -> Rework to avoid unnecessary, repetitive data fetching
> - Loan entity fetches all loan transactions via associations -> Rework to
> fetch only the necessary transactions!
>
> *Test DB*
> * *[^test_db.zip]*
> *1 Progressive, loan product, 24 month, 1 repayment per month*
> *1 client, 1000 loans with disbursement date of 26 April 2025*
> *Current business date is 27 April 2025*
>
> To run COB for 1 day:
> * Set new business date to 28 April 2025
> * Run Loan COB job
>
> To run COB for many days, like run it for a week:
> * Set new business date to 5 May 2025
> * Run COB catch-up:
> ** curl --location
> 'http://localhost:8080/fineract-provider/api/v1/loan/catch-up' \
> --header 'Fineract-Platform-TenantId: default' \
> --header 'Content-Type: application/json' \
> --header 'Authorization: Basic bWlmb3M6cGFzc3dvcmQ=' \
> --data '{
> }'
--
This message was sent by Atlassian Jira
(v8.20.10#820010)