[ 
https://issues.apache.org/jira/browse/FINERACT-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adam Saghy updated FINERACT-2234:
---------------------------------
    Description: 
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 '{
}'

  was:
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:

 


> 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)

Reply via email to