D
D
dinya172019-09-02 16:12:22
Node.js
dinya17, 2019-09-02 16:12:22

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"
  },

But as it turned out - it does not help. Maybe someone faced this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dinya17, 2019-09-09
@dinya17

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 question

Ask a Question

731 491 924 answers to any question