serverless-appsync / serverless-appsync-simulator

A simple wrapper around Amplify AppSync Simulator to test serverless AppSync Apis
MIT License
127 stars 69 forks source link

High RAM Usage ~ 16GB #177

Open Lschulzes opened 1 year ago

Lschulzes commented 1 year ago

Describe the bug I suppose it is bug, or is just the way it is, but when I run my project, it consumes about 22GB of ram, which is insanely high. I already inspected dynamodb-local an it is responsible for 6GB, so sls-offline + appsync-simulator gives 16GB. Which makes it not viable for some devs of my team to work on.

To Reproduce My project is not opensource, but it does have about 200 lambdas and 200 resolvers. It also counts with 50 tables

Expected behavior To not consume so much memory

Screenshots If applicable, add screenshots to help explain your problem.

Additional context I want to understand if that is expected for the dimension of my project, or if someone has a project of similar size that consumes less RAM

twixr commented 1 year ago

Currently investigating an issue where if I upgrade serverless-appsync-simulator from 0.19.6 to 0.20.0 that GitLab CI job will fail with "Error: The service was stopped" And some stacktrace to esbuild. Online first clue was OOM, so might be related but not sure, Will further investigate if it is because of OOM from this module

Update: For me it was either CPU or memory, by reducing the amount of Lambda / appsync resolvers in my serverless.yml it worked. My fix was now to increase the memory and CPU of our GitLab runner so the server could start without throwing the "The server was stopped" error.