Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark the Mojaloop Simulator #3669

Closed
9 of 17 tasks
PaulGregoryBaker opened this issue Nov 30, 2023 · 3 comments
Closed
9 of 17 tasks

Benchmark the Mojaloop Simulator #3669

PaulGregoryBaker opened this issue Nov 30, 2023 · 3 comments

Comments

@PaulGregoryBaker
Copy link

PaulGregoryBaker commented Nov 30, 2023

Goal:

As a Mojaloop Community member interested in running a hub
I want to understand the performance of a mojaloop
so that appropriately size my environment

Note: This story is about the characterisaction of the mojaloop simulator, so that it can be included in a wider performance test, and it's performance is known and understood and taken into consideration in that work.

Acceptance Criteria:

  • Verify that the throughput and latency is calculated for the mojaloop simulator on reasonable hardware for the following calls:
    • get parties
    • post quoteRequest
    • post transfers

Complexity: <High|Medium|Low> > A short comment to remind the reason for the rating

Uncertainty: <High|Medium|Low> > A short comment to remind the reason for the rating


Tasks:

  • Add party info to ML-SIM using testAPI for firsttime after you start the service (Using postman, curl ...etc. Doesn't need to be from K6)
  • Prepare a k6 test case to trigger GET /parties
  • Assert on http status code
  • Modify the k6 scenarios to find the best performance config (VUs, target http rate, etc)
  • Continue with quotes and transfers

Done

  • Acceptance Criteria pass
  • Designs are up-to date
  • Unit Tests pass
  • Integration Tests pass
  • Code Style & Coverage meets standards
  • Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment config.
  • TBD

Pull Requests:

Follow-up:

  • N/A

Dependencies:

  • N/A

Accountability:

  • Owner: TBC
  • QA/Review: TBC
@PaulGregoryBaker PaulGregoryBaker added story to-be-refined This story is ready to be groomed core-dev-squad labels Nov 30, 2023
@PaulGregoryBaker
Copy link
Author

@PaulGregoryBaker PaulGregoryBaker added PI-23 and removed to-be-refined This story is ready to be groomed labels Nov 30, 2023
@aaronreynoza aaronreynoza self-assigned this Dec 4, 2023
@aaronreynoza
Copy link
Member

Running tests on the quotes and transfers makes the simulator run out of memory with the following error:

simulator  | 
simulator  | <--- Last few GCs --->
simulator  | 
simulator  | [22:0x7fa8ab4eb020]    94332 ms: Mark-sweep 4050.7 (4138.2) -> 4037.9 (4141.7) MB, 1608.6 / 0.0 ms  (average mu = 0.401, current mu = 0.107) allocation failure; scavenge might not succeed
simulator  | [22:0x7fa8ab4eb020]    97425 ms: Mark-sweep 4052.4 (4141.7) -> 4040.6 (4144.5) MB, 3056.1 / 0.0 ms  (average mu = 0.177, current mu = 0.012) task; scavenge might not succeed
simulator  | 
simulator  | 
simulator  | <--- JS stacktrace --->
simulator  | 
simulator  | FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 

SIM is unable to handle more than 700 requests per second as it bloats the memory. Test cases for this story are added on the PR mentioned above but they're unable to run until the memory leak on the sim is fixed.

@aaronreynoza
Copy link
Member

aaronreynoza commented Dec 13, 2023

Bug created after this story regarding a memory leak:
#3690

Attaching monitoring results for get /party, post /quote and post /transfer:

k6-getParty
k6-postTransfer
prometheus-postTransfer

prometheus-getParty
k6-postQuote-1000
prometheus-postQuote-1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants