Aman-Mittal opened a new pull request, #164:
URL: https://github.com/apache/fineract-consumer-facing/pull/164
Fixes #162
**Stacked on #163** (spec sync). The first two commits belong to #163;
review the last two. I'll rebase this PR once #163 merges.
## What
**1. Generate the Fineract client only for the APIs in use**
- `sanitizeFineractSpec` now prunes the spec to:
- the operations tagged with an entry of `fineractApiTags`, plus the
untagged operations in `fineractUntaggedOperationIds`;
- the schemas those operations reach.
- The BFF and the Cucumber seeder use 18 of the spec's ~150 tags. Generated
models drop from 1,480 to 504, and about 140 unused Feign clients, each a bean
with its own child context, are no longer registered.
- Following the existing schema-targeted patches, the build fails if a
listed tag or operation disappears from the spec.
- The `fineract-integration.adoc` docs are updated.
**2. Size the BFF to run in 512 MB**
- `spring.threads.virtual.enabled=true`: a request waiting on Fineract costs
heap, not a platform thread.
- `spring.jpa.open-in-view=false`: the JDBC connection is released when the
transaction ends, not held across Fineract round trips. Without this,
concurrency is capped by the connection pool.
- The heap is sized from the container limit (`-XX:MaxRAMPercentage=60`) in
the image instead of a fixed `-Xmx768m` in compose. The image also exits on OOM
so the orchestrator can restart it.
- The compose memory limit defaults to `512m` (was `2g`), and
`BFF_MEM_LIMIT` still overrides it.
## Measurements
Each run is the full Cucumber suite (77 scenarios) against `apache/fineract`
develop. Memory is the container's `docker stats` usage, sampled every second.
| Configuration | Container limit | Startup | Idle | Scenarios |
|---|---|---|---|---|
| Before (`-Xmx768m`) | 2 GB | 9.2 s | 751 MiB | 77/77 |
| Pruned client only | 2 GB | 8.5 s | 710 MiB | 77/77 |
| This PR | 512 MB | 9.5 s | 414 MiB | 77/77, no OOM kill |
| This PR | 384 MB | 9.6 s | 375 MiB | 77/77, no OOM kill |
In the capped runs, peak usage reached the limit. That is reclaimable page
cache counted against the cgroup, not heap: no run was OOM-killed or restarted.
## Testing
- `./gradlew test`: all unit tests pass.
- `./gradlew cucumber`: 77/77 at both the 512 MB and 384 MB limits.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]