aditmalik-synechron / serverless-nested-stack

Serverless nested stack
42 stars 10 forks source link

Examples / more Documentation #1

Closed Rukenshia closed 6 years ago

Rukenshia commented 6 years ago

We're currently running into a resource problem with our API Gateway and stumbled upon this plugin. I can't really figure out how to use this exactly, though. Can you please provide more information or an example of actually using this in this repo?

Thanks!

jagdish-176 commented 6 years ago

Updated readme. You can use you existing serverless yml file to test

Let me know if you run into problem after sls deploy

Rukenshia commented 6 years ago

Deployment doesn't work, getting a heap error:



<--- Last few GCs --->

[14140:0000000000391320]    64183 ms: Mark-sweep 1416.3 (1481.1) -> 1416.3 (1481.1) MB, 1129.8 / 0.0 ms  allocation failure GC in old space requested
[14140:0000000000391320]    65334 ms: Mark-sweep 1416.3 (1481.1) -> 1416.2 (1450.1) MB, 1150.7 / 0.0 ms  last resort gc
[14140:0000000000391320]    66470 ms: Mark-sweep 1416.2 (1450.1) -> 1416.2 (1450.1) MB, 1136.3 / 0.0 ms  last resort gc

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0000034640DC0D59 <JS Object>
    0: builtin exit frame: captureStackTrace(aka captureStackTrace)(this=0000034640D04311 <undefined>,00000375228EBB29 <JS Function CapturedTrace (SharedFunctionInfo 000003FF66482961)>,000000804CF77E11 <a CapturedTrace with map 000002F6629D4759>)

    1: _captureStackTrace(aka longStackTracesCaptureStackTrace) [C:\Users\me\AppData\Roaming\npm\node_modules\serverless\node_modules\blu...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory```
jagdish-176 commented 6 years ago

This plugin does heavy computation on serverless cloud-formation.json (Need to work on)

Currently I'm testing on 4GB RAM, and works fine. on how much memory you are testing with?

Rukenshia commented 6 years ago

We've tested it on a machine with 32GB of RAM. it seems like node is hitting some limit here as the machine still has ~10GB ram free, node taking up up to 1.5GB

AndrewBarba commented 6 years ago

You can run with node directly and the max_old_space_size option to use more ram:

node ./node_modules/serverless/bin/serverless --max_old_space_size=4096 deploy