Answer the question
In order to leave comments, you need to log in
When increasing the load on nuxtjs, I get the error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory?
I get FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
when I load nuxtjs I
tried to solve it like this
"scripts": {
"dev": "<b>node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.js</b>",
"build": "<b>node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.js build</b>",
"start": "<b>node --max-old-space-size=8192 node_modules/nuxt/bin/nuxt.js start</b>",
"generate": "nuxt generate",
"test": "jest"
},
Answer the question
In order to leave comments, you need to log in
In general, I figured it out myself with all this, not quickly, of course, but I did it.
There was a mistake, because The load was not given to children, but at the same time the application worked on 1 core, but it could have been on 24.
The node could not cope with the load, the percentage was bent, the operative was eaten.
We decided it all as follows:
1. First, install PM2 and run it all in cluster mode.
2. We put ssr caching and everything starts to fly with us.
PM2 balances the load, monitors processes, restarts everything if something goes wrong.
The cache relieves the CPU of rendering data on each request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question